summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2023-03-23 09:52:20 +0100
committerNick Hainke <vincent@systemli.org>2023-04-13 07:46:21 +0200
commit67ad3b9b9686855b01d5353da5d876b7b1274ef6 (patch)
tree5648df62c08c508d045d7774a61c6a21ee8e3db9
parent9febc56a445ddb4d67c0f1133a0c17b67721bcd1 (diff)
treewide: refactor to use PKG_BUILD_FLAGS:=gc-sections
See commit da370098 "treewide: add support for "gc-sections" in PKG_BUILD_FLAGS" on the main repository. Signed-off-by: Andre Heider <a.heider@gmail.com>
-rw-r--r--alfred/Makefile5
-rw-r--r--batctl/Makefile8
2 files changed, 4 insertions, 9 deletions
diff --git a/alfred/Makefile b/alfred/Makefile
index 1325d6e..81ce841 100644
--- a/alfred/Makefile
+++ b/alfred/Makefile
@@ -15,6 +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_CONFIG_DEPENDS += \
CONFIG_ALFRED_NEEDS_lua \
@@ -67,8 +68,8 @@ MAKE_FLAGS += \
LIBNL_GENL_NAME="libnl-tiny" \
REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)"
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -fuse-linker-plugin
define Package/alfred/install
$(INSTALL_DIR) $(1)/usr/sbin
diff --git a/batctl/Makefile b/batctl/Makefile
index 0d2452d..2adbf42 100644
--- a/batctl/Makefile
+++ b/batctl/Makefile
@@ -16,6 +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
include $(INCLUDE_DIR)/package.mk
@@ -70,13 +71,6 @@ $(Package/batctl/description)
Subcommands for configuration, online and offline debugging are enabled.
endef
-# The linker can identify unused sections of a binary when each symbol is stored
-# in a separate section. This mostly removes unused linker sections and reduces
-# the size by ~3% on mipsel.
-
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
# 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.