Subject: pkg/7959: postgresql-patching fails
To: None <gnats-bugs@gnats.netbsd.org>
From: Bjoern Labitzke <hermit@labitzke.isdn.cs.tu-berlin.de>
List: netbsd-bugs
Date: 07/11/1999 06:23:39
>Number:         7959
>Category:       pkg
>Synopsis:       postgresql patching fails
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager (NetBSD software packages system bug manager)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 11 06:05:00 1999
>Last-Modified:
>Originator:     Bjoern Labitzke
>Organization:
Bjoern Labitzke  <hermit@cs.tu-berlin.de>
   Use PGP! (Don't you use envelopes for your letters?)
>Release:        -current and pkgsrc from 10.7.1999 <NetBSD-current source date>
>Environment:
	
System: NetBSD labitzke.isdn.cs.tu-berlin.de 1.4F NetBSD 1.4F (LABITZKE) #93: Sun Jul 11 03:26:57 CEST 1999 root@labitzke.isdn.cs.tu-berlin.de:/usr/src/sys/arch/i386/compile/LABITZKE i386


>Description:
The patch patch-af fails to apply, because there it seems to be made against
differing sources than the original ones. There is the powerpc mentioned in the
patch, but there is no powerpc in the original file. (include/port/bsd.h)

/usr/pkgsrc/databases/postgresql: more work/postgresql-6.4.2/src/include/port/bsd.h.rej
***************
*** 24,29 ****
  #define HAS_TEST_AND_SET
  #endif

  #if defined(__powerpc__)
  #define HAS_TEST_AND_SET
  typedef unsigned int slock_t;
--- 24,33 ----
  #define HAS_TEST_AND_SET
  #endif

+ #if defined(__arm32__)
+ #define HAS_TEST_AND_SET
+ #endif
+
  #if defined(__powerpc__)
  #define HAS_TEST_AND_SET
  typedef unsigned int slock_t;

	
>How-To-Repeat:
cd /usr/pkgsrc/databases/postgresql
make
	
>Fix:
I deleted the part that patched bsd.h from patch-af and created a patch-ag,
which includes the arm32-change from the original patch plus the lines I
saw for the powerpc. I don't know if they would work this way, so someone
knowledgable should check this. Here are the changed patches:

patch-af:
$NetBSD: patch-af,v 1.4 1999/05/18 15:52:19 bad Exp $

*** include/storage/s_lock.h  Sat Apr 10 19:43:01 1999
--- include/storage/s_lock.h  Wed Apr  7 03:06:53 1999
***************
*** 124,129 ****
--- 124,145 ----



+ #if defined(__arm32__)
+ #define TAS(lock) tas(lock)
+
+ static __inline__ int
+ tas(volatile slock_t *lock)
+ {
+         register slock_t _res = 1;
+
+ __asm__("swpb %0, %0, [%3]": "=r"(_res), "=m"(*lock):"0"(_res), "r" (lock));
+         return (int) _res;
+ }
+
+ #endif   /* __arm32__ */
+
+
+
  #if defined(sparc)
  #define TAS(lock) tas(lock)


patch-ag:
--- include/port/bsd.h.orig     Sun Jul 19 03:19:53 1998
+++ include/port/bsd.h  Sun Jul 11 14:39:21 1999
@@ -28,3 +28,11 @@
 /* #   undef HAS_TEST_AND_SET */
 #endif
 typedef unsigned char slock_t;
+
+#if defined(__arm32__)
+#define HAS_TEST_AND_SET
+#endif
+
+#if defined(__powerpc__)
+#define HAS_TEST_AND_SET
+typedef unsigned int slock_t;
+#endif

	
>Audit-Trail:
>Unformatted: