public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ian Lance Taylor <iant@google.com>
To: "Joseph S. Myers" <joseph@codesourcery.com>
Cc: Diego Novillo <dnovillo@google.com>,
	gcc@gcc.gnu.org, java@gcc.gnu.org,
	        Fortran List <fortran@gcc.gnu.org>
Subject: Re: [LTO merge][0/15] Description of the final 15 patches
Date: Tue, 29 Sep 2009 14:48:00 -0000	[thread overview]
Message-ID: <mcrmy4ddcyw.fsf@dhcp-172-17-9-151.mtv.corp.google.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0909290131160.1054@digraph.polyomino.org.uk> (Joseph S. Myers's message of "Tue\, 29 Sep 2009 01\:36\:35 +0000 \(UTC\)")

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

"Joseph S. Myers" <joseph@codesourcery.com> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: shared libiberty --]
[-- Type: text/x-diff, Size: 1144 bytes --]

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';

  reply	other threads:[~2009-09-29 14:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-29  0:58 Diego Novillo
2009-09-29  2:03 ` Joseph S. Myers
2009-09-29 14:48   ` Ian Lance Taylor [this message]
2009-09-29 14:56     ` Diego Novillo
2009-09-29 16:45     ` Paolo Bonzini
2009-09-29 16:53       ` Ian Lance Taylor
2009-09-29 16:56         ` Paolo Bonzini
2009-09-29 18:54           ` Ian Lance Taylor
2009-09-29  2:07 ` Joseph S. Myers
2009-09-29 13:06   ` Diego Novillo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=mcrmy4ddcyw.fsf@dhcp-172-17-9-151.mtv.corp.google.com \
    --to=iant@google.com \
    --cc=dnovillo@google.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=java@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).