aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>1999-03-14 16:03:33 +0000
committerBruce Momjian <bruce@momjian.us>1999-03-14 16:03:33 +0000
commitaba8c12f679c2324fa42e718beab8e9d57409102 (patch)
treead8d1616fae148f4965555490450fda011b1694c
parente94fffc1c1c822b16b82dcf7dab8d82ed2625d3d (diff)
downloadpostgresql-aba8c12f679c2324fa42e718beab8e9d57409102.tar.gz
postgresql-aba8c12f679c2324fa42e718beab8e9d57409102.zip
We have tested the patches on three platforms:
NetBSD/macppc LinuxPPC FreeBSD 2.2.6-RELEASE All of them seem happy with the regression test. Note that, however, compiling with optimization enabled on NetBSD/macppc causes an initdb failure (other two platforms are ok). After checking the asm code, we are suspecting that might be a compiler(egcs) bug. Tatsuo Ishii
-rw-r--r--src/Makefile.shlib8
-rw-r--r--src/backend/port/dynloader/bsd.c2
-rw-r--r--src/backend/storage/buffer/s_lock.c6
-rw-r--r--src/backend/utils/adt/dt.c4
-rwxr-xr-xsrc/config.guess3
-rw-r--r--src/configure.in7
-rw-r--r--src/include/port/bsd.h6
-rw-r--r--src/include/port/linux.h4
-rw-r--r--src/include/utils/dt.h6
-rw-r--r--src/makefiles/Makefile.bsd7
-rw-r--r--src/test/regress/expected/euc_jp.out2
11 files changed, 41 insertions, 14 deletions
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 7f1d083b113..c35bf8d825b 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -6,7 +6,7 @@
# Copyright (c) 1998, Regents of the University of California
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.6 1999/01/17 06:18:08 momjian Exp $
+# $Header: /cvsroot/pgsql/src/Makefile.shlib,v 1.7 1999/03/14 16:02:57 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -73,7 +73,11 @@ ifeq ($(PORTNAME), bsd)
ifdef BSD_SHLIB
install-shlib-dep := install-shlib
shlib := lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
- LDFLAGS_SL := -x -Bshareable -Bforcearchive
+ ifdef ELF_SYSTEM
+ LDFLAGS_SL := -x -Bshareable -soname $(shlib)
+ else
+ LDFLAGS_SL := -x -Bshareable -Bforcearchive
+ endif
CFLAGS += $(CFLAGS_SL)
endif
endif
diff --git a/src/backend/port/dynloader/bsd.c b/src/backend/port/dynloader/bsd.c
index 48d0d3cc413..c54b2e00237 100644
--- a/src/backend/port/dynloader/bsd.c
+++ b/src/backend/port/dynloader/bsd.c
@@ -79,6 +79,8 @@ BSD44_derived_dlsym(void *handle, const char *name)
#if defined(__mips__) || (defined(__NetBSD__) && defined(vax))
sprintf(error_message, "dlsym (%s) failed", name);
return NULL;
+#elif defined(__ELF__)
+ return dlsym(handle, name);
#else
void *vp;
char buf[BUFSIZ];
diff --git a/src/backend/storage/buffer/s_lock.c b/src/backend/storage/buffer/s_lock.c
index 10b649f3ef6..788d67dae55 100644
--- a/src/backend/storage/buffer/s_lock.c
+++ b/src/backend/storage/buffer/s_lock.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.17 1999/02/13 23:18:02 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/buffer/Attic/s_lock.c,v 1.18 1999/03/14 16:03:00 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -118,7 +118,7 @@ _success: \n\
#endif /* __m68k__ */
-#if defined(PPC)
+#if defined(__powerpc__)
/* Note: need a nice gcc constrained asm version so it can be inlined */
static void
tas_dummy()
@@ -140,7 +140,7 @@ success: \n\
");
}
-#endif /* PPC */
+#endif /* __powerpc__ */
#if defined(__mips)
static void
diff --git a/src/backend/utils/adt/dt.c b/src/backend/utils/adt/dt.c
index a971e5006e2..84411f26f8a 100644
--- a/src/backend/utils/adt/dt.c
+++ b/src/backend/utils/adt/dt.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.65 1999/02/13 23:19:11 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/dt.c,v 1.66 1999/03/14 16:03:04 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -4533,7 +4533,7 @@ EncodeTimeSpan(struct tm * tm, double fsec, int style, char *str)
} /* EncodeTimeSpan() */
-#if defined(linux) && defined(PPC)
+#if defined(linux) && defined(__powerpc__)
int
datetime_is_epoch(double j)
{
diff --git a/src/config.guess b/src/config.guess
index 0db17eaca2f..851ed5f49b6 100755
--- a/src/config.guess
+++ b/src/config.guess
@@ -129,6 +129,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
mac68k:OpenBSD:*:*)
echo m68k-apple-openbsd${UNAME_RELEASE}
exit 0 ;;
+ macppc:NetBSD:*:*)
+ echo powerpc-apple-netbsd${UNAME_RELEASE}
+ exit 0;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit 0 ;;
diff --git a/src/configure.in b/src/configure.in
index cf1b969812d..11f7f1a7485 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -22,7 +22,12 @@ case "$host_os" in
bsdi*) os=bsdi need_tas=no ;;
freebsd3*|freebsd4*) os=freebsd need_tas=no elf=yes ;;
freebsd1*|freebsd2*) os=freebsd need_tas=no ;;
- netbsd*|openbsd*) os=bsd need_tas=no ;;
+ netbsd*)
+ os=bsd need_tas=no
+ case "$host_cpu" in
+ powerpc) elf=yes ;;
+ esac ;;
+ openbsd*) os=bsd need_tas=no ;;
dgux*) os=dgux need_tas=no ;;
aix*) os=aix need_tas=no ;;
nextstep*) os=nextstep need_tas=no ;;
diff --git a/src/include/port/bsd.h b/src/include/port/bsd.h
index 4e754e77dec..cfd0d2811bd 100644
--- a/src/include/port/bsd.h
+++ b/src/include/port/bsd.h
@@ -24,7 +24,13 @@
#define HAS_TEST_AND_SET
#endif
+#if defined(__powerpc__)
+#define HAS_TEST_AND_SET
+typedef unsigned int slock_t;
+#endif
#if defined(__mips__)
/* # undef HAS_TEST_AND_SET */
#endif
+#if !defined(__powerpc__)
typedef unsigned char slock_t;
+#endif
diff --git a/src/include/port/linux.h b/src/include/port/linux.h
index 81169b2c0c9..da57b2b9a3d 100644
--- a/src/include/port/linux.h
+++ b/src/include/port/linux.h
@@ -8,7 +8,7 @@
#define USE_POSIX_TIME
#define HAS_TEST_AND_SET
-#if defined(PPC)
+#if defined(__powerpc__)
typedef unsigned int slock_t;
#elif defined(__alpha)
@@ -34,6 +34,6 @@ typedef unsigned char slock_t;
/* #define HAVE_SIGSETJMP 1 */
#endif
-#if defined(PPC)
+#if defined(__powerpc__)
#undef HAVE_INT_TIMEZONE
#endif
diff --git a/src/include/utils/dt.h b/src/include/utils/dt.h
index ff3ae468f58..024acb4c63a 100644
--- a/src/include/utils/dt.h
+++ b/src/include/utils/dt.h
@@ -8,7 +8,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
- * $Id: dt.h,v 1.37 1999/03/06 22:58:11 tgl Exp $
+ * $Id: dt.h,v 1.38 1999/03/14 16:03:16 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -228,7 +228,7 @@ typedef struct
#define DATETIME_IS_NOEND(j) (j == DT_NOEND)
#define DATETIME_CURRENT(j) {j = DT_CURRENT;}
-#if defined(linux) && defined(PPC)
+#if defined(linux) && defined(__powerpc__)
extern int datetime_is_current(double j);
#define DATETIME_IS_CURRENT(j) datetime_is_current(j)
@@ -237,7 +237,7 @@ extern int datetime_is_current(double j);
#endif
#define DATETIME_EPOCH(j) {j = DT_EPOCH;}
-#if defined(linux) && defined(PPC)
+#if defined(linux) && defined(__powerpc__)
extern int datetime_is_epoch(double j);
#define DATETIME_IS_EPOCH(j) datetime_is_epoch(j)
diff --git a/src/makefiles/Makefile.bsd b/src/makefiles/Makefile.bsd
index 1c17504605c..58df0e955d5 100644
--- a/src/makefiles/Makefile.bsd
+++ b/src/makefiles/Makefile.bsd
@@ -1,4 +1,10 @@
+ifdef ELF_SYSTEM
+LDFLAGS += -Wl,-E
+endif
%.so: %.o
+ifdef ELF_SYSTEM
+ $(LD) -x -Bshareable -o $@ $<
+else
$(LD) -x -r -o $<.obj $<
@echo building shared object $@
@rm -f $@.pic
@@ -7,3 +13,4 @@
@rm -f $@
$(LD) -x -Bshareable -Bforcearchive \
-o $@ $@.pic
+endif
diff --git a/src/test/regress/expected/euc_jp.out b/src/test/regress/expected/euc_jp.out
index f976010e76b..b0bdfbac9af 100644
--- a/src/test/regress/expected/euc_jp.out
+++ b/src/test/regress/expected/euc_jp.out
@@ -1,5 +1,5 @@
QUERY: drop table 計算機用語;
-ERROR: Relation 計算機用語 Does Not Exist!
+ERROR: Relation '計算機用語' does not exist
QUERY: create table 計算機用語 (用語 text, 分類コード varchar, 備考1Aだよ char(16));
QUERY: create index 計算機用語index1 on 計算機用語 using btree (用語);
QUERY: create index 計算機用語index2 on 計算機用語 using hash (分類コード);