treewide: refactor to use PKG_BUILD_FLAGS:=gc-sections
authorAndre Heider <a.heider@gmail.com>
Thu, 23 Mar 2023 08:09:13 +0000 (09:09 +0100)
committerAndre Heider <a.heider@gmail.com>
Sat, 8 Apr 2023 06:38:54 +0000 (08:38 +0200)
See commit da370098 "treewide: add support for "gc-sections" in
PKG_BUILD_FLAGS" on the main repository.

Note: This only touches packages which use all three parts
(-ffunction-sections, -fdata-sections and -Wl,--gc-sections) enabled by
this build flag. Some packages only use a subset, and these are left
unchanged for now.

Signed-off-by: Andre Heider <a.heider@gmail.com>
46 files changed:
admin/netdata/Makefile
ipv6/miredo/Makefile
lang/lua-rs232/Makefile
libs/boost/Makefile
libs/giflib/Makefile
libs/glib2/Makefile
libs/libdcwproto/Makefile
libs/libdcwsocket/Makefile
libs/libmbim/Makefile
libs/libqmi/Makefile
libs/libqrtr-glib/Makefile
libs/libtasn1/Makefile
libs/libtins/Makefile
mail/emailrelay/Makefile
multimedia/v4l2rtspserver/Makefile
net/aircrack-ng/Makefile
net/aria2/Makefile
net/clamav/Makefile
net/curl/Makefile
net/dcstad/Makefile
net/dcwapd/Makefile
net/dnscrypt-proxy/Makefile
net/foolsm/Makefile
net/kadnode/Makefile
net/kea/Makefile
net/ksmbd-tools/Makefile
net/mac-telnet/Makefile
net/modemmanager/Makefile
net/mosh/Makefile
net/mrmctl/Makefile
net/mtr/Makefile
net/netifyd/Makefile
net/nginx/Makefile
net/openvpn/Makefile
net/samba4/Makefile
net/tor/Makefile
net/transmission/Makefile
net/zerotier/Makefile
sound/espeak/Makefile
utils/acpid/Makefile
utils/bluez/Makefile
utils/btrfs-progs/Makefile
utils/dump1090/Makefile
utils/gptfdisk/Makefile
utils/readsb/Makefile
utils/zsh/Makefile

index 5bee334246a5e248573925b15683ed51996c9ac8..f4d00786d588046caec350f3dc68dfdf02ff3843 100644 (file)
@@ -24,7 +24,7 @@ PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-v$(PKG_VERSION)
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
-PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_FLAGS:=no-mips16 gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -44,9 +44,7 @@ define Package/netdata/description
   python3-urllib3
 endef
 
-TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -O3
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
 
 CONFIGURE_ARGS += \
        --with-zlib \
index 9e1390a233a99ab87327f2d471645b96f630524c..8527db824db4385801f6bc683030023844b8c2e5 100644 (file)
@@ -14,6 +14,7 @@ PKG_CONFIG_DEPENDS:= \
 PKG_BUILD_PARALLEL:=1
 PKG_CHECK_FORMAT_SECURITY:=0
 PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 PKG_MAINTAINER:=
 PKG_LICENSE:=GPL-2.0-or-later
@@ -52,11 +53,7 @@ CONFIGURE_VARS += \
        ac_cv_header_sys_capability_h=no
 
 TARGET_CFLAGS+= \
-       $(FPIC) \
-       -ffunction-sections \
-       -fdata-sections
-
-TARGET_LDFLAGS += -Wl,--gc-sections
+       $(FPIC)
 
 define Package/miredo/install
        $(INSTALL_DIR) $(1)/usr/lib
index a7b2d9505709f19d1b0ecd9e25f55fe8955d84df..654e21ca1172ada28c35bf4bd4295ad062c2ca23 100644 (file)
@@ -24,6 +24,7 @@ PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=lua/host
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -40,8 +41,7 @@ define Package/lua-rs232/description
   multiplatform library for serial communications over RS-232
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_LDFLAGS += -Wl,--as-needed
 MAKE_FLAGS += luadir='$$$${prefix}/lib/lua' luaexecdir='$$$${exec_prefix}/lib/lua'
 
 define Build/InstallDev
