diff options
| author | Andre Heider <a.heider@gmail.com> | 2023-03-23 09:09:13 +0100 |
|---|---|---|
| committer | Andre Heider <a.heider@gmail.com> | 2023-04-08 08:38:54 +0200 |
| commit | 35f4ef76e0c88b690ec55f26aed072c4c5989eff (patch) | |
| tree | c5b36bb3b16488c4546c3c283b8a6020e3966143 /libs | |
| parent | 565866a47210c9711c29173052063779b6d3bcfc (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 'libs')
| -rw-r--r-- | libs/boost/Makefile | 6 | ||||
| -rw-r--r-- | libs/giflib/Makefile | 5 | ||||
| -rw-r--r-- | libs/glib2/Makefile | 4 | ||||
| -rw-r--r-- | libs/libdcwproto/Makefile | 5 | ||||
| -rw-r--r-- | libs/libdcwsocket/Makefile | 5 | ||||
| -rw-r--r-- | libs/libmbim/Makefile | 5 | ||||
| -rw-r--r-- | libs/libqmi/Makefile | 5 | ||||
| -rw-r--r-- | libs/libqrtr-glib/Makefile | 5 | ||||
| -rw-r--r-- | libs/libtasn1/Makefile | 3 | ||||
| -rw-r--r-- | libs/libtins/Makefile | 5 |
10 files changed, 26 insertions, 22 deletions
diff --git a/libs/boost/Makefile b/libs/boost/Makefile index bf72531fb..cb92e27a4 100644 --- a/libs/boost/Makefile +++ b/libs/boost/Makefile @@ -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 diff --git a/libs/giflib/Makefile b/libs/giflib/Makefile index 2f8eb4c53..a6174e982 100644 --- a/libs/giflib/Makefile +++ b/libs/giflib/Makefile @@ -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)" \ diff --git a/libs/glib2/Makefile b/libs/glib2/Makefile index 5493e5e69..226242dc5 100644 --- a/libs/glib2/Makefile +++ b/libs/glib2/Makefile @@ -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 \ diff --git a/libs/libdcwproto/Makefile b/libs/libdcwproto/Makefile index 37905b854..caaec8f79 100644 --- a/libs/libdcwproto/Makefile +++ b/libs/libdcwproto/Makefile @@ -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 diff --git a/libs/libdcwsocket/Makefile b/libs/libdcwsocket/Makefile index 28176a8ec..dc3bf3f1e 100644 --- a/libs/libdcwsocket/Makefile +++ b/libs/libdcwsocket/Makefile @@ -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 diff --git a/libs/libmbim/Makefile b/libs/libmbim/Makefile index 8591b4337..0d74b542e 100644 --- a/libs/libmbim/Makefile +++ b/libs/libmbim/Makefile @@ -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 \ diff --git a/libs/libqmi/Makefile b/libs/libqmi/Makefile index 8dac95155..21a7af1fc 100644 --- a/libs/libqmi/Makefile +++ b/libs/libqmi/Makefile @@ -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" diff --git a/libs/libqrtr-glib/Makefile b/libs/libqrtr-glib/Makefile index b5fabf31b..1796627a8 100644 --- a/libs/libqrtr-glib/Makefile +++ b/libs/libqrtr-glib/Makefile @@ -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 diff --git a/libs/libtasn1/Makefile b/libs/libtasn1/Makefile index b97a9cdbc..7e70b2212 100644 --- a/libs/libtasn1/Makefile +++ b/libs/libtasn1/Makefile @@ -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 \ diff --git a/libs/libtins/Makefile b/libs/libtins/Makefile index 11b7c2f11..644eecdbf 100644 --- a/libs/libtins/Makefile +++ b/libs/libtins/Makefile @@ -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 |
