From 7608095b4e0138eda9d74edd903c327e581758a5 Mon Sep 17 00:00:00 2001 From: Matthias Reichl Date: Tue, 29 May 2018 21:50:46 +0200 Subject: [PATCH] config/functions: don't enable LTO by default Packages are only built with LTO if it's explicitly enabled via the lto build flag or if a package enables LTO via configure / cmake options. Enabling LTO via configure / cmake is the preferred way as this gives packages more fine grained control, eg enable parallel LTO linking etc. When doing this packages should respect the LTO_SUPPORT setting so LTO can be disabled globally. To avoid conflicting C/CXX/LDFLAGS no FLAGS are added when the lto build flag is not set. Signed-off-by: Matthias Reichl --- config/functions | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/config/functions b/config/functions index 094cc514af..c20d577ab0 100644 --- a/config/functions +++ b/config/functions @@ -1,13 +1,8 @@ setup_toolchain() { - # lto flag - if flag_enabled "lto" "$LTO_SUPPORT" "only-disable"; then + if [ "$LTO_SUPPORT" = "yes" ] && flag_enabled "lto" "no"; then TARGET_CFLAGS+=" $CFLAGS_OPTIM_LTO" TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_LTO" TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_LTO" - else - TARGET_CFLAGS+=" $CFLAGS_OPTIM_NOLTO" - TARGET_CXXFLAGS+=" $CXXFLAGS_OPTIM_NOLTO" - TARGET_LDFLAGS+=" $LDFLAGS_OPTIM_NOLTO" fi # gold flag