Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
config IPV6
def_bool y
+ config LTO
+ bool
+ prompt "Build packages with LTO"
+ default n
+ help
+ Builds packages with link time optimization.
+ Can be disabled per package with PKG_LTO:=0.
+
comment "Stripping options"
choice
IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
TARGET_CFLAGS += $(IREMAP_CFLAGS)
endif
+ifdef CONFIG_LTO
+ ifneq ($(strip $(PKG_LTO)),0)
+ TARGET_CFLAGS += -flto
+ TARGET_CXXFLAGS += -flto
+ TARGET_LDFLAGS += -flto=jobserver
+ endif
+endif
include $(INCLUDE_DIR)/hardening.mk
include $(INCLUDE_DIR)/prereq.mk