From: Michael Tremer Date: Wed, 5 May 2021 22:38:38 +0000 (+0000) Subject: gcc: Enable LTO linker plugin by default X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Flto;p=people%2Fms%2Fipfire-2.x.git gcc: Enable LTO linker plugin by default Signed-off-by: Michael Tremer --- diff --git a/config/rootfiles/common/x86_64/gcc b/config/rootfiles/common/x86_64/gcc index f6262683e2..db60ad53ef 100644 --- a/config/rootfiles/common/x86_64/gcc +++ b/config/rootfiles/common/x86_64/gcc @@ -855,6 +855,7 @@ #usr/include/c++/11.1.0/x86_64-pc-linux-gnu/bits/time_members.h #usr/include/c++/11.1.0/x86_64-pc-linux-gnu/ext #usr/include/c++/11.1.0/x86_64-pc-linux-gnu/ext/opt_random.h +#usr/lib/bfd-plugins/liblto_plugin.so #usr/lib/gcc #usr/lib/gcc/x86_64-pc-linux-gnu #usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0 diff --git a/lfs/gcc b/lfs/gcc index d4c4695147..ffe9c1cb23 100644 --- a/lfs/gcc +++ b/lfs/gcc @@ -72,7 +72,7 @@ ifeq "$(ROOT)" "" --enable-threads=posix \ --enable-__cxa_atexit \ --enable-clocale=gnu \ - --enable-languages=c,c++ \ + --enable-languages=c,c++,lto \ --disable-bootstrap \ --disable-nls EXTRA_MAKE = @@ -105,7 +105,7 @@ ifeq "$(PASS)" "1" --without-headers \ --without-ppl \ --without-cloog \ - --enable-languages=c,c++ + --enable-languages=c,c++,lto EXTRA_MAKE = EXTRA_INSTALL = else @@ -121,7 +121,7 @@ ifeq "$(PASS)" "2" --prefix=$(TOOLS_DIR) \ --with-local-prefix=$(TOOLS_DIR) \ --with-native-system-header-dir=$(TOOLS_DIR)/include \ - --enable-languages=c,c++ \ + --enable-languages=c,c++,lto \ --disable-libstdcxx-pch \ --disable-libgomp EXTRA_MAKE = @@ -294,12 +294,22 @@ endif ifeq "$(TOOLCHAIN)" "1" ifeq "$(PASS)" "1" ln -svf libgcc.a $$($(TOOLS_DIR)/bin/$(CROSSTARGET)-gcc -print-libgcc-file-name | sed 's/libgcc/&_eh/') + + # Always enable LTO plugin + ln -svf --relative \ + $(TOOLS_DIR)/libexec/gcc/$(CROSSTARGET)/$(VER)/liblto_plugin.so \ + $(TOOLS_DIR)/lib/bfd-plugins endif ifeq "$(PASS)" "2" ln -svf gcc $(TOOLS_DIR)/bin/cc # remove gdb python files from libdir rm -rf $(TOOLS_DIR)/lib/*-gdb.py + + # Always enable LTO plugin + ln -svf --relative \ + $(TOOLS_DIR)/libexec/gcc/$(BUILDTARGET)/$(VER)/liblto_plugin.so \ + $(TOOLS_DIR)/lib/bfd-plugins endif ifeq "$(PASS)" "L" @@ -312,6 +322,9 @@ else # NON-TOOLCHAIN ln -svf gcc /usr/bin/cc # remove gdb python files from libdir rm -rf /usr/lib/*-gdb.py + + # Always enable LTO plugin + ln -svf $$(/usr/bin/gcc --print-file-name=liblto_plugin.so) /usr/lib/bfd-plugins endif @rm -rf $(DIR_APP) $(DIR_SRC)/gcc-build