index bf72531fb730e0824001c6e9bcf95a16d43abdf2..cb92e27a46329c6e3ee512421f843803ec53ee7d 100644 (file)
@@ -29,7 +29,7 @@ HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)_$(PKG_SOURCE_VERSION)
 
 HOST_BUILD_PARALLEL:=1
 PKG_BUILD_PARALLEL:=1
-PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_FLAGS:=no-mips16 gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -379,10 +379,10 @@ define Host/Compile
 endef
 
 CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR)
-TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--gc-sections,--as-needed,--print-gc-sections
+TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--as-needed,--print-gc-sections
 
 TARGET_CFLAGS += \
-       $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -ffunction-sections -fdata-sections -flto
+       $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -flto
 
 ifeq ($(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION)))),5)
     EXTRA_CXXFLAGS += -std=gnu++14
index 2f8eb4c532eba665b07353b21d95c7e42b729ab4..a6174e9825d21573f5a0f9a6f163090d5dc7139e 100644 (file)
@@ -22,6 +22,7 @@ PKG_CPE_ID:=cpe:/a:giflib_project:giflib
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -49,8 +50,8 @@ define Package/giflib-utils/description
   These are the utilities that come with giflib.
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections $(FPIC)
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -Wl,--as-needed
 
 MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS)" \
index 5493e5e693a3edf12792490977b076f3a29f7f36..226242dc5a2dbb3ac369ee3f2baa84b35f359892 100644 (file)
@@ -24,6 +24,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/glib-$(PKG_VERSION)
 HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/glib-$(PKG_VERSION)
 PKG_CONFIG_DEPENDS:=CONFIG_BUILD_NLS
 PKG_FORTIFY_SOURCE:=0
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/host-build.mk
 include $(INCLUDE_DIR)/package.mk
@@ -42,9 +43,6 @@ define Package/glib2/description
   The GLib library of C routines
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
 COMP_ARGS= \
        -Dselinux=disabled \
        -Dlibmount=disabled \
index 37905b85457d56bd52cea2633d0c97c4de2539e0..caaec8f79d5cc571a26f876e09157f629054df26 100644 (file)
@@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -37,8 +38,8 @@ define Package/libdcwproto/description
   Platform-independent C library for marshaling and serializing DCW messages
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
index 28176a8ecf35a489a09d7172f97f5ad4adec0f3e..dc3bf3f1eb0115ad0d6e6ce0624cb814c1e07104 100644 (file)
@@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=COPYING
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -37,8 +38,8 @@ define Package/libdcwsocket/description
   User-land C library for sending and receiving DCW "EtherType"d messages
 endef
 
-TARGET_CFLAGS += -std=c89 -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += -std=c89 -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
index 8591b4337f7a329c58d8f6a640b39d2f3023f94f..0d74b542eb3564df9abf052b9b7edd38d331fdfe 100644 (file)
@@ -15,14 +15,15 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libmbim.git
 PKG_MIRROR_HASH:=7ecc6d1e565392817311254045337907bbad015b46ec88542ea63594f47778be
 
+PKG_BUILD_FLAGS:=gc-sections
+
 PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/meson.mk
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -fno-merge-all-constants -fmerge-constants
 
 MESON_ARGS += \
        -Dintrospection=false \
index 8dac951552d2d0b6a71032d2437faa458274b364..21a7af1fc7e791a7890ae1fa3b87441ae12f2726 100644 (file)
@@ -15,14 +15,15 @@ PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqmi.git
 PKG_MIRROR_HASH:=674f5848c56c11cdc2fbc82c52e5bc2a3a0fddb56315dc4220544688a7b0e17a
 
+PKG_BUILD_FLAGS:=gc-sections
+
 PKG_MAINTAINER:=Nicholas Smith <nicholas@nbembedded.com>
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/meson.mk
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -fno-merge-all-constants -fmerge-constants
 
 define Package/libqmi/config
   source "$(SOURCE)/Config.in"
index b5fabf31b2dc6ffed1c69c6f51f2b3086b3d0492..1796627a89089f3b5e6e44f7fd85d0eec38b65f8 100644 (file)
@@ -16,14 +16,15 @@ PKG_SOURCE_URL:=https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib.git
 PKG_SOURCE_VERSION:=$(PKG_VERSION)
 PKG_MIRROR_HASH:=ffb918edf96581d4ba310bd1e975297e9a7006a7e26f37934afde462585125f2
 
