summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2023-03-23 09:09:13 +0100
committerAndre Heider <a.heider@gmail.com>2023-04-08 08:38:54 +0200
commit35f4ef76e0c88b690ec55f26aed072c4c5989eff (patch)
treec5b36bb3b16488c4546c3c283b8a6020e3966143 /net
parent565866a47210c9711c29173052063779b6d3bcfc (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. 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>
Diffstat (limited to 'net')
-rw-r--r--net/aircrack-ng/Makefile6
-rw-r--r--net/aria2/Makefile5
-rw-r--r--net/clamav/Makefile5
-rw-r--r--net/curl/Makefile4
-rw-r--r--net/dcstad/Makefile4
-rw-r--r--net/dcwapd/Makefile5
-rw-r--r--net/dnscrypt-proxy/Makefile8
-rw-r--r--net/foolsm/Makefile5
-rw-r--r--net/kadnode/Makefile5
-rw-r--r--net/kea/Makefile5
-rw-r--r--net/ksmbd-tools/Makefile4
-rw-r--r--net/mac-telnet/Makefile5
-rw-r--r--net/modemmanager/Makefile4
-rw-r--r--net/mosh/Makefile5
-rw-r--r--net/mrmctl/Makefile5
-rw-r--r--net/mtr/Makefile4
-rw-r--r--net/netifyd/Makefile6
-rw-r--r--net/nginx/Makefile4
-rw-r--r--net/openvpn/Makefile4
-rw-r--r--net/samba4/Makefile6
-rw-r--r--net/tor/Makefile5
-rw-r--r--net/transmission/Makefile5
-rw-r--r--net/zerotier/Makefile5
23 files changed, 57 insertions, 57 deletions
diff --git a/net/aircrack-ng/Makefile b/net/aircrack-ng/Makefile
index 3333aedd4..1323a0e6b 100644
--- a/net/aircrack-ng/Makefile
+++ b/net/aircrack-ng/Makefile
@@ -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/
diff --git a/net/aria2/Makefile b/net/aria2/Makefile
index 726ca35d6..5004eff42 100644
--- a/net/aria2/Makefile
+++ b/net/aria2/Makefile
@@ -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
diff --git a/net/clamav/Makefile b/net/clamav/Makefile
index cf903f4ca..8d6e7676f 100644
--- a/net/clamav/Makefile
+++ b/net/clamav/Makefile
@@ -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
diff --git a/net/curl/Makefile b/net/curl/Makefile
index c3ba55ac0..c79ca80d8 100644
--- a/net/curl/Makefile
+++ b/net/curl/Makefile
@@ -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 \
diff --git a/net/dcstad/Makefile b/net/dcstad/Makefile
index 3112b0c1c..bd07a8e4a 100644
--- a/net/dcstad/Makefile
+++ b/net/dcstad/Makefile
@@ -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
diff --git a/net/dcwapd/Makefile b/net/dcwapd/Makefile
index 0599e5a60..34e2861af 100644
--- a/net/dcwapd/Makefile
+++ b/net/dcwapd/Makefile
@@ -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
diff --git a/net/dnscrypt-proxy/Makefile b/net/dnscrypt-proxy/Makefile
index 9d8883aab..060f9acda 100644
--- a/net/dnscrypt-proxy/Makefile
+++ b/net/dnscrypt-proxy/Makefile
@@ -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)" \
diff --git a/net/foolsm/Makefile b/net/foolsm/Makefile
index 2d67aa6e0..0cbe3f247 100644
--- a/net/foolsm/Makefile
+++ b/net/foolsm/Makefile
@@ -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
diff --git a/net/kadnode/Makefile b/net/kadnode/Makefile
index 1adfdf168..2b93f6a51 100644
--- a/net/kadnode/Makefile
+++ b/net/kadnode/Makefile
@@ -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
diff --git a/net/kea/Makefile b/net/kea/Makefile
index 372ce54bc..a630f41c0 100644
--- a/net/kea/Makefile
+++ b/net/kea/Makefile
@@ -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
diff --git a/net/ksmbd-tools/Makefile b/net/ksmbd-tools/Makefile
index 1612bd0d2..a526cfe2a 100644
--- a/net/ksmbd-tools/Makefile
+++ b/net/ksmbd-tools/Makefile
@@ -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
diff --git a/net/mac-telnet/Makefile b/net/mac-telnet/Makefile
index 0e4e4c1b9..93b8d7c0b 100644
--- a/net/mac-telnet/Makefile
+++ b/net/mac-telnet/Makefile
@@ -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
diff --git a/net/modemmanager/Makefile b/net/modemmanager/Makefile
index e27988733..a79f65f67 100644
--- a/net/modemmanager/Makefile
+++ b/net/modemmanager/Makefile
@@ -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"
diff --git a/net/mosh/Makefile b/net/mosh/Makefile
index 1c3341a32..53b8659f4 100644
--- a/net/mosh/Makefile
+++ b/net/mosh/Makefile
@@ -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
diff --git a/net/mrmctl/Makefile b/net/mrmctl/Makefile
index a595cecbe..3fdf4cb86 100644
--- a/net/mrmctl/Makefile
+++ b/net/mrmctl/Makefile
@@ -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
diff --git a/net/mtr/Makefile b/net/mtr/Makefile
index 5e20e4faa..a340898ce 100644
--- a/net/mtr/Makefile
+++ b/net/mtr/Makefile
@@ -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
diff --git a/net/netifyd/Makefile b/net/netifyd/Makefile
index 6695acc65..8f05f6b7c 100644
--- a/net/netifyd/Makefile
+++ b/net/netifyd/Makefile
@@ -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 \
diff --git a/net/nginx/Makefile b/net/nginx/Makefile
index 438ee8525..aa43193ca 100644
--- a/net/nginx/Makefile
+++ b/net/nginx/Makefile
@@ -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 \
diff --git a/net/openvpn/Makefile b/net/openvpn/Makefile
index a512e364f..fd6e7bd54 100644
--- a/net/openvpn/Makefile
+++ b/net/openvpn/Makefile
@@ -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) \
diff --git a/net/samba4/Makefile b/net/samba4/Makefile
index ee1ac2620..cdd05443c 100644
--- a/net/samba4/Makefile
+++ b/net/samba4/Makefile
@@ -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:=:
diff --git a/net/tor/Makefile b/net/tor/Makefile
index ad320ac3d..cd5946b46 100644
--- a/net/tor/Makefile
+++ b/net/tor/Makefile
@@ -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" \
diff --git a/net/transmission/Makefile b/net/transmission/Makefile
index e0c03f3ca..dc4244c09 100644
--- a/net/transmission/Makefile
+++ b/net/transmission/Makefile
@@ -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 \
diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile
index 01ad05248..98551b062 100644
--- a/net/zerotier/Makefile
+++ b/net/zerotier/Makefile
@@ -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