From patchwork Tue Nov 16 01:16:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 71323 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 49352B710A for ; Tue, 16 Nov 2010 12:16:51 +1100 (EST) Received: (qmail 9049 invoked by alias); 16 Nov 2010 01:16:46 -0000 Received: (qmail 9038 invoked by uid 22791); 16 Nov 2010 01:16:45 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_CX, TW_DC, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 16 Nov 2010 01:16:09 +0000 Received: from kpbe13.cbf.corp.google.com (kpbe13.cbf.corp.google.com [172.25.105.77]) by smtp-out.google.com with ESMTP id oAG1G6Tt011370 for ; Mon, 15 Nov 2010 17:16:06 -0800 Received: from pwj5 (pwj5.prod.google.com [10.241.219.69]) by kpbe13.cbf.corp.google.com with ESMTP id oAG1Fdgs001226 for ; Mon, 15 Nov 2010 17:16:05 -0800 Received: by pwj5 with SMTP id 5so26146pwj.29 for ; Mon, 15 Nov 2010 17:16:04 -0800 (PST) Received: by 10.142.157.7 with SMTP id f7mr4812807wfe.335.1289870164732; Mon, 15 Nov 2010 17:16:04 -0800 (PST) Received: from coign.google.com ([216.239.45.130]) by mx.google.com with ESMTPS id q13sm666174wfc.17.2010.11.15.17.16.02 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 15 Nov 2010 17:16:03 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: PATCH RFA: Set poststage1_ldflags for all builds Date: Mon, 15 Nov 2010 17:16:00 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-System-Of-Record: true 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 Since nobody seemed to like the idea of testing whether the C++ compiler supports the -static-libstdc++ option, how do people feel about this approach. This changes the default for --with-poststage1-ldflags to be "-static-libstdc++ -static-libgcc". Currently that is the default when --enable-build-with-cxx is used. This patch changes that to be the default in all cases. The -static-libstdc++ option has no effect when not building with the g++ driver. The -static-libgcc option will, of course, have an effect, for some hosts (though not x86 hosts). I would argue that that effect will be beneficial. The problem I'm trying to avoid is somebody doing a typical build of gcc. On a host where gcc needs something from libgcc_s.so, this will cause the installed gcc to depend on the $(prefix)/lib/libgcc_s.so. That is fine if that directory is in the default library search path, potentially troublesome otherwise. It's rarely a problem for libgcc_s.so, because the ABI is stable and gcc does not use any of the newer versions. It's frequently a problem for libstdc++.so, in which a program linked against one version of libstdc++.so generally will not run with an older version. That's why this is the default for --enable-build-with-cxx. The reason I would like to make this the default in all cases is of course for the Go frontend. I'm testing a bootstrap both with and without --enable-build-with-cxx. Is this patch OK for mainline if both bootstraps succeed? Thanks. Ian 2010-11-15 Ian Lance Taylor * configure.ac: Don't test $ENABLE_BUILD_WITH_CXX when setting default value for --with-boot-ldflags. * configure: Rebuild. 2010-11-15 Ian Lance Taylor * doc/install.texi (Configuration): Update default for --with-boot-ldflags. Index: configure.ac =================================================================== --- configure.ac (revision 166769) +++ configure.ac (working copy) @@ -1524,10 +1524,10 @@ AC_ARG_WITH(boot-ldflags, poststage1_ldflags=$withval fi], [poststage1_ldflags= - # With --enable-build-with-cxx, default to linking libstdc++ and - # libgcc statically. But if the user explicitly specified the - # libraries to use, trust that they are doing what they want. - if test "$ENABLE_BUILD_WITH_CXX" = "yes" -a "$poststage1_libs" = ""; then + # In stages 2 and 3, default to linking libstdc++ and libgcc + # statically. But if the user explicitly specified the libraries to + # use, trust that they are doing what they want. + if test "$poststage1_libs" = ""; then poststage1_ldflags="-static-libstdc++ -static-libgcc" fi]) AC_SUBST(poststage1_ldflags) Index: gcc/doc/install.texi =================================================================== --- gcc/doc/install.texi (revision 166769) +++ gcc/doc/install.texi (working copy) @@ -1611,8 +1611,9 @@ of GCC. These are also used when linkin @item --with-boot-ldflags=@var{flags} This option may be used to set linker flags to be used when linking -stage 2 and later when bootstrapping GCC. By default no special flags -are used. +stage 2 and later when bootstrapping GCC. If neither --with-boot-libs +nor --with-host-libstdcxx is set to a value, then the default is +@samp{-static-libstdc++ -static-libgcc}. @item --with-boot-libs=@var{libs} This option may be used to set libraries to be used when linking stage 2