Message ID | yddvcp8h8jl.fsf@manam.CeBiTec.Uni-Bielefeld.DE |
---|---|
State | New |
Headers | show |
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes: > Thanks. Unfortunately, this broke bootstrap on Solaris 10 and 11: > > /var/gcc/regression/trunk/11-gcc/build/./gcc/include-fixed/sys/feature_tests.h:367:2: error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99" > make[4]: *** [go-main.o] Error 1 > > Compiling with _XOPEN_SOURCE=600 only works with -std=gnu99 (c99 alone > breaks due to the uses of asm). Initially, I meant to apply this > globally to match what mksysinfo.sh does, but unfortunately that broke > x86_64-unknown-linux-gnu bootstrap: libgo.so fails to link: > > .libs/go-byte-array-to-string.o: In function `__pthread_cleanup_routine': > /usr/include/pthread.h:580: multiple definition of `__pthread_cleanup_routine' > .libs/go-append.o:/usr/include/pthread.h:580: first defined here > .libs/go-defer.o: In function `__pthread_cleanup_routine': > /usr/include/pthread.h:580: multiple definition of `__pthread_cleanup_routine' > .libs/go-append.o:/usr/include/pthread.h:580: first defined here > > and many more. I've therefore settled for the follwing patch, which > allowed i386-pc-solaris2.11 bootstrap to complete. Thanks. Patch committed. Ian
# HG changeset patch # Parent b90f1ceca568f0c01951cbefd59496ef565a9096 Compile libgo as C99 diff --git a/libgo/configure.ac b/libgo/configure.ac --- a/libgo/configure.ac +++ b/libgo/configure.ac @@ -292,9 +292,9 @@ case "$target" in ;; *-*-solaris2.1[[01]]) # Solaris 10+ needs this so struct msghdr gets the msg_control - # etc. fields in <sys/socket.h> (_XPG4_2). _XOPEN_SOURCE=500 as + # etc. fields in <sys/socket.h> (_XPG4_2). _XOPEN_SOURCE=600 as # above doesn't work with C99. - OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=600 -D__EXTENSIONS__" + OSCFLAGS="$OSCFLAGS -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__" ;; esac AC_SUBST(OSCFLAGS)