[PATCH] LTO plugin for coff, part 1: break out ELF-specific code and enable COFF builds

Ralf Wildenhues Ralf.Wildenhues@gmx.de
Sat Oct 2 17:14:00 GMT 2010


* Dave Korn wrote on Sat, Oct 02, 2010 at 07:05:02PM CEST:
> On 02/10/2010 17:13, Jack Howarth wrote:
> > On Sat, Oct 02, 2010 at 06:00:36PM +0200, Ralf Wildenhues wrote:
> >> Please explain why the existing --enable-lto switch is not sufficient.
> 
>   I thought it was best not to include experimental features under it.

Here's how I see it:

The current configury has the notion of default-enabled LTO or explicit
passing of --enable-lto.  In the latter, just do as asked.
In the former, do it whenever the prerequisites are there; i.e., gold
present or both COFF and capable binutils present.

During development, you want all exposure you can get (of course without
exposing known total breakage).  You can still back up to more
conservative choice if default-enabled before the release; but going to
a more dangerous semantics in later stages is bound to be frowned upon
more (and rightly so).  Ideally, you wouldn't even have to touch the
configury any more later on.

> ... AFAIK we don't have any easy way of saying "If ENABLE_GOLD *or* target
> format is COFF" available in the top-level configure file,

Why?  COFF in this case means target matches one of a few strings right?

> and I didn't want
> to just remove the ENABLE_GOLD test and unconditionally build the plugin
> whenever LTO is enabled, because that could affect any number of other
> platforms I don't know about.

> >     A good first step would be for the COFF targets to enable lto by default 
> > for their existing lto infrastructure (as darwin has for Mach-O lto support).
> > This would greatly simplify lto for COFF end-users.
> 
>   I'm not sure lto is ready for COFF end-users until we've got the linker
> plugin working.  Won't switching it on prematurely just give us a massive
> support headache having to explain to our users that yes, it's not supposed to
> do anything much yet?

As I wrote above: as long as it doesn't break bootstrap, I don't see a
problem.  But hey, I'm not reviewer, take my words with grains of salt.

Cheers,
Ralf



More information about the Gcc-patches mailing list