]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Support slim LTO bootstrap
authorAndi Kleen <ak@linux.intel.com>
Mon, 1 Sep 2014 16:41:28 +0000 (16:41 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Mon, 1 Sep 2014 16:41:28 +0000 (16:41 +0000)
Change the bootstrap-lto config file to use slim (non fat) LTO..
Speeds up the LTO bootstrap by ~18% on a 4 core system.

This requires using gcc-ar/ranlib in post stage 1 builds, so these
are passed to all sub builds.

config/:

2014-09-01  Andi Kleen  <ak@linux.intel.com>

* bootstrap-lto.mk: Implement slim bootstrap.

/:
2014-09-01  Andi Kleen  <ak@linux.intel.com>

* Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Add LTO_EXPORTS.
POSTSTAGE1_FLAGS_TO_PASS):  Add LTO_FLAGS_TO_PASS.
* Makefile.in: Regenerate.

From-SVN: r214801

ChangeLog
Makefile.in
Makefile.tpl
config/ChangeLog
config/bootstrap-lto.mk

index 35c9dc6c4436e5053b79f7eaf3b8bc4dd22b422b..a0f8c221a51d0de4cc0757564ef1c041755062f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-09-01  Andi Kleen  <ak@linux.intel.com>
+
+       * Makefile.tpl (POSTSTAGE1_HOST_EXPORTS): Add LTO_EXPORTS.
+       POSTSTAGE1_FLAGS_TO_PASS):  Add LTO_FLAGS_TO_PASS.
+       * Makefile.in: Regenerate.
+
 2014-08-28  David Malcolm  <dmalcolm@redhat.com>
 
        * rtx-classes-status.txt: Delete
index add8cf6b379f2add77ba9aae2b7720ac98f8b952..d6105b34924f2b7d5fe0cdd005020d1c36339ba2 100644 (file)
@@ -257,6 +257,7 @@ POSTSTAGE1_HOST_EXPORTS = \
          $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
        CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
        $(POSTSTAGE1_CXX_EXPORT) \
+       $(LTO_EXPORTS) \
        GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
        LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
        HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
@@ -828,6 +829,7 @@ POSTSTAGE1_FLAGS_TO_PASS = \
        GNATBIND="$${GNATBIND}" \
        LDFLAGS="$${LDFLAGS}" \
        HOST_LIBS="$${HOST_LIBS}" \
+       $(LTO_FLAGS_TO_PASS) \
        "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
 
 # Flags to pass down to makes which are built with the target environment.
index 00dba363a9ddfe8b5794318f87c4d51fe396f071..f7c7e38cddeb67b1563a9025c1dad7a57a95b4f5 100644 (file)
@@ -260,6 +260,7 @@ POSTSTAGE1_HOST_EXPORTS = \
          $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
        CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
        $(POSTSTAGE1_CXX_EXPORT) \
+       $(LTO_EXPORTS) \
        GNATBIND="$$r/$(HOST_SUBDIR)/prev-gcc/gnatbind"; export GNATBIND; \
        LDFLAGS="$(POSTSTAGE1_LDFLAGS) $(BOOT_LDFLAGS)"; export LDFLAGS; \
        HOST_LIBS="$(POSTSTAGE1_LIBS)"; export HOST_LIBS;
@@ -633,6 +634,7 @@ POSTSTAGE1_FLAGS_TO_PASS = \
        GNATBIND="$${GNATBIND}" \
        LDFLAGS="$${LDFLAGS}" \
        HOST_LIBS="$${HOST_LIBS}" \
+       $(LTO_FLAGS_TO_PASS) \
        "`echo 'ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
 
 # Flags to pass down to makes which are built with the target environment.
index 82c73bd5cde85e49618329b2350e7883146e5371..a1653c6328a03986bbcc91ea4084e99b6b9d230f 100644 (file)
@@ -1,3 +1,7 @@
+2014-09-01  Andi Kleen  <ak@linux.intel.com>
+
+       * bootstrap-lto.mk: Implement slim bootstrap.
+
 2014-08-21  Bin Cheng  <bin.cheng@arm.com>
 
        * isl.m4 (ISL_CHECK_VERSION): Check link of isl library
index 27bad1529bee612d466d4a9add71da79c92c4d35..9e065e1d85a09325c4332ad64202295b9f3e2fc0 100644 (file)
@@ -1,7 +1,13 @@
-# This option enables LTO for stage2 and stage3.
-# FIXME: Our build system is not yet able to use gcc-ar wrapper, so we need
-# to go with -ffat-lto-objects. 
+# This option enables LTO for stage2 and stage3 in slim mode
 
-STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
-STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
+STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
 STAGEprofile_CFLAGS += -fno-lto
+
+# assumes the host supports the linker plugin
+LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+LTO_RANLIB = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ranlib$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
+
+LTO_EXPORTS = AR="$(LTO_AR)"; export AR; \
+             RANLIB="$(LTO_RANLIB)"; export RANLIB;
+LTO_FLAGS_TO_PASS = AR="$(LTO_AR)" RANLIB="$(LTO_RANLIB)"