From aba8c12f679c2324fa42e718beab8e9d57409102 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sun, 14 Mar 1999 16:03:33 +0000 Subject: [PATCH] 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 --- src/Makefile.shlib | 8 ++++++-- src/backend/port/dynloader/bsd.c | 2 ++ src/backend/storage/buffer/s_lock.c | 6 +++--- src/backend/utils/adt/dt.c | 4 ++-- src/config.guess | 3 +++ src/configure.in | 7 ++++++- src/include/port/bsd.h | 6 ++++++ src/include/port/linux.h | 4 ++-- src/include/utils/dt.h | 6 +++--- src/makefiles/Makefile.bsd | 7 +++++++ src/test/regress/expected/euc_jp.out | 2 +- 11 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/Makefile.shlib b/src/Makefile.shlib index 7f1d083b11..c35bf8d825 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 48d0d3cc41..c54b2e0023 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 10b649f3ef..788d67dae5 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 a971e5006e..84411f26f8 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 0db17eaca2..851ed5f49b 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 cf1b969812..11f7f1a748 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 4e754e77de..cfd0d2811b 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 81169b2c0c..da57b2b9a3 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 ff3ae468f5..024acb4c63 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 1c17504605..58df0e955d 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 f976010e76..b0bdfbac9a 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 (ʬÎॳ¡¼¥É); -- 2.11.0