postgresql-7.0.2-ia64.dif

text/plain

Filename: postgresql-7.0.2-ia64.dif
Type: text/plain
Part: 0
Message: Patch for Linux-IA64
--- src/Makefile.shlib
+++ src/Makefile.shlib	2000/06/20 11:14:17
@@ -145,9 +145,9 @@
 ifeq ($(PORTNAME), linux)
   install-shlib-dep	:= install-shlib
   shlib				:= lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
-  LDFLAGS_SL		:= -Bdynamic -shared -soname $(shlib)
-  LDFLAGS_ODBC		:= -Bsymbolic -lc -lm
-  SHLIB_LINK		+= -lc
+  LD			:= $(CC)
+  LDFLAGS_SL		:= -shared -Wl,-soname,$(shlib)
+  LDFLAGS_ODBC		:= -nostartfiles -Wl,-Bsymbolic -lm
   CFLAGS			+= $(CFLAGS_SL)
 endif
 
--- src/configure
+++ src/configure	2000/06/20 09:18:25
@@ -4928,6 +4928,7 @@
 cat > conftest.$ac_ext <<EOF
 #line 4930 "configure"
 #include "confdefs.h"
+#include <stdio.h>
 #include <fcntl.h>
 int main() {
 struct flock lck;
--- src/configure.in
+++ src/configure.in	2000/06/20 09:17:54
@@ -786,7 +786,8 @@
 	    AC_MSG_RESULT(no))
 
 AC_MSG_CHECKING(for fcntl(F_SETLK))
-AC_TRY_LINK([#include <fcntl.h>],
+AC_TRY_LINK([#include <stdio.h>
+#include <fcntl.h>],
 	    [struct flock lck;
 	     lck.l_whence = SEEK_SET; lck.l_start = lck.l_len = 0;
 	     lck.l_type = F_WRLCK;
--- src/include/port/linux.h
+++ src/include/port/linux.h	2000/06/20 09:35:00
@@ -33,7 +33,12 @@
 #define HAS_TEST_AND_SET
 
 #elif defined(__arm__)
-typedef unsigned char slock_t
+typedef unsigned char slock_t;
+
+#define HAS_TEST_AND_SET
+
+#elif defined(__ia64__)
+typedef unsigned int slock_t;
 
 #define HAS_TEST_AND_SET
 
--- src/include/storage/s_lock.h
+++ src/include/storage/s_lock.h	2000/06/20 09:40:50
@@ -95,6 +95,24 @@
 #endif	 /* __i386__ */
 
 
+#ifdef __ia64__
+#define TAS(lock) tas(lock)
+
+static __inline__ int
+tas (volatile slock_t *lock)
+{
+  long int ret;
+
+  __asm__ __volatile__(
+       "xchg4 %0=%1,%2"
+       : "=r"(ret), "=m"(*lock)
+       : "r"(1), "1"(*lock)
+       : "memory");
+
+  return (int) ret;
+}
+#endif /* __ia64__ */
+
 
 #if defined(__arm__) || defined(__arm__)
 #define TAS(lock) tas(lock)
--- src/backend/libpq/pqcomm.c
+++ src/backend/libpq/pqcomm.c  2000/07/03 08:47:43
@@ -75,6 +75,12 @@
 #include "postgres.h"
 
 #include "libpq/libpq.h"
+
+/* Hack for broken fcntl(F_SETLK) in Linux Kernels < 2.2.16 */
+#ifdef HAVE_FCNTL_SETLK
+#undef HAVE_FCNTL_SETLK
+#endif
+
 #include "utils/trace.h"		/* needed for HAVE_FCNTL_SETLK */
 #include "miscadmin.h"