summaryrefslogtreecommitdiff
path: root/utils
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 /utils
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 'utils')
-rw-r--r--utils/acpid/Makefile5
-rw-r--r--utils/bluez/Makefile4
-rw-r--r--utils/btrfs-progs/Makefile4
-rw-r--r--utils/dump1090/Makefile5
-rw-r--r--utils/gptfdisk/Makefile5
-rw-r--r--utils/readsb/Makefile5
-rw-r--r--utils/zsh/Makefile5
7 files changed, 19 insertions, 14 deletions
diff --git a/utils/acpid/Makefile b/utils/acpid/Makefile
index 9328cbd7e..ec1d41c8a 100644
--- a/utils/acpid/Makefile
+++ b/utils/acpid/Makefile
@@ -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
diff --git a/utils/bluez/Makefile b/utils/bluez/Makefile
index c585593cc..bee4e79a9 100644
--- a/utils/bluez/Makefile
+++ b/utils/bluez/Makefile
@@ -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 \
diff --git a/utils/btrfs-progs/Makefile b/utils/btrfs-progs/Makefile
index 0db5d69ca..8e6f306cf 100644
--- a/utils/btrfs-progs/Makefile
+++ b/utils/btrfs-progs/Makefile
@@ -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)
diff --git a/utils/dump1090/Makefile b/utils/dump1090/Makefile
index 26ec46b16..2f37cd06d 100644
--- a/utils/dump1090/Makefile
+++ b/utils/dump1090/Makefile
@@ -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
diff --git a/utils/gptfdisk/Makefile b/utils/gptfdisk/Makefile
index 68badcc14..7295b6f6c 100644
--- a/utils/gptfdisk/Makefile
+++ b/utils/gptfdisk/Makefile
@@ -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
diff --git a/utils/readsb/Makefile b/utils/readsb/Makefile
index e9ed05bde..47b966728 100644
--- a/utils/readsb/Makefile
+++ b/utils/readsb/Makefile
@@ -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
diff --git a/utils/zsh/Makefile b/utils/zsh/Makefile
index 8a95c1511..9ab461df7 100644
--- a/utils/zsh/Makefile
+++ b/utils/zsh/Makefile
@@ -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