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
@@ -21,6 +21,7 @@ PKG_CPE_ID:=cpe:/a:lldpd_project:lldpd
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_BUILD_FLAGS:=lto
|
||||
PKG_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
@@ -111,7 +112,6 @@ CONFIGURE_ARGS += \
|
||||
$(if $(CONFIG_LLDPD_WITH_SNMP),--with-snmp,) \
|
||||
$(if $(CONFIG_USE_GLIBC),,--without-libbsd)
|
||||
|
||||
TARGET_CFLAGS += -flto
|
||||
TARGET_LDFLAGS += -flto -Wl,--gc-sections,--as-needed
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
|
||||
|
||||
$(eval $(call BuildPackage,lldpd))
|
||||
|
||||
Reference in New Issue
Block a user