+PKG_BUILD_FLAGS:=gc-sections
+
 PKG_MAINTAINER:=Nicholas Smith <nicholas.smith@telcoantennas.com.au>
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/meson.mk
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -fno-merge-all-constants -fmerge-constants
 
 define Package/libqrtr-glib
   SECTION:=libs
index b97a9cdbc0131bbe22074f79b6c5367278e8c936..7e70b2212d8d67df0ecaf26540b144129e63831f 100644 (file)
@@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:gnu:libtasn1
 #PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/host-build.mk
@@ -40,8 +41,6 @@ define Package/libtasn1/description
 endef
 
 HOST_CFLAGS += -std=gnu99
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
 
 HOST_CONFIGURE_ARGS += \
        --disable-shared \
index 11b7c2f11e421dc87fac9f45e5470d207a729fb4..644eecdbf3704dac3b6e7ce4a6104d1ae5589170 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE:=BSD-2-Clause
 PKG_LICENSE_FILES:=LICENSE
 
 CMAKE_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
@@ -52,8 +53,8 @@ CMAKE_OPTIONS += \
        -DLIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA=$(if $(CONFIG_LIBTINS_ENABLE_TCP_STREAM_CUSTOM_DATA),ON,OFF) \
        -DLIBTINS_ENABLE_WPA2=$(if $(CONFIG_LIBTINS_ENABLE_WPA2),ON,OFF)
 
-TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CXXFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Package/libtins/install
        $(INSTALL_DIR) $(1)/usr/lib
index 7ec681bc35f55c9bd892d62afbd79fd7f8984570..5b9704257e03d2bb82b984be1f6abc1b516f4b2e 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE:=GPL-3.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
 PKG_CONFIG_DEPENDS:=CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG CONFIG_EMAILRELAY_SSL
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -94,8 +95,8 @@ ifeq ($(CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG),y)
                --enable-debug=yes
 endif
 
-TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_CXXFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CXXFLAGS += -flto
+TARGET_CXXFLAGS += -Wl,--as-needed
 
 define Package/emailrelay/install
        $(INSTALL_DIR) $(1)/usr/bin
index 9ddcd1eaf32e0d7a9de33bdbe403899b8fb346dc..f93d0647e95e6984399275f220b6951138d134cb 100644 (file)
@@ -16,6 +16,8 @@ PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver
 PKG_SOURCE_VERSION:=v$(PKG_VERSION)
 PKG_MIRROR_HASH:=f2eca75c8af9933f4ceb67cab74af488e1e9ec8af9cbef2534fda5b701b1d63d
 
+PKG_BUILD_FLAGS:=gc-sections
+
 LIVE555_VERSION:=2022.10.01
 LIVE555_HASH:=429de73061e3fc6901c4d2f0b7562ae3f6233060ca4b5e182fe555d065cbdd45
 LIVE555_FILE:=live.$(LIVE555_VERSION).tar.gz
@@ -49,8 +51,8 @@ define Download/live555
        HASH:=$(LIVE555_HASH)
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 CMAKE_OPTIONS += \
        -DALSA=OFF \
index 3333aedd4542fcfbabc626ffb90f521b1a2cb242..1323a0e6b86e03d0cf0d8d5a7bf6fe6633ad170a 100644 (file)
@@ -20,6 +20,7 @@ PKG_HASH:=4f0bfd486efc6ea7229f7fbc54340ff8b2094a0d73e9f617e0a39f878999a247
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 PKG_MAINTAINER:=Rick Farina <zerochaos@gentoo.org>
 
@@ -90,15 +91,12 @@ CONFIGURE_ARGS += \
        $(if $(CONFIG_AIRCRACK_NG_HWLOC),--enable-hwloc,--disable-hwloc) \
        $(if $(CONFIG_AIRCRACK_NG_SQLITE3),--with-sqlite3=$(STAGING_DIR)/usr,--without-sqlite3)
 
-TARGET_CFLAGS += -Wall -Wextra -ffunction-sections -fdata-sections -fcommon
+TARGET_CFLAGS += -Wall -Wextra -fcommon
 
 ifeq ($(CONFIG_AIRCRACK_NG_OPTIMIZE_SPEED),y)
        TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3
 endif
 
