This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Go patch committed: Implement new syscall package


Ian Lance Taylor <iant@google.com> writes:

> Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
>
>> Now IRIX finally bootstrap again, I had to make two adjustments to have
>> libgo build there.
>>
>> * go/syscall/wait.c doesn't compile:
>>
>> /vol/gcc/src/hg/trunk/local/libgo/go/syscall/wait.c:11:0: error: "__EXTENSIONS__" redefined [-Werror]
>> /vol/gcc/src/hg/trunk/local/libgo/go/syscall/wait.c:1:0: note: this is the location of the previous definition
>>
>>   I've wrapped the __EXTENSIONS__ definition in #ifndef/#endif, but
>>   think this is the wrong approach: definitions of _GNU_SOURCE,
>>   __EXTENSIONS__ and other platform-specific stuff should go into
>>   configure.ac or mksysinfo.sh, not individual sources.  There are more
>>   instances of this problem, but they don't hurt me on IRIX.
>
> Makes sense.  I have committed this patch to try to clean this up a bit.
> Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.

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.

	Rainer


2011-12-22  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgo:
	* configure.ac (OSCFLAGS): Add -std=gnu99 for *-*-solaris2.1[01].
	* configure: Regenerate.

# 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)

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]