From patchwork Thu Dec 22 16:31:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 132870 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 72186B7170 for ; Fri, 23 Dec 2011 03:32:32 +1100 (EST) Received: (qmail 32412 invoked by alias); 22 Dec 2011 16:32:22 -0000 Received: (qmail 32391 invoked by uid 22791); 22 Dec 2011 16:32:20 -0000 X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Dec 2011 16:32:03 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 75E682F7; Thu, 22 Dec 2011 17:32:01 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZpYcx2q1ubn4; Thu, 22 Dec 2011 17:31:58 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id D43C82F5; Thu, 22 Dec 2011 17:31:58 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.5+Sun/8.14.5/Submit) id pBMGVwIw004191; Thu, 22 Dec 2011 17:31:58 +0100 (MET) From: Rainer Orth To: Ian Lance Taylor Cc: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: Re: Go patch committed: Implement new syscall package References: Date: Thu, 22 Dec 2011 17:31:58 +0100 In-Reply-To: (Ian Lance Taylor's message of "Tue, 20 Dec 2011 10:14:33 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Ian Lance Taylor writes: > Rainer Orth 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 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 (_XPG4_2). _XOPEN_SOURCE=500 as + # etc. fields in (_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)