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_CPE_ID:=cpe:/a:matt_johnston:dropbear_ssh_server
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
PKG_BUILD_FLAGS:=no-mips16 gc-sections
|
||||
PKG_BUILD_FLAGS:=no-mips16 gc-sections lto
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
@@ -142,8 +142,7 @@ DB_OPT_CONFIG = \
|
||||
DROPBEAR_SVR_AGENTFWD|CONFIG_DROPBEAR_AGENTFORWARD|1|0 \
|
||||
|
||||
|
||||
TARGET_CFLAGS += -DARGTYPE=3 -flto
|
||||
TARGET_LDFLAGS += -flto=jobserver
|
||||
TARGET_CFLAGS += -DARGTYPE=3
|
||||
|
||||
db_opt_add =echo '\#define $(1) $(2)' >> $(PKG_BUILD_DIR)/localoptions.h
|
||||
db_opt_replace =$(ESED) 's,^(\#define $(1)) .*$$$$,\1 $(2),g' $(PKG_BUILD_DIR)/sysoptions.h
|
||||
|
||||
Reference in New Issue
Block a user