This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use the LTO linker plugin by default
- From: Markus Trippelsdorf <markus at trippelsdorf dot de>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Jan Hubicka <hubicka at ucw dot cz>, Jakub Jelinek <jakub at redhat dot com>
- Date: Tue, 4 Mar 2014 13:30:55 +0100
- Subject: Re: [PATCH] Use the LTO linker plugin by default
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1403041241510 dot 11121 at zhemvz dot fhfr dot qr>
On 2014.03.04 at 13:00 +0100, Richard Biener wrote:
>
> The following patch addresses the common (?) issue of people
> omitting -flto from the linker command-line which gets more
> severe with GCC 4.9 where slim LTO objects are emitted by
> default. The patch simply _always_ arranges for the linker
> plugin to be used, so if there are any (slim) LTO objects
> on the link LTO will be done on them. Similarly the
> non-linker-plugin path in collect2 is adjusted.
>
> You can still disable this by specifying -fno-lto on the
> linker command-line.
>
> One side-effect of enabling the linker-plugin by default
> (for HAVE_LTO_PLUGIN == 2) is that collect2 will then
> use the configured plugin ld rather than the default ld.
> Not sure if that is desired.
>
> Comments?
I've been using a similar patch (without the collect2.c hunks) locally
for the past few month without any problems.
What is missing is a big fat warning in
http://gcc.gnu.org/gcc-4.9/changes.html that one should use the gcc
binutils wrappers (gcc-ar, etc.) when building projects with LTO.
--
Markus