-TARGET_LDFLAGS+= \
-       -Wl,--gc-sections
-
 define Package/aircrack-ng/install
        $(INSTALL_DIR) $(1)/usr/bin
        $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
index 726ca35d6efda7a12dbf0a4d56959565be7c2b05..5004eff422a2c31bcef70050992d175d1ad71880 100644 (file)
@@ -15,6 +15,7 @@ PKG_SOURCE_URL:=https://github.com/aria2/aria2/releases/download/release-$(PKG_V
 PKG_HASH:=58d1e7608c12404f0229a3d9a4953d0d00c18040504498b483305bcb3de907a5
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 PKG_MAINTAINER:=Imre Kaloz <kaloz@openwrt.org>, \
        Hsing-Wang Liao <kuoruan@gmail.com>
@@ -83,8 +84,8 @@ CONFIGURE_ARGS += \
        --without-libuv \
        --with-libz
 
-TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -flto
+TARGET_CXXFLAGS += -flto
+TARGET_LDFLAGS += -flto
 
 define Package/aria2/conffiles
 /etc/config/aria2
index cf903f4ca1e44f44cfecb95f1735c85673103a86..8d6e7676fd535fd15e193439d2e03a8de655b132 100644 (file)
@@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=COPYING*
 PKG_CPE_ID:=cpe:/a:clamav:clamav
 
 PKG_BUILD_DEPENDS:=ncurses
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -72,8 +73,8 @@ CMAKE_OPTIONS += \
        -DENABLE_SYSTEMD=OFF \
        -DHAVE_SYSTEM_LFS_FTS=O$(if $(CONFIG_USE_GLIBC),N,FF)
 
-TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -fno-rtti -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CXXFLAGS += -fno-rtti -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Package/clamav/conffiles
 /etc/config/clamav
index c3ba55ac0e3a5a6b75a6720b83dd2e0e581ac4c8..c79ca80d8bb10dfb7a324ae369e34a82fef3759d 100644 (file)
@@ -26,6 +26,7 @@ PKG_CPE_ID:=cpe:/a:haxx:libcurl
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 PKG_CONFIG_DEPENDS:= \
   CONFIG_IPV6 \
@@ -105,9 +106,8 @@ define Package/libcurl/config
   source "$(SOURCE)/Config.in"
 endef
 
-TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
+TARGET_CFLAGS += $(FPIC)
 TARGET_CPPFLAGS += $(if $(CONFIG_LIBCURL_NTLM),,-DCURL_DISABLE_NTLM)
-TARGET_LDFLAGS += -Wl,--gc-sections
 
 CONFIGURE_ARGS += \
        --disable-debug \
index 3112b0c1c26fe2b19793c78f3b49c2a0f1617bfc..bd07a8e4a422325232943db35fab7881acf6ee62 100644 (file)
@@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -38,8 +39,7 @@ define Package/dcstad/description
 Implementation of the Dual-Channel WiFi client daemon
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -flto
 
 define Package/dcstad/install
        $(INSTALL_DIR) $(1)/bin
index 0599e5a60170a32ae9689462fdc658508bd2b4e8..34e2861af82abec92b3f9b52065ef425e637e0f9 100644 (file)
@@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -42,8 +43,8 @@ CONFIGURE_ARGS += \
        --enable-platform=linuxjsonstatic \
        --enable-shared
 
-TARGET_CXXFLAGS += -std=c++11 -DRAPIDJSON_HAS_CXX11_RVALUE_REFS=0 -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -ldcwproto -ldcwsocket -lmrmfilterparser -luci -Wl,--gc-sections,--as-needed
+TARGET_CXXFLAGS += -std=c++11 -DRAPIDJSON_HAS_CXX11_RVALUE_REFS=0 -flto
+TARGET_LDFLAGS += -ldcwproto -ldcwsocket -lmrmfilterparser -luci -Wl,--as-needed
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/lib
index 9d8883aab3e06ac31a1ec0bf38d4838dcbf60373..060f9acda938dbccc8477f7dce384cfe605d4adb 100644 (file)
@@ -23,6 +23,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 PKG_CONFIG_DEPENDS:= \
        CONFIG_DNSCRYPT_ENABLE_PLUGINS
 
