Patchwork [2/3] Add bootstrap-lto-slim build config

login
register
mail settings
Submitter Andi Kleen
Date Oct. 11, 2010, 10:17 a.m.
Message ID <1286792263-9244-2-git-send-email-andi@firstfloor.org>
Download mbox | patch
Permalink /patch/67405/
State New
Headers show

Comments

Andi Kleen - Oct. 11, 2010, 10:17 a.m.
From: Andi Kleen <ak@linux.intel.com>

/

2010-10-03  Andi Kleen <ak@linux.intel.com>

	* config/bootstrap-lto-slim.mk: Add.

gcc/

2010-10-03  Andi Kleen <ak@linux.intel.com>

	* doc/install.texi (bootstrap-lto-slim): Document.
---
 config/bootstrap-lto-slim.mk |    8 ++++++++
 gcc/doc/install.texi         |    3 +++
 2 files changed, 11 insertions(+), 0 deletions(-)
 create mode 100644 config/bootstrap-lto-slim.mk
Gerald Pfeifer - Oct. 17, 2010, 4:41 p.m.
On Mon, 11 Oct 2010, Andi Kleen wrote:
> 2010-10-03  Andi Kleen <ak@linux.intel.com>
> 
> 	* doc/install.texi (bootstrap-lto-slim): Document.

> +@item @samp{bootstrap-lto-slim}
> +Analogous to @code{bootstrap-lto}.

Hmm, as a user/sysadmin I don't think I'd have any idea what this
does and what its benefits (and the rationale for me using it) are.
Care to expand a bit in the documentation?

Gerald
Andi Kleen - Oct. 17, 2010, 5:59 p.m.
On Sun, Oct 17, 2010 at 06:41:58PM +0200, Gerald Pfeifer wrote:
> On Mon, 11 Oct 2010, Andi Kleen wrote:
> > 2010-10-03  Andi Kleen <ak@linux.intel.com>
> > 
> > 	* doc/install.texi (bootstrap-lto-slim): Document.
> 
> > +@item @samp{bootstrap-lto-slim}
> > +Analogous to @code{bootstrap-lto}.
> 
> Hmm, as a user/sysadmin I don't think I'd have any idea what this
> does and what its benefits (and the rationale for me using it) are.
> Care to expand a bit in the documentation?

The idea was that users look up the -flto-slim option and I didn't
want to repeat the description of that here.

If you think the description of -flto-slim is not clear enough
I can try to improve that.

At some point I hope -flto-slim will be default in whopr mode anyways.

-Andi
Jan Hubicka - Oct. 17, 2010, 11:05 p.m.
> On Sun, Oct 17, 2010 at 06:41:58PM +0200, Gerald Pfeifer wrote:
> > On Mon, 11 Oct 2010, Andi Kleen wrote:
> > > 2010-10-03  Andi Kleen <ak@linux.intel.com>
> > > 
> > > 	* doc/install.texi (bootstrap-lto-slim): Document.
> > 
> > > +@item @samp{bootstrap-lto-slim}
> > > +Analogous to @code{bootstrap-lto}.
> > 
> > Hmm, as a user/sysadmin I don't think I'd have any idea what this
> > does and what its benefits (and the rationale for me using it) are.
> > Care to expand a bit in the documentation?
> 
> The idea was that users look up the -flto-slim option and I didn't
> want to repeat the description of that here.
> 
> If you think the description of -flto-slim is not clear enough
> I can try to improve that.
> 
> At some point I hope -flto-slim will be default in whopr mode anyways.

I hope so too. 

I think that in order to minimize confusion of random user, we should default to LTO
w/o fat objects. This is what most people expect from LTO.  Defaulting to fat object
will just make them disapointed about compilation speeds and possibly about leack
of benefits when they manage to link non-LTO.

On the other hand more advanced LTO setups that take advantage of fat objects can
easily enable this by an command line option (I guess libtool will want to do that
once we will be shipping LTO enabled static libraries).

I would perosnally wote for having -flto-fat-object or something like that instead of
-flto-slim. I expect that user who knows what it is will know it as fat objects.
Users who doesn't will just wonder what slim-lto is...

Honza
> 
> -Andi
Andi Kleen - Oct. 17, 2010, 11:19 p.m.
> -flto-slim. I expect that user who knows what it is will know it as fat objects.
> Users who doesn't will just wonder what slim-lto is...

I agree that's a good idea longer term, but short term there still
need to be some issues with slim worked out (like adding
all the necessary wrappers, fixing libtool in tree, add 
passthrough, more testing etc.) 

So right now I think it's better to keep it optional.

Short term it would help if people actually reviewed the patch :)

-Andi

Patch

diff --git a/config/bootstrap-lto-slim.mk b/config/bootstrap-lto-slim.mk
new file mode 100644
index 0000000..af08db4
--- /dev/null
+++ b/config/bootstrap-lto-slim.mk
@@ -0,0 +1,8 @@ 
+# This option enables LTO slim for stage2 and stage3.  It requires lto to
+# be enabled for stage1 with --enable-stage1-languages.
+
+STAGE2_CFLAGS += -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1 -flto-slim
+STAGE3_CFLAGS += -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1 -flto-slim
+
+# Ada fails to build with LTO, turn it off for now.
+BOOT_ADAFLAGS += -fno-lto
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index ce6b5cf..0ef8e60 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2197,6 +2197,9 @@  Enables Link-Time Optimization for host tools during bootstrapping.
 @samp{BUILD_CONFIG=bootstrap-lto} is equivalent to adding
 @option{-flto} to @samp{BOOT_CFLAGS}.
 
+@item @samp{bootstrap-lto-slim}
+Analogous to @code{bootstrap-lto}.
+
 @item @samp{bootstrap-debug}
 Verifies that the compiler generates the same executable code, whether
 or not it is asked to emit debug information.  To this end, this