diff mbox series

[5/5] package/gcc: remove BR2_GCC_ENABLE_LTO

Message ID 20220725152229.3370033-5-arnout@mind.be
State Accepted
Headers show
Series [1/5] Config.in: add new option BR2_ENABLE_LTO to globally enable LTO | expand

Commit Message

Arnout Vandecappelle July 25, 2022, 3:22 p.m. UTC
Currently, this option doesn't do anything. It only adds
--enable-plugins --enable-lto to the configure flags, but doesn't
disable them if it is not set. Since both of these default to enabled,
plugins and lto are effectively always enabled.

There really is no need to make this configurable: it adds a bit of size
and build time to host-gcc, but we don't care about that for host tools.
It's still up to individual builds to enable the LTO options.

Therefore, remove the option entirely. For clarity, explicitly pass
--enable-plugins --enable-lto to configure.

No legacy handling is added for the removed option. Since the behaviour
hasn't actually changed (independently of whether the option was enabled
or not), there's no point bothering the user with a legacy option.

elf2flt was linking with libdl depending on this option. Since the
option doesn't do anything, this is probably not needed. Still, to avoid
breaking things, and because linking with libdl doesn't cost us anything
anyway, always link with libdl.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
 package/elf2flt/elf2flt.mk | 6 +-----
 package/gcc/Config.in.host | 6 ------
 package/gcc/gcc.mk         | 6 ++----
 3 files changed, 3 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/package/elf2flt/elf2flt.mk b/package/elf2flt/elf2flt.mk
index 9230e3ce1a..6cd0786c3d 100644
--- a/package/elf2flt/elf2flt.mk
+++ b/package/elf2flt/elf2flt.mk
@@ -24,11 +24,7 @@  HOST_ELF2FLT_CONF_OPTS = \
 	--target=$(GNU_TARGET_NAME) \
 	--disable-werror
 
-HOST_ELF2FLT_LIBS = -lz
-
-ifeq ($(BR2_GCC_ENABLE_LTO),y)
-HOST_ELF2FLT_LIBS += -ldl
-endif
+HOST_ELF2FLT_LIBS = -lz -ldl
 
 HOST_ELF2FLT_CONF_ENV = LIBS="$(HOST_ELF2FLT_LIBS)"
 
diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host
index 20187db6fd..9833ae1336 100644
--- a/package/gcc/Config.in.host
+++ b/package/gcc/Config.in.host
@@ -130,12 +130,6 @@  config BR2_TOOLCHAIN_BUILDROOT_DLANG
 	  D language and you want D libraries to be installed on your
 	  target system.
 
-config BR2_GCC_ENABLE_LTO
-	bool "Enable compiler link-time-optimization support"
-	help
-	  This option enables link-time optimization (LTO) support in
-	  gcc.
-
 config BR2_GCC_ENABLE_OPENMP
 	bool "Enable compiler OpenMP support"
 	depends on !BR2_PTHREADS_NONE && !BR2_arc && !BR2_microblaze
diff --git a/package/gcc/gcc.mk b/package/gcc/gcc.mk
index 114e774503..ec6f3b550a 100644
--- a/package/gcc/gcc.mk
+++ b/package/gcc/gcc.mk
@@ -75,6 +75,8 @@  HOST_GCC_COMMON_CONF_OPTS = \
 	--disable-libssp \
 	--disable-multilib \
 	--disable-decimal-float \
+	--enable-plugins \
+	--enable-lto \
 	--with-gmp=$(HOST_DIR) \
 	--with-mpc=$(HOST_DIR) \
 	--with-mpfr=$(HOST_DIR) \
@@ -165,10 +167,6 @@  else
 HOST_GCC_COMMON_CONF_OPTS += --enable-tls
 endif
 
-ifeq ($(BR2_GCC_ENABLE_LTO),y)
-HOST_GCC_COMMON_CONF_OPTS += --enable-plugins --enable-lto
-endif
-
 ifeq ($(BR2_PTHREADS_NONE),y)
 HOST_GCC_COMMON_CONF_OPTS += \
 	--disable-threads \