On Fri, 26 Sep 2003, Tom Lane wrote:

> Stephan Szabo <[EMAIL PROTECTED]> writes:
> > However, the immediate problem I have seems to come from the fact that
> > on Linux at least we're basically lying to configure about what's in the
> > system headers when we go to compile. port/linux.h on my system defined
> > _GNU_SOURCE which forces most/all of the extension things to be defined
> > even if they wouldn't by the command line options.
>
> Hm.  I have to plead guilty to putting that #define in there.  It was a
> quick-and-dirty workaround to make plperl compile.  Perhaps a better
> solution would be for template/linux to add the appropriate thing to
> CPPFLAGS, so that configure would see the same environment.  Can you
> try that and see if it fixes your issue?  (What exactly is your issue,
> anyway?)

Configure doesn't find struct addrinfo (because it's in a __USE_POSIX
block) so it looks like we use our own version, but, when we're actually
then compiling getaddrinfo.c, there's a redefinition error because this
time struct addrinfo is found (because _GNU_SOURCE forces __USE_POSIX).

It looks like commenting it out of linux.h and adding it to template/linux
works for the main build, it compiles and links fine both with and without
--std=c89 and the latter also passes regression.  I didn't try to build
plperl however.
Index: src/include/port/linux.h
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/include/port/linux.h,v
retrieving revision 1.34
diff -c -r1.34 linux.h
*** src/include/port/linux.h    14 Sep 2003 20:21:18 -0000      1.34
--- src/include/port/linux.h    26 Sep 2003 15:34:48 -0000
***************
*** 1,9 ****
- /* Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 otherwise */
- #ifndef _GNU_SOURCE
- #define _GNU_SOURCE 1
- #endif
- 
- 
  #if defined(__i386__) || defined(__x86_64__)
  typedef unsigned char slock_t;
  
--- 1,3 ----
Index: src/template/linux
===================================================================
RCS file: /projects/cvsroot/pgsql-server/src/template/linux,v
retrieving revision 1.14
diff -c -r1.14 linux
*** src/template/linux  13 Sep 2003 14:49:51 -0000      1.14
--- src/template/linux  26 Sep 2003 15:34:50 -0000
***************
*** 4,7 ****
  NEED_REENTRANT_FUNCS=yes      # verified glibc 2.1 2003-09-03
  THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
  THREAD_LIBS="-lpthread"
! 
--- 4,7 ----
  NEED_REENTRANT_FUNCS=yes      # verified glibc 2.1 2003-09-03
  THREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS"
  THREAD_LIBS="-lpthread"
! CPPFLAGS="-D_GNU_SOURCE" # Force _GNU_SOURCE on; plperl is broken with Perl 5.8.0 
otherwise 
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Reply via email to