From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2932 invoked by alias); 29 Sep 2009 14:48:09 -0000 Received: (qmail 2894 invoked by uid 22791); 29 Sep 2009 14:48:07 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 29 Sep 2009 14:48:03 +0000 Received: from wpaz5.hot.corp.google.com (wpaz5.hot.corp.google.com [172.24.198.69]) by smtp-out.google.com with ESMTP id n8TEm0bo008905; Tue, 29 Sep 2009 07:48:01 -0700 Received: from pxi40 (pxi40.prod.google.com [10.243.27.40]) by wpaz5.hot.corp.google.com with ESMTP id n8TEl00r015618; Tue, 29 Sep 2009 07:47:57 -0700 Received: by pxi40 with SMTP id 40so6294591pxi.24 for ; Tue, 29 Sep 2009 07:47:57 -0700 (PDT) Received: by 10.114.215.27 with SMTP id n27mr8229862wag.76.1254235677389; Tue, 29 Sep 2009 07:47:57 -0700 (PDT) Received: from coign.google.com ([67.218.105.93]) by mx.google.com with ESMTPS id 20sm1633605pxi.8.2009.09.29.07.47.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Sep 2009 07:47:56 -0700 (PDT) To: "Joseph S. Myers" Cc: Diego Novillo , gcc@gcc.gnu.org, java@gcc.gnu.org, Fortran List Subject: Re: [LTO merge][0/15] Description of the final 15 patches References: From: Ian Lance Taylor Date: Tue, 29 Sep 2009 14:48:00 -0000 In-Reply-To: (Joseph S. Myers's message of "Tue\, 29 Sep 2009 01\:36\:35 +0000 \(UTC\)") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-System-Of-Record: true Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00043.txt.bz2 --=-=-= Content-length: 1459 "Joseph S. Myers" writes: > On Mon, 28 Sep 2009, Diego Novillo wrote: > >> - libiberty >> I need help with this one. When the linker plugin is >> enabled (if GCC is configured to use gold), LTO can >> detect LTO objects inside archives via the callbacks it >> gets from the linker. Since the linker plugin is a >> shared object, and it uses libiberty functions, it needs >> to use a shared libiberty. >> >> Currently, we just force --enable-shared on libiberty, >> but I would only want to do that if gold and lto are >> enabled. We detect gold and lto support in the top >> configure script, but how do I send that down to >> libiberty's configure? > > Shared libiberty seems like a bad idea as you then need to deal with > soname allocation and changing the soname whenever an ABI-incompatible > change is made. What you actually need is a PIC libiberty to link into > the plugin (and avoiding using any global data in libiberty that needs a > single copy in any program; hopefully it doesn't have any), not a shared > one. Yes. Fortunately there is no such thing as a shared libiberty. If you configure libiberty with --enable-shared, what you get is a PIC libiberty (libiberty/pic/libiberty.a) alongside the non-PIC one (libiberty/libiberty.a). So all Diego needs to do is pass --enable-shared down to libiberty when --enable-lto/--enable-gold. The way to do that is something like the appended. Ian --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=foo.patch Content-Description: shared libiberty Content-length: 1144 Index: configure.ac =================================================================== --- configure.ac (revision 152253) +++ configure.ac (working copy) @@ -2495,6 +2495,11 @@ case $enable_bootstrap in ;; esac +extra_host_libiberty_configure_flags= +if test "$enable_gold" = "yes" -a "$enable_lto" = "yes"; then + extra_host_libiberty_configure_flags=--enable-shared +fi + AC_MSG_CHECKING(for default BUILD_CONFIG) AC_ARG_WITH([build-config], Index: Makefile.def =================================================================== --- Makefile.def (revision 152253) +++ Makefile.def (working copy) @@ -97,7 +97,8 @@ host_modules= { module= ld; bootstrap=tr host_modules= { module= libcpp; bootstrap=true; }; host_modules= { module= libdecnumber; bootstrap=true; }; host_modules= { module= libgui; }; -host_modules= { module= libiberty; bootstrap=true; }; +host_modules= { module= libiberty; bootstrap=true; + extra_configure_flags='@extra_host_libiberty_configure_flags@'}; // We abuse missing to avoid installing anything for libiconv. host_modules= { module= libiconv; extra_configure_flags='--disable-shared'; --=-=-=--