@@ -84,12 +85,7 @@ define Build/Configure
 endef
 
 TARGET_CFLAGS += \
-       -fomit-frame-pointer \
-       -fdata-sections \
-       -ffunction-sections
-
-TARGET_LDFLAGS += \
-       -Wl,-gc-sections
+       -fomit-frame-pointer
 
 MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS)" \
index 2d67aa6e0da9f1b5fff1552d081a101f1a488629..0cbe3f2472a373e70aa811c54e2a37db9e20afb1 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE:=GPL-2.0-only
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -43,8 +44,8 @@ endef
 MAKE_FLAGS += \
        PREFIX="$(CONFIGURE_PREFIX)"
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Package/foolsm/install
        $(INSTALL_DIR) $(1)/usr/sbin
index 1adfdf1681fc02d49f38e606476bd31fbde71779..2b93f6a5106463389008229ea5fc03423111e706 100644 (file)
@@ -14,6 +14,7 @@ PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
 PKG_LICENSE:=MIT
 
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -71,10 +72,6 @@ endif
 
 MAKE_FLAGS += FEATURES="$(FEATURES)"
 
-# Make binary smaller
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
 define Package/kadnode/conffiles
 /etc/config/kadnode
 endef
index 372ce54bc4bf9214f3294be60ce084f26f2e60fc..a630f41c0b49fa1a0ce92d8bbd960f1ce0246bab 100644 (file)
@@ -21,6 +21,7 @@ PKG_LICENSE:=MPL-2.0
 PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 PKG_INSTALL:=1
 PKG_FIXUP:=autoreconf
@@ -204,12 +205,10 @@ CONFIGURE_VARS += \
 
 TARGET_CXXFLAGS += \
        $(FPIC) \
-       -fdata-sections \
-       -ffunction-sections \
        -std=c++17
 
 TARGET_LDFLAGS += \
-       -Wl,--gc-sections,--as-needed
+       -Wl,--as-needed
 
 define Package/kea-libs/install
        $(INSTALL_DIR) $(1)/usr/lib
index 1612bd0d2188788240e9f2c6f05a6c7eb6d75848..a526cfe2a75925f21c0717ee757f99307eddfe67 100644 (file)
@@ -12,6 +12,7 @@ PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DEPENDS:=glib2
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -70,8 +71,7 @@ MESON_ARGS += \
        -Db_lto=true \
        -Dkrb5=disabled
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Package/ksmbd-server/install
        $(INSTALL_DIR) $(1)/usr/libexec
index 0e4e4c1b920598ce09ad64e85b1d912d305e6974..93b8d7c0b2deaa849de49f61e7e45afa246941e4 100644 (file)
@@ -13,13 +13,14 @@ PKG_SOURCE_DATE:=2015-09-02
 PKG_SOURCE_VERSION:=37d83cbc9c07266d6c957d27bf75285b305eceab
 PKG_MIRROR_HASH:=ed414f3fb08f1e2bb4313d00fb99327df697de7c60284fe588fc7eb3769adb7a
 
+PKG_BUILD_FLAGS:=gc-sections
+
 PKG_LICENSE:=GPL-2.0-or-later
 PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
 
 include $(INCLUDE_DIR)/package.mk
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections $(if $(CONFIG_MACTELNET_PLAIN_SUPPORT),-DTELNET_SUPPORT)
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += $(if $(CONFIG_MACTELNET_PLAIN_SUPPORT),-DTELNET_SUPPORT)
 
 # 1: name
 # 2: executable
index e27988733d8db6827709cfb446f71b3ff337bf0b..a79f65f67777c3f21232aaa75ba366818637a71c 100644 (file)
@@ -20,13 +20,13 @@ PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_DEPENDS:=glib2/host libxslt/host
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
 include $(INCLUDE_DIR)/meson.mk
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -fno-merge-all-constants -fmerge-constants
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -fno-merge-all-constants -fmerge-constants
 
 define Package/modemmanager/config
   source "$(SOURCE)/Config.in"
index 1c3341a32ec0abd4e2419596a047727885c95772..53b8659f49388e354571052937ff08aaadcae3d8 100644 (file)
@@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=protobuf/host
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -95,8 +96,8 @@ CONFIGURE_ARGS += \
 CONFIGURE_VARS += \
        ac_cv_have_decl_ffs=yes
 
