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>
This commit is contained in:
Andre Heider 2023-03-23 09:09:13 +01:00
parent 565866a472
commit 35f4ef76e0
46 changed files with 118 additions and 110 deletions

View 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 \

View 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

View 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

View 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

View 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)" \

View 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 \

View 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

View 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

View 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 \

View 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"

View 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

View 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 \

View 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

View 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

View 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 \

View 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/

View 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

View 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

View 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 \

View 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

View 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

View 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)" \

View 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

View 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

View 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

View 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

View 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

View 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"

View 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

View 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

View 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

View 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 \

View 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 \

View 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) \

View 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:=:

View 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" \

View 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 \

View 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

View 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

View 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

View 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 \

View 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)

View 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

View 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

View 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

View 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