Patchwork [1/2] documentation fixes #1

login
register
mail settings
Submitter Andi Kleen
Date Aug. 17, 2010, 7 a.m.
Message ID <1282028446-19874-1-git-send-email-andi@firstfloor.org>
Download mbox | patch
Permalink /patch/61862/
State New
Headers show

Comments

Andi Kleen - Aug. 17, 2010, 7 a.m.
From: Andi Kleen <ak@linux.intel.com>

BUILD_CONFIG=bootstrap-lto does not work currently and causes build
failures.  Remove a reference to that in the install documentation and instead
document a working method using BOOT_CFLAGS.

Bootstrapped on x86-64 together with the -fwhopr=jobserver patchkit

Ok to commit?

2010-08-17  Andi Kleen	<ak@linux.intel.com>

	* doc/install.texi (Building a native compiler): Remove
	reference to broken BUILD_CONFIG=bootstrap-lto.
	Document working method instead.
---
 gcc/doc/install.texi |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
Gerald Pfeifer - Aug. 29, 2010, 11:51 p.m.
On Tue, 17 Aug 2010, Andi Kleen wrote:
> 2010-08-17  Andi Kleen	<ak@linux.intel.com>
> 
> 	* doc/install.texi (Building a native compiler): Remove
> 	reference to broken BUILD_CONFIG=bootstrap-lto.
> 	Document working method instead.
> ---
>  gcc/doc/install.texi |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
> index fc9b988..c952edf 100644
> --- a/gcc/doc/install.texi
> +++ b/gcc/doc/install.texi
> @@ -2108,6 +2108,13 @@ to work around this, by choosing @code{BOOT_CFLAGS} to avoid the parts
>  of the stage1 compiler that were miscompiled, or by using @samp{make
>  bootstrap4} to increase the number of stages of bootstrap.
>  
> +You can also use @code{BOOT_CFLAGS} to force a LTO bootstrap with
> +@samp{BOOTCFLAGS='-O2 -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1'}. 

BOOT_CFLAGS or BOOTCFLAGS?

And "an LTO".

> +Configure the compiler with @samp{--enable-stage1-languages=c,lto}. This 
> +will only work with the @command{gold} linker and if linker plugins are
> +corrected configured.  The @option{-frandom-seed=1} is needed to avoid 
> +bootstrap comparison failures.

This sounds a bit tricky for our general user installation instructions;
any chance to have all this triggered by a configure option or a simple
"make bootstrap-lto" or just document it in pure developer documentation?  
(More a question to Diego et al, I guess.)  Oh wait, that's what's there,
but broken, right? :-(

Gerald
Richard Guenther - Aug. 30, 2010, 6:59 a.m.
On Mon, Aug 30, 2010 at 1:51 AM, Gerald Pfeifer <gerald@pfeifer.com> wrote:
> On Tue, 17 Aug 2010, Andi Kleen wrote:
>> 2010-08-17  Andi Kleen        <ak@linux.intel.com>
>>
>>       * doc/install.texi (Building a native compiler): Remove
>>       reference to broken BUILD_CONFIG=bootstrap-lto.
>>       Document working method instead.
>> ---
>>  gcc/doc/install.texi |   12 +++++++-----
>>  1 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
>> index fc9b988..c952edf 100644
>> --- a/gcc/doc/install.texi
>> +++ b/gcc/doc/install.texi
>> @@ -2108,6 +2108,13 @@ to work around this, by choosing @code{BOOT_CFLAGS} to avoid the parts
>>  of the stage1 compiler that were miscompiled, or by using @samp{make
>>  bootstrap4} to increase the number of stages of bootstrap.
>>
>> +You can also use @code{BOOT_CFLAGS} to force a LTO bootstrap with
>> +@samp{BOOTCFLAGS='-O2 -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1'}.
>
> BOOT_CFLAGS or BOOTCFLAGS?
>
> And "an LTO".
>
>> +Configure the compiler with @samp{--enable-stage1-languages=c,lto}. This
>> +will only work with the @command{gold} linker and if linker plugins are
>> +corrected configured.  The @option{-frandom-seed=1} is needed to avoid
>> +bootstrap comparison failures.
>
> This sounds a bit tricky for our general user installation instructions;
> any chance to have all this triggered by a configure option or a simple
> "make bootstrap-lto" or just document it in pure developer documentation?
> (More a question to Diego et al, I guess.)  Oh wait, that's what's there,
> but broken, right? :-(

The -frandom-seed requirement is indeed very unfortunate.  Andi - can't we
use sth based on a hash instead that would be stable across bootstrap?

Otherwise I'd like us to get rid of --enable-intermodule and its makefile
bits and simply fix --with-build-config=bootstrap-lto.

Richard.

>
> Gerald
>
Andi Kleen - Aug. 30, 2010, 8:24 a.m.
On 8/30/2010 8:59 AM, Richard Guenther wrote:
>
>> BOOT_CFLAGS or BOOTCFLAGS?
>>
>> And "an LTO".

I'll fix the grammar. There was also another mistake noone noticed 
except me on re-reading :)

>>> +Configure the compiler with @samp{--enable-stage1-languages=c,lto}. This
>>> +will only work with the @command{gold} linker and if linker plugins are
>>> +corrected configured.  The @option{-frandom-seed=1} is needed to avoid
>>> +bootstrap comparison failures.
>> This sounds a bit tricky for our general user installation instructions;
>> any chance to have all this triggered by a configure option or a simple
>> "make bootstrap-lto" or just document it in pure developer documentation?
>> (More a question to Diego et al, I guess.)  Oh wait, that's what's there,
>> but broken, right? :-(
> The -frandom-seed requirement is indeed very unfortunate.  Andi - can't we
> use sth based on a hash instead that would be stable across bootstrap?

In theory could use a hash over the global symbol names, but I'm a bit 
wary of collisions.
For example if you have a set of machine generated files with very 
similar symbols names
there might be problems. Also the random seed issue is only really a 
problem for bootstraps,
but not  for other uses of the compiler.

> Otherwise I'd like us to get rid of --enable-intermodule and its makefile
> bits and simply fix --with-build-config=bootstrap-lto.

I'm not very good with Makefiles so I would prefer if someone else does 
that.

-Andi

Patch

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index fc9b988..c952edf 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2108,6 +2108,13 @@  to work around this, by choosing @code{BOOT_CFLAGS} to avoid the parts
 of the stage1 compiler that were miscompiled, or by using @samp{make
 bootstrap4} to increase the number of stages of bootstrap.
 
+You can also use @code{BOOT_CFLAGS} to force a LTO bootstrap with
+@samp{BOOTCFLAGS='-O2 -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1'}. 
+Configure the compiler with @samp{--enable-stage1-languages=c,lto}. This 
+will only work with the @command{gold} linker and if linker plugins are
+corrected configured.  The @option{-frandom-seed=1} is needed to avoid 
+bootstrap comparison failures.
+
 @code{BOOT_CFLAGS} does not apply to bootstrapped target libraries.
 Since these are always compiled with the compiler currently being
 bootstrapped, you can use @code{CFLAGS_FOR_TARGET} to modify their
@@ -2155,11 +2162,6 @@  Removes any @option{-O}-started option from @code{BOOT_CFLAGS}, and adds
 @item @samp{bootstrap-O3}
 Analogous to @code{bootstrap-O1}.
 
-@item @samp{bootstrap-lto}
-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-debug}
 Verifies that the compiler generates the same executable code, whether
 or not it is asked to emit debug information.  To this end, this