X-Original-To: pgsql-ports-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 6B7B352828 for ; Thu, 16 Jun 2005 18:26:52 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 48925-10 for ; Thu, 16 Jun 2005 21:26:42 +0000 (GMT) Received: from mail.libertyrms.com (unknown [207.219.45.62]) by svr1.postgresql.org (Postfix) with ESMTP id 34D5C52814 for ; Thu, 16 Jun 2005 18:26:41 -0300 (ADT) Received: from dba4.int.libertyrms.com ([10.1.3.13] ident=ahammond) by mail.libertyrms.com with esmtp (Exim 4.22) id 1Dj1sp-0003D5-G7 for pgsql-ports@postgresql.org; Thu, 16 Jun 2005 17:26:43 -0400 Message-ID: <42B1EE93.2040502@ca.afilias.info> Date: Thu, 16 Jun 2005 17:26:43 -0400 From: Andrew Hammond Organization: Afilias Canada Corp. User-Agent: Debian Thunderbird 1.0.2 (X11/20050602) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-ports@postgresql.org Subject: Re: pthreads issue when compiling 7.4.8 on AIX 5.3 References: <200506162028.j5GKS0O19411@candle.pha.pa.us> In-Reply-To: <200506162028.j5GKS0O19411@candle.pha.pa.us> X-Enigmail-Version: 0.91.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SA-Exim-Mail-From: ahammond@ca.afilias.info X-SA-Exim-Scanned: No; SAEximRunCond expanded to false X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.482 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO, INFO_TLD X-Spam-Level: X-Archive-Number: 200506/25 X-Sequence-Number: 2128 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Sure enough, there's some _XOPEN_SOURCE magic around them: #if (_XOPEN_SOURCE >= 600) typedef struct { #ifdef __64BIT__ long __sp_word[3]; #else int __sp_word[6]; #endif /* __64BIT__ */ } pthread_spinlock_t; typedef struct { #ifdef __64BIT__ long __br_word[5]; #else int __br_word[8]; #endif /* __64BIT__ */ } pthread_barrier_t; #endif /* _XOPEN_SOURCE >= 600 */ #if (_XOPEN_SOURCE >= 600) typedef void *pthread_barrierattr_t; #endif So... I went hunting to see where _XOPEN_SOURCE is defined and found it in standards.h which is included all over the place, including sys/types.h /* If _XOPEN_SOURCE is defined without a value, or with a value less * than 500 (UNIX98), then set a value, so that #if statements will * work properly. */ #ifdef _XOPEN_SOURCE #if ((_XOPEN_SOURCE + 0) < 500) #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 1 #endif #endif #if defined(_UNIX03) || (_XOPEN_SOURCE==600) #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 600 #undef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 #undef _POSIX_C_SOURCE #define _POSIX_C_SOURCE 200112L #undef _THREAD_SAFE #define _THREAD_SAFE #endif #if defined(_UNIX98) || (_XOPEN_SOURCE==500) #undef _XOPEN_SOURCE #define _XOPEN_SOURCE 500 #undef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 #endif #ifdef _UNIX95 #undef _XOPEN_SOURCE_EXTENDED #define _XOPEN_SOURCE_EXTENDED 1 #endif #if (_XOPEN_SOURCE_EXTENDED==1) #ifndef _XOPEN_SOURCE #define _XOPEN_SOURCE 1 #endif /* _XOPEN_SOURCE */ #endif /* _XOPEN_SOURCE_EXTENDED */ #ifdef _XOPEN_SOURCE #ifndef _POSIX_SOURCE #define _POSIX_SOURCE #endif #endif I also made sure that it's not being defined or undefined anywhere else in the include paths. Then, I tried overriding the _XOPEN_SOURCE variable on the command line for gcc, but, still no luck. - -bash-2.05b$ gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes - -Wmissing-declarations -I../../../src/include - -I/opt/dbs/readline/include -I/opt/dbs/zlib/include - -I/opt/freeware/include -D _XOPEN_SOURCE=600 -c -o thread_test.o thread_test.c In file included from thread_test.c:23: /usr/include/pthread.h:652: error: parse error before '*' token /usr/include/pthread.h:655: error: parse error before '*' token /usr/include/pthread.h:658: error: parse error before '*' token /usr/include/pthread.h:661: error: parse error before '*' token /usr/include/pthread.h:664: error: parse error before '*' token /usr/include/pthread.h:672: error: parse error before '*' token /usr/include/pthread.h:675: error: parse error before '*' token /usr/include/pthread.h:678: error: parse error before '*' token /usr/include/pthread.h:681: error: parse error before '*' token /usr/include/pthread.h:689: error: parse error before '*' token /usr/include/pthread.h:693: error: parse error before '*' token /usr/include/pthread.h:696: error: parse error before '*' token I'd like to believe I'm missing something really obvious here... :) - -- Andrew Hammond 416-673-4138 ahammond@ca.afilias.info Database Administrator, Afilias Canada Corp. CB83 2838 4B67 D40F D086 3568 81FC E7E5 27AF 4A9A Bruce Momjian wrote: > I would look around in sys/types.h to see if there is a #define that is > preventing the symbol from being exported. > > --------------------------------------------------------------------------- > > Andrew Hammond wrote: > > I'm seeing the following errors when compiling postgres 7.4.8 (vanilla) > on AIX 5.3 > > make[2]: Entering directory `/opt/src/postgresql-7.4.8/src/port' > gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes > -Wmissing-declarations -I../../src/include -I/opt/dbs/readline/include > -I/opt/dbs/zlib/include -I/opt/freeware/include -c thread.c > In file included from thread.c:25: > /usr/include/pthread.h:652: error: parse error before '*' token > /usr/include/pthread.h:655: error: parse error before '*' token > /usr/include/pthread.h:658: error: parse error before '*' token > /usr/include/pthread.h:661: error: parse error before '*' token > /usr/include/pthread.h:664: error: parse error before '*' token > /usr/include/pthread.h:672: error: parse error before '*' token > /usr/include/pthread.h:675: error: parse error before '*' token > /usr/include/pthread.h:678: error: parse error before '*' token > /usr/include/pthread.h:681: error: parse error before '*' token > /usr/include/pthread.h:689: error: parse error before '*' token > /usr/include/pthread.h:693: error: parse error before '*' token > /usr/include/pthread.h:696: error: parse error before '*' token > make[2]: *** [thread.o] Error 1 > make[2]: Leaving directory `/opt/src/postgresql-7.4.8/src/port' > > I've looked into pthread.h and it's refereing to pthread_barrier_t, > pthread_barrierattr_t and pthread_spinlock_t. These do not exist in > pthread.h on our 5.1 box. However they are defined in sys/types.h which > is included up near the top pthread.h. > > I'm somewhat at a loss about where this could be going wrong. > > Configure options follow > > ./configure --prefix=/opt/dbs/pgsql748-slony105-AIX53-2005-06-13 > - > --with-includes=/opt/dbs/readline/include:/opt/dbs/zlib/include:/usr/ccs/include:/opt/freeware/include:/usr/local/include > - > --with-libraries=/opt/dbs/readline/lib:/opt/dbs/zlib/lib:/usr/ccs/lib:/opt/freeware/lib:/usr/local/lib > --enable-thread-safety --enable-debug --enable-aix64 > > Note that this binary will need to have slony support which is why the > --enable-thread-safety. We've had success compiling postgres on AIX 5.1 > with identical settings. We're using gcc 3.3.2 > > The thread_test program fails identically: > > -bash-2.05b$ make > gcc -O2 -fno-strict-aliasing -g -Wall -Wmissing-prototypes > -Wmissing-declarations -I../../../src/include > -I/opt/dbs/readline/include -I/opt/dbs/zlib/include > -I/opt/freeware/include -c -o thread_test.o thread_test.c > In file included from thread_test.c:23: > /usr/include/pthread.h:652: error: parse error before '*' token > /usr/include/pthread.h:655: error: parse error before '*' token > /usr/include/pthread.h:658: error: parse error before '*' token > /usr/include/pthread.h:661: error: parse error before '*' token > /usr/include/pthread.h:664: error: parse error before '*' token > /usr/include/pthread.h:672: error: parse error before '*' token > /usr/include/pthread.h:675: error: parse error before '*' token > /usr/include/pthread.h:678: error: parse error before '*' token > /usr/include/pthread.h:681: error: parse error before '*' token > /usr/include/pthread.h:689: error: parse error before '*' token > /usr/include/pthread.h:693: error: parse error before '*' token > /usr/include/pthread.h:696: error: parse error before '*' token > make: *** [thread_test.o] Error 1 > > -- > Andrew Hammond 416-673-4138 ahammond@ca.afilias.info > Database Administrator, Afilias Canada Corp. > CB83 2838 4B67 D40F D086 3568 81FC E7E5 27AF 4A9A - ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCse6Rgfzn5SevSpoRArEsAKCho8z4L4A8YfQ4TiISO9bs5dGs6ACgxJB4 laP2NOg4EqlFUjgnscZzWB8= =w6xE -----END PGP SIGNATURE-----