-TARGET_CXXFLAGS += -ffunction-sections -fdata-sections -flto -std=c++11
-TARGET_LDFLAGS += -Wl,--gc-sections -lncurses
+TARGET_CXXFLAGS += -flto -std=c++11
+TARGET_LDFLAGS += -lncurses
 
 define Package/mosh-client/install
        $(INSTALL_DIR) $(1)/usr/bin
index a595cecbe1a8829f0549cc61454c3e6cb9b543f8..3fdf4cb861c72e22f93f7518dd63f03b3d9ceb08 100644 (file)
@@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=userland/COPYING
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -43,8 +44,8 @@ CONFIGURE_PATH:=userland
 CONFIGURE_ARGS += \
        --enable-shared
 
-TARGET_CFLAGS += -std=c89 -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += -std=c89 -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Build/InstallDev
        $(INSTALL_DIR) $(1)/usr/include
index 5e20e4faacee26bc0c832e68d03639df8674775f..a340898ce3936e901115be1b4ff77a5a75d817d0 100644 (file)
@@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:matt_kimball_and_roger_wolff:mtr
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
+PKG_BUILD_FLAGS:=gc-sections
 
 CONFIGURE_ARGS += \
        --without-gtk \
@@ -68,8 +69,7 @@ define Package/mtr/description
        running statistics about each machine.
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_LDFLAGS += -Wl,--as-needed
 
 CONFIGURE_VARS += ac_cv_lib_cap_cap_set_proc=no
 
index 6695acc659e1a143f56fa575118be365d0ced3b1..8f05f6b7c67bc2ac8b1c84fe8297aa6d1d5fe308 100644 (file)
@@ -13,6 +13,7 @@ PKG_LICENSE:=GPL-3.0-or-later
 PKG_BUILD_PARALLEL:=1
 PKG_FIXUP:=autoreconf
 PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL:=https://gitlab.com/netify.ai/public/netify-agent.git
@@ -50,9 +51,8 @@ define Package/netifyd/conffiles
 /etc/netify.d/site.uuid
 endef
 
-TARGET_CFLAGS+=-ffunction-sections -fdata-sections -Wno-psabi
-TARGET_CXXFLAGS+=-std=c++11 -ffunction-sections -fdata-sections -Wno-psabi
-TARGET_LDFLAGS+=-Wl,--gc-sections
+TARGET_CFLAGS+=-Wno-psabi
+TARGET_CXXFLAGS+=-std=c++11 -Wno-psabi
 
 CONFIGURE_ARGS+= \
        --sharedstatedir=/var/run \
index 438ee8525771103d615cb2c551312c0cd71d2ea1..aa43193ca539b5af7ed6e3aefca53ad75ef63f97 100644 (file)
@@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:nginx:nginx
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 PKG_CONFIG_DEPENDS := \
        CONFIG_NGINX_DAV \
@@ -328,8 +329,7 @@ define Package/nginx-mod-luci/description
 endef
 
 
-TARGET_CFLAGS += -fvisibility=hidden -ffunction-sections -fdata-sections -DNGX_LUA_NO_BY_LUA_BLOCK
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -fvisibility=hidden -DNGX_LUA_NO_BY_LUA_BLOCK
 
 ifeq ($(CONFIG_NGINX_LUA),y)
   CONFIGURE_VARS += LUA_INC=$(STAGING_DIR)/usr/include \
index a512e364fefb4073cf98b2b6f3931eeda8faa280..fd6e7bd54b1d5809b3894f64c2c0fd305c620cc9 100644 (file)
@@ -23,6 +23,7 @@ PKG_MAINTAINER:=Magnus Kroken <mkroken@gmail.com>
 PKG_INSTALL:=1
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 PKG_LICENSE:=GPL-2.0
 PKG_CPE_ID:=cpe:/a:openvpn:openvpn
 
