treewide: add support for "lto" in PKG_BUILD_FLAGS
This reduces open coding and allows to easily add a knob to enable it treewide, where chosen packages can still opt-out via "no-lto". Some packages used LTO, but not the linker plugin. This unifies 'em all to attempt to produce better code. Quoting man gcc(1): "This improves the quality of optimization by exposing more code to the link-time optimizer." Also use -flto=auto instead of -flto=jobserver, as it's not guaranteed that every buildsystem uses +$(MAKE) correctly. Signed-off-by: Andre Heider <a.heider@gmail.com>
This commit is contained in:
committed by
Christian Marangi
parent
da3700988d
commit
07730ff346
@@ -23,7 +23,7 @@ PKG_BUILD_DEPENDS:=util-linux e2fsprogs/host
|
||||
PKG_INSTALL:=1
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=gc-sections
|
||||
PKG_BUILD_FLAGS:=gc-sections lto
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
@@ -143,9 +143,7 @@ $(call Package/e2fsprogs)
|
||||
DEPENDS:= +e2fsprogs
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += $(FPIC) -flto
|
||||
|
||||
TARGET_LDFLAGS += -flto
|
||||
TARGET_CFLAGS += $(FPIC)
|
||||
|
||||
CONFIGURE_ARGS += \
|
||||
--disable-testio-debug \
|
||||
|
||||
Reference in New Issue
Block a user