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>
PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT
PKG_BUILD_PARALLEL:=1
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 \
PKG_CONFIG_DEPENDS += \
CONFIG_ALFRED_NEEDS_lua \
LIBNL_GENL_NAME="libnl-tiny" \
REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)"
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
define Package/alfred/install
$(INSTALL_DIR) $(1)/usr/sbin
PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT LICENSES/deprecated/ISC
PKG_BUILD_PARALLEL:=1
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
include $(INCLUDE_DIR)/package.mk
Subcommands for configuration, online and offline debugging are enabled.
endef
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.
# 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.