From patchwork Wed Sep 1 07:57:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1/2] Fix LTO bootstrap documentation From: Andi Kleen X-Patchwork-Id: 63354 Message-Id: <20100901075725.GA27169@basil.fritz.box> To: Paolo Bonzini Cc: Andi Kleen , Diego Novillo , Andi Kleen , gcc-patches@gcc.gnu.org, hubicka@ucw.cz Date: Wed, 1 Sep 2010 09:57:25 +0200 On Tue, Aug 31, 2010 at 03:17:56PM +0200, Paolo Bonzini wrote: > On 08/31/2010 03:14 PM, Andi Kleen wrote: > > > >>No, config/bootstrap-lto.mk should be adjusted instead to use the > >>options that Andi specifies. The doc change should be limited to the > >>--enable-stage1-languages=c,lto part. > > > >The problem is that config/bootstrap-lto.mk doesn't work in the first place > >(and I don't know how to fix it). It never built for me. > >That is why I documented an alternative method. > > Have you tried s/-flto/flags-you-proposed-to-use-instead/ in that file? Hi Paolo, I reran the test with BUILD_CONFIG and I cannot reproduce the earlier failures I had (I had multiple earlier, always in the early built of stage2). I added -frandom-seed=1 and -fuse-linker-plugin. It might be related to -j* races. I had to drop down my -j to small values because I found that without using -fwhopr it is unusable slow because multiple lto1s will make any reasonable machine swap. Honza also had some issue with it maybe he can elaborate. With the old failures not reproducible I guess the documentation change is obsolete (unless I can reproduce this again) and it would be reasonable to simply change the build option to this: Comments? -Andi diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk index 14099a0..785d15f 100644 --- a/config/bootstrap-lto.mk +++ b/config/bootstrap-lto.mk @@ -1,8 +1,8 @@ # This option enables LTO for stage2 and stage3. It requires lto to # be enabled for stage1 with --enable-stage1-languages. -STAGE2_CFLAGS += -flto -STAGE3_CFLAGS += -flto +STAGE2_CFLAGS += -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1 +STAGE3_CFLAGS += -fwhopr=jobserver -fuse-linker-plugin -frandom-seed=1 # Ada fails to build with LTO, turn it off for now. BOOT_ADAFLAGS += -fno-lto