treewide: refactor to use PKG_BUILD_FLAGS:=lto
authorAndre Heider <a.heider@gmail.com>
Thu, 23 Mar 2023 08:53:12 +0000 (09:53 +0100)
committerNick Hainke <vincent@systemli.org>
Thu, 13 Apr 2023 05:46:21 +0000 (07:46 +0200)
See commit 07730ff3 "treewide: add support for "lto" in PKG_BUILD_FLAGS"
on the main repository.

Signed-off-by: Andre Heider <a.heider@gmail.com>
alfred/Makefile
batctl/Makefile

index 81ce841789a907773d34f94556341d97678611ef..c5fceab1f5b859a2af19638d9ed40a24046aff87 100644 (file)
@@ -15,7 +15,7 @@ PKG_LICENSE:=GPL-2.0-only MIT
 PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT
 
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
 
 PKG_CONFIG_DEPENDS += \
        CONFIG_ALFRED_NEEDS_lua \
@@ -68,9 +68,6 @@ MAKE_FLAGS += \
         LIBNL_GENL_NAME="libnl-tiny" \
         REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)"
 
-TARGET_CFLAGS  += -flto
-TARGET_LDFLAGS += -fuse-linker-plugin
-
 define Package/alfred/install
        $(INSTALL_DIR) $(1)/usr/sbin
        cp -fpR  $(PKG_BUILD_DIR)/alfred $(1)/usr/sbin/
index 2adbf422d0bc6881f0356fe967f44c2aa6ba4553..8a81cbb8093c63d1c149db4c855c31787432e7de 100644 (file)
@@ -16,7 +16,7 @@ PKG_LICENSE:=GPL-2.0-only ISC MIT
 PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT LICENSES/deprecated/ISC
 
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_FLAGS:=gc-sections
+PKG_BUILD_FLAGS:=gc-sections lto
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -71,13 +71,6 @@ $(Package/batctl/description)
   Subcommands for configuration, online and offline debugging are enabled.
 endef
 
-# Link-time optimization allows to move parts of the optimization from the single
-# source file to the global source view. This is done by emitting the GIMPLE
-# representation in each object file and analyzing it again during the link step.
-
-TARGET_CFLAGS  += -flto
-TARGET_LDFLAGS += -fuse-linker-plugin
-
 MAKE_VARS += \
         LIBNL_NAME="libnl-tiny" \
         LIBNL_GENL_NAME="libnl-tiny"