PKG_BUILD_FLAGS+=no-mips16
endif
-__unknown_flags=$(filter-out no-iremap no-mips16,$(PKG_BUILD_FLAGS))
+__unknown_flags=$(filter-out no-iremap no-mips16 gc-sections no-gc-sections,$(PKG_BUILD_FLAGS))
ifneq ($(__unknown_flags),)
$(error unknown PKG_BUILD_FLAGS: $(__unknown_flags))
endif
TARGET_CXXFLAGS += -mips16 -minterlink-mips16
endif
endif
+ifeq ($(call pkg_build_flag,gc-sections,0),1)
+ TARGET_CFLAGS+= -ffunction-sections -fdata-sections
+ TARGET_CXXFLAGS+= -ffunction-sections -fdata-sections
+ TARGET_LDFLAGS+= -Wl,--gc-sections
+endif
include $(INCLUDE_DIR)/hardening.mk
include $(INCLUDE_DIR)/prereq.mk
PKG_CONFIG_DEPENDS := CONFIG_KEXEC_ZLIB CONFIG_KEXEC_LZMA
+PKG_BUILD_FLAGS:=gc-sections
+
include $(INCLUDE_DIR)/package.mk
define Package/kexec-tools/Default
$(if $(CONFIG_KEXEC_LZMA),--with,--without)-lzma \
TARGET_LD="$(TARGET_CROSS)ld"
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
CONFIGURE_VARS += \
BUILD_CC="$(HOSTCC)" \
TARGET_CC="$(TARGET_CC)"
CONFIG_PACKAGE_libevent2-pthreads \
CONFIG_PACKAGE_libevent2-mbedtls
+PKG_BUILD_FLAGS:=gc-sections
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
threading & locking.
endef
-TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -flto
+TARGET_CFLAGS += $(FPIC) -flto
+TARGET_LDFLAGS += -Wl,--as-needed -flto
CMAKE_OPTIONS += \
-DEVENT__DISABLE_BENCHMARK:BOOL=ON \
PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
+PKG_BUILD_FLAGS:=gc-sections
+
include $(INCLUDE_DIR)/package.mk
define Package/libnl/default
message construction and parsing, object caching system, etc.
endef
-TARGET_CFLAGS += -ffunction-sections -fdata-sections $(FPIC)
+TARGET_CFLAGS += $(FPIC)
CONFIGURE_ARGS += \
--disable-debug
PKG_NAME:=mbedtls
PKG_VERSION:=2.28.2
PKG_RELEASE:=2
-PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_FLAGS:=no-mips16 gc-sections
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/ARMmbed/mbedtls/tar.gz/v$(PKG_VERSION)?
CSR generation (gen_key, cert_req)
endef
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS))
CMAKE_OPTIONS += \
PKG_NAME:=openssl
PKG_VERSION:=3.0.8
PKG_RELEASE:=4
-PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_FLAGS:=no-mips16 gc-sections
PKG_BUILD_PARALLEL:=1
)
endef
-TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS += $(FPIC)
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
PKG_CONFIG_DEPENDS := CONFIG_IPV6
+PKG_BUILD_FLAGS:=gc-sections
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
/etc/firewall.user
endef
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -flto
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -flto
CMAKE_OPTIONS += $(if $(CONFIG_IPV6),,-DDISABLE_IPV6=1)
define Package/firewall/install
PKG_BUILD_PARALLEL:=1
PKG_ASLR_PIE_REGULAR:=1
-PKG_BUILD_FLAGS:=no-mips16
+PKG_BUILD_FLAGS:=no-mips16 gc-sections
PKG_FIXUP:=autoreconf
PKG_FLAGS:=nonshared
DROPBEAR_SVR_AGENTFWD|CONFIG_DROPBEAR_AGENTFORWARD|1|0 \
-TARGET_CFLAGS += -DARGTYPE=3 -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver
+TARGET_CFLAGS += -DARGTYPE=3 -flto
+TARGET_LDFLAGS += -flto=jobserver
db_opt_add =echo '\#define $(1) $(2)' >> $(PKG_BUILD_DIR)/localoptions.h
db_opt_replace =$(ESED) 's,^(\#define $(1)) .*$$$$,\1 $(2),g' $(PKG_BUILD_DIR)/sysoptions.h
CONFIG_DRIVER_11AX_SUPPORT \
CONFIG_WPA_ENABLE_WEP
+PKG_BUILD_FLAGS:=gc-sections
+
EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl
SUPPLICANT_PROVIDERS:=
-D_GNU_SOURCE \
$(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver -fuse-linker-plugin -lubox -lubus
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -flto=jobserver -fuse-linker-plugin -lubox -lubus
ifdef CONFIG_PACKAGE_kmod-cfg80211
TARGET_LDFLAGS += -lm -lnl-tiny
PKG_BUILD_DEPENDS:=libpcap
PKG_ASLR_PIE_REGULAR:=1
+PKG_BUILD_FLAGS:=gc-sections
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
$(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
endef
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -flto -fuse-linker-plugin
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -flto -fuse-linker-plugin
MAKE_FLAGS += COPTS="$(TARGET_CFLAGS)" \
PRECOMPILED_FILTER=1 \
PKG_LICENSE:=GPL-2.0
PKG_CPE_ID:=cpe:/a:iproute2_project:iproute2
+PKG_BUILD_FLAGS:=gc-sections
+
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
> $(PKG_BUILD_DIR)/include/SNAPSHOT.h
endef
-TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
-TARGET_LDFLAGS += -Wl,--gc-sections -Wl,--as-needed
+TARGET_CFLAGS += -flto
+TARGET_LDFLAGS += -Wl,--as-needed
TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
MAKE_FLAGS += \
PKG_FLAGS:=nonshared
PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
PKG_BUILD_PARALLEL:=1
PKG_LICENSE:=GPL-2.0
PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables
TARGET_CFLAGS += \
-I$(PKG_BUILD_DIR)/include \
-I$(LINUX_DIR)/user_headers/include \
- -ffunction-sections -fdata-sections \
-DNO_LEGACY
-TARGET_LDFLAGS += \
- -Wl,--gc-sections
-
CONFIGURE_ARGS += \
--enable-shared \
--enable-static \
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
PKG_LICENSE:=GPL-2.0
+PKG_BUILD_FLAGS:=gc-sections
+
include $(INCLUDE_DIR)/package.mk
define Package/iw
endif
MAKE_FLAGS += \
- CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -ffunction-sections -fdata-sections" \
- LDFLAGS="$(TARGET_LDFLAGS) -Wl,--gc-sections -flto" \
+ CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS) -flto" \
NL1FOUND="" NL2FOUND=Y \
NLLIBNAME="libnl-tiny" \
LIBS="-lm -lnl-tiny" \
PKG_CPE_ID:=cpe:/a:tcpdump:tcpdump
PKG_INSTALL:=1
+PKG_BUILD_FLAGS:=gc-sections
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
--without-crypto \
$(call autoconf_bool,CONFIG_IPV6,ipv6)
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
ifeq ($(BUILD_VARIANT),mini)
TARGET_CFLAGS += -DTCPDUMP_MINI
CONFIGURE_ARGS += --disable-smb
PKG_LICENSE_FILES:=
PKG_FLAGS:=nonshared
+PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
endef
TARGET_CFLAGS += \
- -I$(STAGING_DIR)/usr/include -ffunction-sections -fdata-sections
-
-TARGET_LDFLAGS += -Wl,--gc-sections
+ -I$(STAGING_DIR)/usr/include
define Package/umbim/install
$(INSTALL_DIR) $(1)/sbin
PKG_LICENSE_FILES:=
PKG_FLAGS:=nonshared
+PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include \
- -ffunction-sections \
- -fdata-sections \
-Wno-error=dangling-pointer \
-Wno-error=maybe-uninitialized
-TARGET_LDFLAGS += -Wl,--gc-sections
-
CMAKE_OPTIONS += \
-DDEBUG=1
HOST_BUILD_DEPENDS:=libubox/host
+PKG_BUILD_FLAGS:=gc-sections
+
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/cmake.mk
/etc/opkg/customfeeds.conf
endef
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
EXTRA_CFLAGS += $(TARGET_CPPFLAGS)
CMAKE_OPTIONS += \
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
DEPENDS:= +e2fsprogs
endef
-TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto
+TARGET_CFLAGS += $(FPIC) -flto
TARGET_LDFLAGS += -flto
V=$(if $(findstring c,$(OPENWRT_VERBOSE)),1,) \
subst
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
- LDFLAGS=-Wl,--gc-sections \
BUILDCC="$(HOSTCC)" \
DESTDIR="$(PKG_INSTALL_DIR)" \
ELF_OTHER_LIBS="$(TARGET_LDFLAGS) -luuid" \
PKG_CPE_ID:=cpe:/a:mdadm_project:mdadm
PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=gc-sections
include $(INCLUDE_DIR)/package.mk
endef
TARGET_CFLAGS += \
- -ffunction-sections -fdata-sections \
-DHAVE_STDINT_H -DNO_COROSYNC -DNO_DLM -DUSE_PTHREADS \
-DCONFFILE='\"/var/etc/mdadm.conf\"' \
-DMAP_DIR='\"/var/run/mdadm\"' \
TARGET_CXFLAGS = -DNO_LIBUDEV
-TARGET_LDFLAGS += -Wl,--gc-sections
-
MAKE_FLAGS += \
CHECK_RUN_DIR=0 \
CXFLAGS="$(TARGET_CXFLAGS)"
PKG_FIXUP:=autoreconf
PKG_FLAGS:=nonshared
+PKG_BUILD_FLAGS:=gc-sections
PKG_BUILD_DEPENDS:=util-linux
--without-zstd \
--without-lzo
-TARGET_CFLAGS += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
-
define Package/ubi-utils/install
$(INSTALL_DIR) $(1)/usr/sbin
$(INSTALL_BIN) \