This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [lto] Add --enable-lto and --with-libelf
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Paolo Bonzini <bonzini at gnu dot org>
- Date: Wed, 20 May 2009 21:56:34 +0200
- Subject: Re: [lto] Add --enable-lto and --with-libelf
- References: <20090520194809.GA7271@google.com>
On Wed, May 20, 2009 at 9:48 PM, Diego Novillo <dnovillo@google.com> wrote:
>
> This patch fixes a long standing wart in the branch. ?LTO is not
> really a language from the user's perspective, so having to use
> --enable-languages to enable it is odd.
>
> Additionally, the dependency on libelf has always required using
> libelf.h in system headers or hacking CPPFLAGS/BOOT_LDFLAGS to
> get it from other places.
>
> With this patch, the compiler can now enable LTO functionality
> automatically (if it detects a working libelf), or it can be
> requested with --enable-lto.
>
> If --enable-lto is used and no there isn't a working libelf.h,
> configure emits an error. ?If --with-libelf is used and/or a
> working libelf.h is found in the system paths, then LTO is
> enabled automatically.
>
> Finally, if LTO has been disabled, using -flto/-fwhopr produces
> an error at runtime. ?The testsuite uses this to determine
> whether to run the LTO tests.
>
> Bootstrapped and tested on hosts with a system libelf.h and hosts
> with a libelf.h in a different directory.
>
> Paolo, could you review the changes so I can make fixes in the
> branch before they are merged to mainline?
What about the target dependency on being a ELF target? Or isn't
that present anymore?
Richard.