@@ -66,9 +67,6 @@ CONFIGURE_VARS += \
        IPROUTE=/sbin/ip \
        NETSTAT=/sbin/netstat
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
 define Build/Configure
        $(call Build/Configure/Default, \
                $(if $(CONFIG_OPENVPN_$(BUILD_VARIANT)_ENABLE_SMALL),--enable-small) \
index ee1ac2620ceaa069859e2ecfb686fb3d2a853d2e..cdd05443cd2621a6e1e2d97f000968ef6124be01 100644 (file)
@@ -15,6 +15,8 @@ PKG_SOURCE_URL:= \
                https://download.samba.org/pub/samba/stable/
 PKG_HASH:=70348656ef807be9c8be4465ca157cef4d99818e234253d2c684cc18b8408149
 
+PKG_BUILD_FLAGS:=gc-sections
+
 PKG_LICENSE:=GPL-3.0-only
 PKG_LICENSE_FILES:=COPYING
 PKG_CPE_ID:=cpe:/a:samba:samba
@@ -125,8 +127,8 @@ define Package/samba4-utils/description
   Utilities collection
 endef
 
-TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += $(FPIC)
+TARGET_LDFLAGS += -Wl,--as-needed
 # dont mess with sambas private rpath!
 RSTRIP:=:
 
index ad320ac3dc6d9a6ef3ae7fd3c35c70f090cf4da2..cd5946b46fe3450418517d46e5cb7012c5f6a6f9 100644 (file)
@@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:torproject:tor
 PKG_INSTALL:=1
 PKG_FIXUP:=autoreconf
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -140,10 +141,10 @@ ifeq ($(BUILD_VARIANT),basic)
 endif
 
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto \
+TARGET_CFLAGS += -flto \
        $(if $(CONFIG_OPENSSL_ENGINE),,-DDISABLE_ENGINES)
 
-TARGET_LDFLAGS += -Wl,--gc-sections -flto
+TARGET_LDFLAGS += -flto
 
 CONFIGURE_VARS += \
        CROSS_COMPILE="yes" \
index e0c03f3cae5a73d8ebbaa76d6102f0a119beee44..dc4244c092dcd709ee74a82885137b340ddbd121 100644 (file)
@@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:transmissionbt:transmission
 PKG_INSTALL:=1
 PKG_BUILD_DEPENDS:=libb64 node/host
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 PKG_CONFIG_DEPENDS:= \
        CONFIG_LIBCURL_GNUTLS \
        CONFIG_LIBCURL_MBEDTLS \
@@ -91,8 +92,8 @@ define Package/transmission-daemon/conffiles
 /etc/config/transmission
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto -DHAVE_SIZE_T -latomic
-TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
+TARGET_CFLAGS += -flto -DHAVE_SIZE_T -latomic
+TARGET_LDFLAGS += -Wl,--as-needed
 
 CMAKE_OPTIONS += \
        -DENABLE_CLI:BOOL=YES \
index 01ad05248f3772b17edc0143d389011746d118c8..98551b0628efd9703b5b87f0ab600f4306a9988e 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE_FILES:=LICENSE.txt
 
 PKG_ASLR_PIE:=0
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -58,8 +59,8 @@ endif
 endef
 
 # Make binary smaller
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -Wl,-z,noexecstack
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -Wl,-z,noexecstack
+TARGET_CFLAGS += -Wl,-z,noexecstack
+TARGET_LDFLAGS += -Wl,--as-needed -Wl,-z,noexecstack
 
 define Package/zerotier/conffiles
 /etc/config/zerotier
index 778647e5bedca19073dc6640d8fd8324050ef532..bcd7686142aebb07cb0ac22ff1028e94d92786f6 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE_FILES:=License.txt
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -50,8 +51,8 @@ MAKE_FLAGS+= \
 
 MAKE_PATH:=./src
 
-TARGET_CXXFLAGS += -std=c++14 -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += $(FPIC) $(if $(CONFIG_USE_GLIBC),-lm) -Wl,--gc-sections,--as-needed
+TARGET_CXXFLAGS += -std=c++14 -flto
+TARGET_LDFLAGS += $(FPIC) $(if $(CONFIG_USE_GLIBC),-lm) -Wl,--as-needed
 
 define Package/espeak/install
        $(INSTALL_DIR) $(1)/usr/bin
index 9328cbd7ea48a59f8c750604f5f25969175ace3e..ec1d41c8a1b5469f7e72c8ea8f99aa4e2b958001 100644 (file)
@@ -22,6 +22,7 @@ PKG_CPE_ID:=cpe:/a:tedfelix:acpid
 
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -37,8 +38,8 @@ define Package/acpid/description
   The ACPI Daemon (acpid) With Netlink Support
 endef
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Package/acpid/install
        $(INSTALL_DIR) $(1)/usr/sbin
index c585593cc7b290030769490f895ecda81e7a2b8e..bee4e79a991e6dad543829387e51cf14d07e7aac 100644 (file)
@@ -22,6 +22,7 @@ PKG_CPE_ID:=cpe:/a:bluez:bluez
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/nls.mk
@@ -79,8 +80,7 @@ define Package/bluez-daemon/conffiles
 /etc/config/bluetooth
 endef
 
-TARGET_CFLAGS += -D_GNU_SOURCE -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += -D_GNU_SOURCE
 
 CONFIGURE_ARGS += \
        --enable-static \
index 0db5d69cad39658cc6a49ae5070a7bdee19b8e20..8e6f306cf152a28c04de2db65a7aa8626fa33398 100644 (file)
@@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=COPYING
 PKG_INSTALL:=1
 PKG_BUILD_PARALLEL:=1
 PKG_BUILD_DEPENDS:=acl
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -56,8 +57,7 @@ endef
 boxprogs = btrfsck mkfs.btrfs btrfs-image btrfstune btrfs-find-root
 progs = btrfs-map-logical btrfs-select-super
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
+TARGET_LDFLAGS += -Wl,--as-needed
 
 EXTRA_CFLAGS=$(TARGET_CPPFLAGS)
 
index 26ec46b1622967e4e00e90fbff745c826a446db2..2f37cd06d9aae1175d648d0a0e26f1787b270130 100644 (file)
@@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=COPYING LICENSE
 
 PKG_BUILD_DEPENDS:=libusb
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -56,8 +57,8 @@ MAKE_FLAGS += \
        CFLAGS="$(TARGET_CFLAGS)" \
        UNAME="Linux"
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Package/dump1090/conffiles
 /etc/config/dump1090
index 68badcc1451f51fe1e8705d48064fcf46a30bc08..7295b6f6c00bee96e23fbc063de3149fb092a776 100644 (file)
@@ -20,6 +20,7 @@ PKG_LICENSE:=GPL-2.0-or-later
 PKG_LICENSE_FILES:=COPYING
 
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -72,8 +73,8 @@ define Package/fixparts/description
   Master Boot Record (MBR) partition tables
 endef
 
-TARGET_CXXFLAGS += -std=c++11 -ffunction-sections -fdata-sections -fno-rtti -flto -Wno-format-security
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
+TARGET_CXXFLAGS += -std=c++11 -fno-rtti -flto -Wno-format-security
+TARGET_LDFLAGS += -Wl,--as-needed
 
 define Package/gdisk/install
        $(INSTALL_DIR) $(1)/usr/bin
index e9ed05bde214107cb0d5578d3f3fda679496b436..47b966728251ae5e109ab3cd19705062dc046dec 100644 (file)
@@ -20,6 +20,7 @@ PKG_MAINTAINER:=Stijn Tintel <stijn@linux-ipv6.be>
 
 PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone
 PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -48,10 +49,10 @@ MAKE_FLAGS += \
        RTLSDR=yes \
        UNAME="Linux"
 
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
+TARGET_CFLAGS += -flto
 TARGET_LDFLAGS += \
        $(if $(CONFIG_USE_GLIBC),,-largp) \
-       -Wl,--gc-sections,--as-needed
+       -Wl,--as-needed
 
 define Package/readsb/conffiles
 /etc/config/readsb
index 8a95c1511db5b0b2651b95a1c39fa5c6e53487c9..9ab461df7ec8e4e16ba3f35c5991282745eace4e 100644 (file)
@@ -22,6 +22,7 @@ PKG_CPE_ID:=cpe:/a:zsh_project:zsh
 
 PKG_BUILD_PARALLEL:=1
 PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -82,8 +83,8 @@ define Build/Configure
        $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" prep
 endef
 
-TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += $(FPIC) -Wl,--gc-sections -flto
+TARGET_CFLAGS += $(FPIC) -flto
+TARGET_LDFLAGS += $(FPIC) -flto
 
 define Package/zsh/postinst
 #!/bin/sh