aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2023-01-28 15:24:37 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2023-03-21 18:28:24 +0100
commit9ea7019ffd60ab3ef5a5654116fbc339f856482c (patch)
tree637b7f409612aa228caa7faa6f2003af3d5ff8c7 /include
parent1342afcd27ebc142caf859e3acb3671c0378dea0 (diff)
downloadupstream-9ea7019ffd60ab3ef5a5654116fbc339f856482c.tar.gz
upstream-9ea7019ffd60ab3ef5a5654116fbc339f856482c.tar.bz2
upstream-9ea7019ffd60ab3ef5a5654116fbc339f856482c.zip
build: add a config knob to enable LTO for all packages
This enables LTO for all packages which haven't opted-out. Signed-off-by: Andre Heider <a.heider@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/package.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/package.mk b/include/package.mk
index 687f74edc1..d80f3bce49 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -56,7 +56,7 @@ ifeq ($(call pkg_build_flag,gc-sections,$(if $(CONFIG_USE_GC_SECTIONS),1,0)),1)
TARGET_CXXFLAGS+= -ffunction-sections -fdata-sections
TARGET_LDFLAGS+= -Wl,--gc-sections
endif
-ifeq ($(call pkg_build_flag,lto,0),1)
+ifeq ($(call pkg_build_flag,lto,$(if $(CONFIG_USE_LTO),1,0)),1)
TARGET_CFLAGS+= -flto=auto -fno-fat-lto-objects
TARGET_CXXFLAGS+= -flto=auto -fno-fat-lto-objects
TARGET_LDFLAGS+= -flto=auto -fuse-linker-plugin