From e7d9c865036d7bc2ac30604e8573f25ae601aed1 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Thu, 23 Mar 2023 09:27:01 +0100 Subject: [PATCH] treewide: refactor to use PKG_BUILD_FLAGS:=lto See commit 07730ff3 "treewide: add support for "lto" in PKG_BUILD_FLAGS" on the main repository. Note: Some packages only added `-flto` to CFLAGS and not LDFLAGS. This fixes it and properly enables LTO. Signed-off-by: Andre Heider --- libs/boost/Makefile | 4 ++-- libs/libcap-ng/Makefile | 2 +- libs/libdcwproto/Makefile | 3 +-- libs/libdcwsocket/Makefile | 4 ++-- libs/libgd/Makefile | 4 +++- libs/libnpupnp/Makefile | 4 +--- libs/libplist/Makefile | 2 +- libs/libtins/Makefile | 3 +-- libs/libv4l/Makefile | 3 +-- libs/libwebp/Makefile | 3 +-- libs/log4cplus/Makefile | 2 +- libs/minizip/Makefile | 4 ++-- libs/nspr/Makefile | 2 +- libs/qrencode/Makefile | 3 ++- libs/sbc/Makefile | 4 +--- libs/taglib/Makefile | 4 ++-- mail/emailrelay/Makefile | 3 +-- multimedia/graphicsmagick/Makefile | 3 +-- multimedia/imagemagick/Makefile | 4 +--- multimedia/ttymidi-sysex/Makefile | 2 +- multimedia/v4l2rtspserver/Makefile | 3 +-- net/aria2/Makefile | 5 +---- net/chrony/Makefile | 4 +--- net/cifs-utils/Makefile | 3 ++- net/clamav/Makefile | 4 ++-- net/dcstad/Makefile | 4 +--- net/dcwapd/Makefile | 4 ++-- net/foolsm/Makefile | 3 +-- net/frr/Makefile | 3 +-- net/iperf/Makefile | 4 ++-- net/libreswan/Makefile | 2 +- net/microsocks/Makefile | 5 +++-- net/mosh/Makefile | 4 ++-- net/mrmctl/Makefile | 4 ++-- net/nfdump/Makefile | 2 +- net/open-iscsi/Makefile | 3 ++- net/open-isns/Makefile | 3 ++- net/openvswitch/Makefile | 4 ++-- net/ovn/Makefile | 4 ++-- net/shadowsocks-libev/Makefile | 3 +-- net/tor/Makefile | 7 ++----- net/transmission/Makefile | 4 ++-- sound/espeak/Makefile | 4 ++-- utils/acpid/Makefile | 3 +-- utils/ap51-flash/Makefile | 3 ++- utils/coremark/Makefile | 4 +--- utils/domoticz/Makefile | 5 ++--- utils/dump1090/Makefile | 3 +-- utils/gptfdisk/Makefile | 4 ++-- utils/readsb/Makefile | 3 +-- utils/smartmontools/Makefile | 5 ++--- utils/unrar/Makefile | 3 ++- utils/xz/Makefile | 3 ++- utils/zsh/Makefile | 6 +++--- 54 files changed, 84 insertions(+), 107 deletions(-) diff --git a/libs/boost/Makefile b/libs/boost/Makefile index cb92e27a46..295e4b2436 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 gc-sections +PKG_BUILD_FLAGS:=no-mips16 gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -382,7 +382,7 @@ CONFIGURE_PREFIX:=$(PKG_INSTALL_DIR) TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--as-needed,--print-gc-sections TARGET_CFLAGS += \ - $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -flto + $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC ifeq ($(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION)))),5) EXTRA_CXXFLAGS += -std=gnu++14 diff --git a/libs/libcap-ng/Makefile b/libs/libcap-ng/Makefile index b8d12ff04f..ab3c6272aa 100644 --- a/libs/libcap-ng/Makefile +++ b/libs/libcap-ng/Makefile @@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=License PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -54,7 +55,6 @@ define Package/libcap-ng-bin/description endef TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed $(FPIC) -TARGET_CFLAGS += -flto CONFIGURE_VARS += \ ac_cv_prog_swig_found=no diff --git a/libs/libdcwproto/Makefile b/libs/libdcwproto/Makefile index caaec8f79d..4ac94d7b17 100644 --- a/libs/libdcwproto/Makefile +++ b/libs/libdcwproto/Makefile @@ -21,7 +21,7 @@ PKG_LICENSE_FILES:=COPYING PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -38,7 +38,6 @@ define Package/libdcwproto/description Platform-independent C library for marshaling and serializing DCW messages endef -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--as-needed define Build/InstallDev diff --git a/libs/libdcwsocket/Makefile b/libs/libdcwsocket/Makefile index dc3bf3f1eb..6024192330 100644 --- a/libs/libdcwsocket/Makefile +++ b/libs/libdcwsocket/Makefile @@ -22,7 +22,7 @@ PKG_LICENSE_FILES:=COPYING PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -38,7 +38,7 @@ define Package/libdcwsocket/description User-land C library for sending and receiving DCW "EtherType"d messages endef -TARGET_CFLAGS += -std=c89 -flto +TARGET_CFLAGS += -std=c89 TARGET_LDFLAGS += -Wl,--as-needed define Build/InstallDev diff --git a/libs/libgd/Makefile b/libs/libgd/Makefile index 9e0108915a..750733fecd 100644 --- a/libs/libgd/Makefile +++ b/libs/libgd/Makefile @@ -20,6 +20,8 @@ PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:libgd:libgd +PKG_BUILD_FLAGS:=lto + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -77,7 +79,7 @@ define Package/libgd/config endif endef -TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections -flto +TARGET_CFLAGS += $(FPIC) -ffunction-sections -fdata-sections CMAKE_OPTIONS += \ -DENABLE_FONTCONFIG=OFF \ diff --git a/libs/libnpupnp/Makefile b/libs/libnpupnp/Makefile index dcfa513776..9eb961af8f 100644 --- a/libs/libnpupnp/Makefile +++ b/libs/libnpupnp/Makefile @@ -15,6 +15,7 @@ PKG_LICENSE_FILES:=COPYING PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=libmicrohttpd +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -32,9 +33,6 @@ venerable pupnp (https://github.com/pupnp/pupnp), based on its 1.6.x branch (around 1.6.25). endef -TARGET_CFLAGS += -flto -TARGET_LDFLAGS += -flto - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/npupnp $(CP) $(PKG_INSTALL_DIR)/usr/include/npupnp/* $(1)/usr/include/npupnp/ diff --git a/libs/libplist/Makefile b/libs/libplist/Makefile index d5cbc0e943..eb8265b1b8 100644 --- a/libs/libplist/Makefile +++ b/libs/libplist/Makefile @@ -20,6 +20,7 @@ PKG_CPE_ID:=cpe:/a:libimobiledevice:libplist PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -66,7 +67,6 @@ CONFIGURE_ARGS += \ --disable-static \ --without-cython -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--gc-sections define Build/InstallDev diff --git a/libs/libtins/Makefile b/libs/libtins/Makefile index 644eecdbf3..b9bf273220 100644 --- a/libs/libtins/Makefile +++ b/libs/libtins/Makefile @@ -20,7 +20,7 @@ PKG_LICENSE:=BSD-2-Clause PKG_LICENSE_FILES:=LICENSE CMAKE_INSTALL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -53,7 +53,6 @@ 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 += -flto TARGET_LDFLAGS += -Wl,--as-needed define Package/libtins/install diff --git a/libs/libv4l/Makefile b/libs/libv4l/Makefile index fa577da2e7..9e60a2b3e7 100644 --- a/libs/libv4l/Makefile +++ b/libs/libv4l/Makefile @@ -15,7 +15,7 @@ PKG_HASH:=65c6fbe830a44ca105c443b027182c1b2c9053a91d1e72ad849dfab388b94e31 PKG_MAINTAINER:=Ted Hess -PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_FLAGS:=no-mips16 lto PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 @@ -73,7 +73,6 @@ define Package/v4l-utils/description This package contains the video4linux utilities. endef -TARGET_CFLAGS += -flto TARGET_LDFLAGS += \ $(if $(CONFIG_USE_GLIBC),,-largp) \ -Wl,--gc-sections,--as-needed diff --git a/libs/libwebp/Makefile b/libs/libwebp/Makefile index a58062f359..d16bc752af 100644 --- a/libs/libwebp/Makefile +++ b/libs/libwebp/Makefile @@ -13,6 +13,7 @@ PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=COPYING CMAKE_INSTALL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -46,8 +47,6 @@ CMAKE_OPTIONS += -DWEBP_ENABLE_SIMD=OFF endif endif -TARGET_CFLAGS += -flto - define Package/libwebp/install $(INSTALL_DIR) $(1)/usr/lib $(CP) $(PKG_INSTALL_DIR)/usr/lib/lib*.s* $(1)/usr/lib/ diff --git a/libs/log4cplus/Makefile b/libs/log4cplus/Makefile index accfeb5fa3..c4e103fd2b 100644 --- a/libs/log4cplus/Makefile +++ b/libs/log4cplus/Makefile @@ -21,6 +21,7 @@ PKG_LICENSE:=BSD-2-Clause Apache-2.0 PKG_LICENSE_FILES:=LICENSE CMAKE_INSTALL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk @@ -50,7 +51,6 @@ OPTIONS:= \ CMAKE_HOST_OPTIONS += $(OPTIONS) -DBUILD_SHARED_LIBS=OFF CMAKE_OPTIONS += $(OPTIONS) -DBUILD_SHARED_LIBS=ON -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed define Package/log4cplus/install diff --git a/libs/minizip/Makefile b/libs/minizip/Makefile index 8e4ee216b5..e38ed167c6 100644 --- a/libs/minizip/Makefile +++ b/libs/minizip/Makefile @@ -18,6 +18,8 @@ PKG_MAINTAINER:=David Woodhouse PKG_LICENSE:=Zlib PKG_LICENSE_FILES:=LICENSE +PKG_BUILD_FLAGS:=lto + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -59,8 +61,6 @@ define Package/minizip/install $(CP) $(PKG_INSTALL_DIR)/usr/lib/libminizip.so.* $(1)/usr/lib/ endef -TARGET_CXXFLAGS += -flto - define Build/InstallDev $(call Build/InstallDev/cmake,$(1)) $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/minizip.pc diff --git a/libs/nspr/Makefile b/libs/nspr/Makefile index 355322b74d..4315c42e04 100644 --- a/libs/nspr/Makefile +++ b/libs/nspr/Makefile @@ -21,6 +21,7 @@ PKG_HASH:=7ea3297ea5969b5d25a5dd8d47f2443cda88e9ee746301f6e1e1426f8a6abc8f PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 PKG_FIXUP:=autoreconf +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -35,7 +36,6 @@ endif export MUSL=$(if $(CONFIG_LIBC_USE_GLIBC),0,1) TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed $(FPIC) -TARGET_CFLAGS += -flto CONFIGURE_ARGS += \ --build=$(GNU_HOST_NAME) \ diff --git a/libs/qrencode/Makefile b/libs/qrencode/Makefile index 8411284803..ee1f925b1f 100644 --- a/libs/qrencode/Makefile +++ b/libs/qrencode/Makefile @@ -21,6 +21,8 @@ PKG_LICENSE_FILES:=COPYING PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_qrencode +PKG_BUILD_FLAGS:=lto + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -60,7 +62,6 @@ CMAKE_OPTIONS += \ -DWITH_TESTS=OFF \ -DBUILD_SHARED_LIBS=ON -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--gc-sections define Build/InstallDev diff --git a/libs/sbc/Makefile b/libs/sbc/Makefile index ca5b8488f0..fd147174a9 100644 --- a/libs/sbc/Makefile +++ b/libs/sbc/Makefile @@ -22,6 +22,7 @@ PKG_MAINTAINER:= PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -38,9 +39,6 @@ define Package/sbc/description Needed for A2DP support. endef -TARGET_CFLAGS += -flto -TARGET_LDFLAGS += -flto - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include/sbc $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/sbc/sbc.h $(1)/usr/include/sbc/ diff --git a/libs/taglib/Makefile b/libs/taglib/Makefile index 78decddcf2..f75c397352 100644 --- a/libs/taglib/Makefile +++ b/libs/taglib/Makefile @@ -18,6 +18,8 @@ PKG_LICENSE:=LGPL-2.1-or-later PKG_LICENSE_FILES:=COPYING.LGPL PKG_CPE_ID:=cpe:/a:taglib:taglib +PKG_BUILD_FLAGS:=lto + include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -43,8 +45,6 @@ CMAKE_OPTIONS += \ -DBUILD_BINDINGS=OFF \ -DNO_ITUNES_HACKS=ON -TARGET_CXXFLAGS += -flto - define Build/InstallDev $(call Build/InstallDev/cmake,$(1)) $(SED) '/^prefix=\|^exec_prefix=/s|/usr|$(STAGING_DIR)/usr|' $(1)/usr/bin/taglib-config diff --git a/mail/emailrelay/Makefile b/mail/emailrelay/Makefile index 5b9704257e..280a3de5e1 100644 --- a/mail/emailrelay/Makefile +++ b/mail/emailrelay/Makefile @@ -20,7 +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 +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -95,7 +95,6 @@ ifeq ($(CONFIG_EMAILRELAY_SUPPORT_VERBOSE_DBG),y) --enable-debug=yes endif -TARGET_CXXFLAGS += -flto TARGET_CXXFLAGS += -Wl,--as-needed define Package/emailrelay/install diff --git a/multimedia/graphicsmagick/Makefile b/multimedia/graphicsmagick/Makefile index 70a3408641..0de3060d66 100644 --- a/multimedia/graphicsmagick/Makefile +++ b/multimedia/graphicsmagick/Makefile @@ -21,6 +21,7 @@ PKG_CPE_ID:=cpe:/a:graphicsmagick:graphicsmagick PKG_BUILD_PARALLEL:=1 DISABLE_NLS:= PKG_BUILD_DEPENDS:=zlib freetype libpng libjpeg-turbo tiff +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -73,8 +74,6 @@ CONFIGURE_ARGS += \ --without-zstd \ --without-x -TARGET_CFLAGS += $(if $(filter-out 5 6 7 8 9,$(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION))))),,-flto) - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) \ diff --git a/multimedia/imagemagick/Makefile b/multimedia/imagemagick/Makefile index 59dbe0bb37..4f0a976ab4 100644 --- a/multimedia/imagemagick/Makefile +++ b/multimedia/imagemagick/Makefile @@ -21,7 +21,7 @@ PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE PKG_CPE_ID:=cpe:/a:imagemagick:imagemagick -PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_FLAGS:=no-mips16 lto PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk @@ -110,8 +110,6 @@ CONFIGURE_ARGS += \ --with-png \ --with-tiff -TARGET_CFLAGS += $(if $(filter-out 5 6 7 8 9,$(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION))))),,-flto) - define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) \ diff --git a/multimedia/ttymidi-sysex/Makefile b/multimedia/ttymidi-sysex/Makefile index 7839e78330..7f4fb84267 100644 --- a/multimedia/ttymidi-sysex/Makefile +++ b/multimedia/ttymidi-sysex/Makefile @@ -12,6 +12,7 @@ PKG_MIRROR_HASH:=8d6bb738a08a65c25fcc442777750abbee812a24a29236242032e2d76177454 PKG_LICENSE:=GPL-3.0-or-later PKG_MAINTAINER:=Daniel Golle PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -30,7 +31,6 @@ ttymidi was to make Arduino boards talk to MIDI applications without the need to use (or build) any extra hardware. endef -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -lasound -Wl,--gc-sections,--as-needed define Build/Configure diff --git a/multimedia/v4l2rtspserver/Makefile b/multimedia/v4l2rtspserver/Makefile index f93d0647e9..aee5cdce7e 100644 --- a/multimedia/v4l2rtspserver/Makefile +++ b/multimedia/v4l2rtspserver/Makefile @@ -16,7 +16,7 @@ PKG_SOURCE_URL:=https://github.com/mpromonet/v4l2rtspserver PKG_SOURCE_VERSION:=v$(PKG_VERSION) PKG_MIRROR_HASH:=f2eca75c8af9933f4ceb67cab74af488e1e9ec8af9cbef2534fda5b701b1d63d -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto LIVE555_VERSION:=2022.10.01 LIVE555_HASH:=429de73061e3fc6901c4d2f0b7562ae3f6233060ca4b5e182fe555d065cbdd45 @@ -51,7 +51,6 @@ define Download/live555 HASH:=$(LIVE555_HASH) endef -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--as-needed CMAKE_OPTIONS += \ diff --git a/net/aria2/Makefile b/net/aria2/Makefile index 5004eff422..af441bf526 100644 --- a/net/aria2/Makefile +++ b/net/aria2/Makefile @@ -15,7 +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_BUILD_FLAGS:=gc-sections lto PKG_MAINTAINER:=Imre Kaloz , \ Hsing-Wang Liao @@ -84,9 +84,6 @@ CONFIGURE_ARGS += \ --without-libuv \ --with-libz -TARGET_CXXFLAGS += -flto -TARGET_LDFLAGS += -flto - define Package/aria2/conffiles /etc/config/aria2 endef diff --git a/net/chrony/Makefile b/net/chrony/Makefile index bf233f3474..f4c277b75b 100644 --- a/net/chrony/Makefile +++ b/net/chrony/Makefile @@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:tuxfamily:chrony PKG_BUILD_DEPENDS:=pps-tools +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -79,9 +80,6 @@ CONFIGURE_ARGS+= \ CONFIGURE_VARS+=CPPFLAGS=-DNDEBUG -TARGET_CFLAGS += -flto -TARGET_LDFLAGS += -flto - define Package/chrony/install $(INSTALL_DIR) $(1)/usr/bin/ $(INSTALL_DIR) $(1)/usr/sbin/ diff --git a/net/cifs-utils/Makefile b/net/cifs-utils/Makefile index 0662315ba8..fcc4b47738 100644 --- a/net/cifs-utils/Makefile +++ b/net/cifs-utils/Makefile @@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:samba:cifs-utils PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -57,7 +58,7 @@ CONFIGURE_ARGS += \ CONFIGURE_ARGS += \ ac_cv_lib_cap_ng_capng_clear=no -TARGET_CFLAGS += $(FPIC) -ffunction-sections -flto +TARGET_CFLAGS += $(FPIC) -ffunction-sections TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed define Build/InstallDev diff --git a/net/clamav/Makefile b/net/clamav/Makefile index 8d6e7676fd..035d91fc3d 100644 --- a/net/clamav/Makefile +++ b/net/clamav/Makefile @@ -22,7 +22,7 @@ PKG_LICENSE_FILES:=COPYING* PKG_CPE_ID:=cpe:/a:clamav:clamav PKG_BUILD_DEPENDS:=ncurses -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk @@ -73,7 +73,7 @@ CMAKE_OPTIONS += \ -DENABLE_SYSTEMD=OFF \ -DHAVE_SYSTEM_LFS_FTS=O$(if $(CONFIG_USE_GLIBC),N,FF) -TARGET_CXXFLAGS += -fno-rtti -flto +TARGET_CXXFLAGS += -fno-rtti TARGET_LDFLAGS += -Wl,--as-needed define Package/clamav/conffiles diff --git a/net/dcstad/Makefile b/net/dcstad/Makefile index bd07a8e4a4..12da6fdca9 100644 --- a/net/dcstad/Makefile +++ b/net/dcstad/Makefile @@ -22,7 +22,7 @@ PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -39,8 +39,6 @@ define Package/dcstad/description Implementation of the Dual-Channel WiFi client daemon endef -TARGET_CFLAGS += -flto - define Package/dcstad/install $(INSTALL_DIR) $(1)/bin $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/dcstad $(1)/bin/ diff --git a/net/dcwapd/Makefile b/net/dcwapd/Makefile index 34e2861af8..28a9698db9 100644 --- a/net/dcwapd/Makefile +++ b/net/dcwapd/Makefile @@ -22,7 +22,7 @@ PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -43,7 +43,7 @@ CONFIGURE_ARGS += \ --enable-platform=linuxjsonstatic \ --enable-shared -TARGET_CXXFLAGS += -std=c++11 -DRAPIDJSON_HAS_CXX11_RVALUE_REFS=0 -flto +TARGET_CXXFLAGS += -std=c++11 -DRAPIDJSON_HAS_CXX11_RVALUE_REFS=0 TARGET_LDFLAGS += -ldcwproto -ldcwsocket -lmrmfilterparser -luci -Wl,--as-needed define Build/InstallDev diff --git a/net/foolsm/Makefile b/net/foolsm/Makefile index 0cbe3f2472..1badaed193 100644 --- a/net/foolsm/Makefile +++ b/net/foolsm/Makefile @@ -20,7 +20,7 @@ PKG_LICENSE:=GPL-2.0-only PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -44,7 +44,6 @@ endef MAKE_FLAGS += \ PREFIX="$(CONFIGURE_PREFIX)" -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--as-needed define Package/foolsm/install diff --git a/net/frr/Makefile b/net/frr/Makefile index 997b554012..0f9f7fba81 100644 --- a/net/frr/Makefile +++ b/net/frr/Makefile @@ -15,7 +15,6 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz PKG_SOURCE_VERSION:=410d78b7a4f2c8b4d4c3736c6d6cdb710287ca80 PKG_SOURCE_URL:=https://codeload.github.com/FRRouting/frr/tar.gz/$(PKG_SOURCE_VERSION)? - PKG_HASH:=1334b050ea3d4144efeb7bdfe9c6976ebc91744810c5d8a7381a53fac2877ea9 PKG_MAINTAINER:=Lucian Cristian @@ -58,6 +57,7 @@ PKG_CONFIG_DEPENDS:= \ PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 +PKG_BUILD_FLAGS:=lto PKG_BUILD_DEPENDS:=frr/host HOST_BUILD_DEPENDS:=python3/host @@ -166,7 +166,6 @@ define Package/frr-libfrr/conffiles endef TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -latomic -TARGET_CFLAGS += -flto define Host/Configure $(Host/Configure/Default) diff --git a/net/iperf/Makefile b/net/iperf/Makefile index 3c320bff70..3e13a04a2d 100644 --- a/net/iperf/Makefile +++ b/net/iperf/Makefile @@ -19,6 +19,7 @@ PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=BSD-3-Clause PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=lto PKG_CONFIG_DEPENDS:=CONFIG_IPERF_ENABLE_MULTICAST @@ -49,8 +50,7 @@ CONFIGURE_ARGS += \ $(call autoconf_bool,CONFIG_IPERF_ENABLE_MULTICAST,multicast) \ $(call autoconf_bool,CONFIG_IPV6,ipv6) -TARGET_CFLAGS += -flto -TARGET_CXXFLAGS += -fno-rtti -static-libstdc++ -flto -std=c++11 +TARGET_CXXFLAGS += -fno-rtti -static-libstdc++ -std=c++11 TARGET_LDFLAGS += $(if $(CONFIG_USE_GLIBC),-lpthread -lm) define Package/iperf/install diff --git a/net/libreswan/Makefile b/net/libreswan/Makefile index cbbb33cadf..6a8329b83e 100644 --- a/net/libreswan/Makefile +++ b/net/libreswan/Makefile @@ -21,6 +21,7 @@ PKG_CPE_ID:=cpe:/a:libreswan:libreswan PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -65,7 +66,6 @@ define Package/libreswan/conffiles /etc/ipsec.secrets endef TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed -TARGET_CFLAGS += -flto MAKE_FLAGS+= \ WERROR_CFLAGS=" " \ diff --git a/net/microsocks/Makefile b/net/microsocks/Makefile index e16e577b36..82abec56ac 100644 --- a/net/microsocks/Makefile +++ b/net/microsocks/Makefile @@ -12,6 +12,8 @@ PKG_MAINTAINER:=Mateusz Korniak PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING +PKG_BUILD_FLAGS:=lto + include $(INCLUDE_DIR)/package.mk define Package/microsocks @@ -30,8 +32,7 @@ define Package/microsocks/conffiles /etc/config/microsocks endef -TARGET_CFLAGS+= -flto -TARGET_LDFLAGS+= -flto -Wl,--gc-sections,--as-needed +TARGET_LDFLAGS+= -Wl,--gc-sections,--as-needed define Package/microsocks/install $(INSTALL_DIR) $(1)/usr/bin diff --git a/net/mosh/Makefile b/net/mosh/Makefile index 53b8659f49..0b840f399d 100644 --- a/net/mosh/Makefile +++ b/net/mosh/Makefile @@ -22,7 +22,7 @@ PKG_LICENSE_FILES:=COPYING PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=protobuf/host -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -96,7 +96,7 @@ CONFIGURE_ARGS += \ CONFIGURE_VARS += \ ac_cv_have_decl_ffs=yes -TARGET_CXXFLAGS += -flto -std=c++11 +TARGET_CXXFLAGS += -std=c++11 TARGET_LDFLAGS += -lncurses define Package/mosh-client/install diff --git a/net/mrmctl/Makefile b/net/mrmctl/Makefile index 3fdf4cb861..44480bfdbc 100644 --- a/net/mrmctl/Makefile +++ b/net/mrmctl/Makefile @@ -22,7 +22,7 @@ PKG_LICENSE_FILES:=userland/COPYING PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -44,7 +44,7 @@ CONFIGURE_PATH:=userland CONFIGURE_ARGS += \ --enable-shared -TARGET_CFLAGS += -std=c89 -flto +TARGET_CFLAGS += -std=c89 TARGET_LDFLAGS += -Wl,--as-needed define Build/InstallDev diff --git a/net/nfdump/Makefile b/net/nfdump/Makefile index f1879b984d..0af7f2ad1c 100644 --- a/net/nfdump/Makefile +++ b/net/nfdump/Makefile @@ -20,6 +20,7 @@ PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -39,7 +40,6 @@ define Package/nfdump/conffiles /etc/config/nfcapd endef -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--as-needed $(if $(CONFIG_USE_MUSL),-lfts) define Package/nfdump/install diff --git a/net/open-iscsi/Makefile b/net/open-iscsi/Makefile index b7b7891bff..755c29cba6 100644 --- a/net/open-iscsi/Makefile +++ b/net/open-iscsi/Makefile @@ -17,6 +17,7 @@ PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_INSTALL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -58,7 +59,7 @@ define Build/Configure endef TARGET_CFLAGS += \ - $(FPIC) -flto \ + $(FPIC) \ -D_GNU_SOURCE -DNO_SYSTEMD TARGET_LDFLAGS += -lkmod diff --git a/net/open-isns/Makefile b/net/open-isns/Makefile index f2a0991e5a..6aaffa6c48 100644 --- a/net/open-isns/Makefile +++ b/net/open-isns/Makefile @@ -18,6 +18,7 @@ PKG_LICENSE_FILES:=COPYING PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -36,7 +37,7 @@ endef CONFIGURE_ARGS += \ --enable-shared -TARGET_CFLAGS += $(FPIC) -flto +TARGET_CFLAGS += $(FPIC) TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed define Build/InstallDev diff --git a/net/openvswitch/Makefile b/net/openvswitch/Makefile index 5106f60862..fa1fa5d344 100644 --- a/net/openvswitch/Makefile +++ b/net/openvswitch/Makefile @@ -28,7 +28,7 @@ PKG_CPE_ID:=cpe:/a:openvswitch:openvswitch PKG_BUILD_DIR:=$(ovs_builddir) PKG_BUILD_DEPENDS+=python3/host -PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_FLAGS:=no-mips16 lto PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -267,7 +267,7 @@ ifneq ($(ovs_intree_kmod_enabled),) endif endif -TARGET_CFLAGS += -flto -std=gnu99 +TARGET_CFLAGS += -std=gnu99 MAKE_VARS += PYTHONPATH="$(HOST_PYTHON3PATH)" export OVS_KERNEL_MAKE_FLAGS=$(KERNEL_MAKE_FLAGS) diff --git a/net/ovn/Makefile b/net/ovn/Makefile index 7c5afae928..999986f93a 100644 --- a/net/ovn/Makefile +++ b/net/ovn/Makefile @@ -23,7 +23,7 @@ PKG_CPE_ID:=cpe:/a:openvswitch:openvswitch PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) PKG_BUILD_DEPENDS+=python3/host -PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_FLAGS:=no-mips16 lto PKG_BUILD_PARALLEL:=1 PKG_FIXUP:=autoreconf PKG_INSTALL:=1 @@ -87,7 +87,7 @@ CONFIGURE_VARS += \ ovs_cv_python3=$(HOST_PYTHON3_BIN) \ -TARGET_CFLAGS += -flto -std=gnu99 +TARGET_CFLAGS += -std=gnu99 # This is needed otherwise libtool --mode=install libovn.la will fail with # "cannot find -lopenvswitch" when doing libtool --mode=relink. Likely this # was caused by libovn now depends on libopenvswitch.la (installed=no) since diff --git a/net/shadowsocks-libev/Makefile b/net/shadowsocks-libev/Makefile index 7bd094f74c..3642746e94 100644 --- a/net/shadowsocks-libev/Makefile +++ b/net/shadowsocks-libev/Makefile @@ -27,7 +27,7 @@ PKG_LICENSE_FILES:=LICENSE PKG_FIXUP:=autoreconf PKG_INSTALL:=1 -PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_FLAGS:=no-mips16 lto PKG_BUILD_PARALLEL:=1 PKG_BUILD_DEPENDS:=c-ares pcre @@ -120,7 +120,6 @@ CONFIGURE_ARGS += \ --disable-assert \ --disable-ssp \ -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed $(eval $(call BuildPackage,shadowsocks-libev-config)) diff --git a/net/tor/Makefile b/net/tor/Makefile index cd5946b46f..a8edb32278 100644 --- a/net/tor/Makefile +++ b/net/tor/Makefile @@ -23,7 +23,7 @@ PKG_CPE_ID:=cpe:/a:torproject:tor PKG_INSTALL:=1 PKG_FIXUP:=autoreconf PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -141,10 +141,7 @@ ifeq ($(BUILD_VARIANT),basic) endif -TARGET_CFLAGS += -flto \ - $(if $(CONFIG_OPENSSL_ENGINE),,-DDISABLE_ENGINES) - -TARGET_LDFLAGS += -flto +TARGET_CFLAGS += $(if $(CONFIG_OPENSSL_ENGINE),,-DDISABLE_ENGINES) CONFIGURE_VARS += \ CROSS_COMPILE="yes" \ diff --git a/net/transmission/Makefile b/net/transmission/Makefile index dc4244c092..7cec517942 100644 --- a/net/transmission/Makefile +++ b/net/transmission/Makefile @@ -23,7 +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_BUILD_FLAGS:=gc-sections lto PKG_CONFIG_DEPENDS:= \ CONFIG_LIBCURL_GNUTLS \ CONFIG_LIBCURL_MBEDTLS \ @@ -92,7 +92,7 @@ define Package/transmission-daemon/conffiles /etc/config/transmission endef -TARGET_CFLAGS += -flto -DHAVE_SIZE_T -latomic +TARGET_CFLAGS += -DHAVE_SIZE_T -latomic TARGET_LDFLAGS += -Wl,--as-needed CMAKE_OPTIONS += \ diff --git a/sound/espeak/Makefile b/sound/espeak/Makefile index bcd7686142..260b2c448e 100644 --- a/sound/espeak/Makefile +++ b/sound/espeak/Makefile @@ -20,7 +20,7 @@ PKG_LICENSE_FILES:=License.txt PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -51,7 +51,7 @@ MAKE_FLAGS+= \ MAKE_PATH:=./src -TARGET_CXXFLAGS += -std=c++14 -flto +TARGET_CXXFLAGS += -std=c++14 TARGET_LDFLAGS += $(FPIC) $(if $(CONFIG_USE_GLIBC),-lm) -Wl,--as-needed define Package/espeak/install diff --git a/utils/acpid/Makefile b/utils/acpid/Makefile index ec1d41c8a1..dc9421426d 100644 --- a/utils/acpid/Makefile +++ b/utils/acpid/Makefile @@ -22,7 +22,7 @@ PKG_CPE_ID:=cpe:/a:tedfelix:acpid PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -38,7 +38,6 @@ define Package/acpid/description The ACPI Daemon (acpid) With Netlink Support endef -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--as-needed define Package/acpid/install diff --git a/utils/ap51-flash/Makefile b/utils/ap51-flash/Makefile index 26eb1f0f1e..c7181205ef 100644 --- a/utils/ap51-flash/Makefile +++ b/utils/ap51-flash/Makefile @@ -18,6 +18,8 @@ PKG_MAINTAINER:=Russell Senior PKG_LICENSE:=GPL-3.0-or-later CC0-1.0 PKG_LICENSE_FILES:=LICENSES/GPL-3.0-or-later.txt LICENSES/CC0-1.0.txt +PKG_BUILD_FLAGS:=lto + include $(INCLUDE_DIR)/package.mk define Package/ap51-flash @@ -32,7 +34,6 @@ MAKE_FLAGS += \ REVISION="$(PKG_VERSION)" \ ap51-flash -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed define Package/ap51-flash/install diff --git a/utils/coremark/Makefile b/utils/coremark/Makefile index aead11c668..06a05c8753 100644 --- a/utils/coremark/Makefile +++ b/utils/coremark/Makefile @@ -22,7 +22,7 @@ PKG_MAINTAINER:=Lim Guo Wei \ PKG_LICENSE:=Apache-2.0 PKG_LICENSE_FILES:=LICENSE.md -PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_FLAGS:=no-mips16 lto include $(INCLUDE_DIR)/package.mk @@ -60,8 +60,6 @@ define Package/coremark/config Number of threads to run in parallel endef -TARGET_CFLAGS += -flto - ifeq ($(CONFIG_COREMARK_OPTIMIZE_O3),y) TARGET_CFLAGS := $(filter-out -O%,$(TARGET_CFLAGS)) -O3 endif diff --git a/utils/domoticz/Makefile b/utils/domoticz/Makefile index a480caae05..c1a2b02696 100644 --- a/utils/domoticz/Makefile +++ b/utils/domoticz/Makefile @@ -20,7 +20,7 @@ PKG_LICENSE:=GPL-3.0 PKG_LICENSE_FILES:=License.txt PKG_BUILD_DEPENDS:=python3 minizip cereal -PKG_BUILD_FLAGS:=no-mips16 +PKG_BUILD_FLAGS:=no-mips16 lto include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk @@ -73,8 +73,7 @@ CMAKE_OPTIONS += \ -DUSE_PYTHON=yes \ -DWITH_LIBUSB=no -TARGET_CFLAGS += -flto -TARGET_CXXFLAGS += -DWITH_GPIO -flto +TARGET_CXXFLAGS += -DWITH_GPIO define Build/Prepare $(call Build/Prepare/Default) diff --git a/utils/dump1090/Makefile b/utils/dump1090/Makefile index 2f37cd06d9..ad3fbac360 100644 --- a/utils/dump1090/Makefile +++ b/utils/dump1090/Makefile @@ -21,7 +21,7 @@ PKG_LICENSE_FILES:=COPYING LICENSE PKG_BUILD_DEPENDS:=libusb PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -57,7 +57,6 @@ MAKE_FLAGS += \ CFLAGS="$(TARGET_CFLAGS)" \ UNAME="Linux" -TARGET_CFLAGS += -flto TARGET_LDFLAGS += -Wl,--as-needed define Package/dump1090/conffiles diff --git a/utils/gptfdisk/Makefile b/utils/gptfdisk/Makefile index 7295b6f6c0..f466377cf9 100644 --- a/utils/gptfdisk/Makefile +++ b/utils/gptfdisk/Makefile @@ -20,7 +20,7 @@ PKG_LICENSE:=GPL-2.0-or-later PKG_LICENSE_FILES:=COPYING PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -73,7 +73,7 @@ define Package/fixparts/description Master Boot Record (MBR) partition tables endef -TARGET_CXXFLAGS += -std=c++11 -fno-rtti -flto -Wno-format-security +TARGET_CXXFLAGS += -std=c++11 -fno-rtti -Wno-format-security TARGET_LDFLAGS += -Wl,--as-needed define Package/gdisk/install diff --git a/utils/readsb/Makefile b/utils/readsb/Makefile index 47b9667282..844fc0d51e 100644 --- a/utils/readsb/Makefile +++ b/utils/readsb/Makefile @@ -20,7 +20,7 @@ PKG_MAINTAINER:=Stijn Tintel PKG_BUILD_DEPENDS:=!USE_GLIBC:argp-standalone PKG_BUILD_PARALLEL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -49,7 +49,6 @@ MAKE_FLAGS += \ RTLSDR=yes \ UNAME="Linux" -TARGET_CFLAGS += -flto TARGET_LDFLAGS += \ $(if $(CONFIG_USE_GLIBC),,-largp) \ -Wl,--as-needed diff --git a/utils/smartmontools/Makefile b/utils/smartmontools/Makefile index 9db02d0d01..8281736b5d 100644 --- a/utils/smartmontools/Makefile +++ b/utils/smartmontools/Makefile @@ -21,6 +21,7 @@ PKG_LICENSE_FILES:=COPYING PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -78,9 +79,7 @@ define Package/smartd-mail/description A script for mailing about SMART issues endef -TARGET_LDFLAGS += -flto - -TARGET_CXXFLAGS +=-fno-rtti -flto +TARGET_CXXFLAGS +=-fno-rtti MAKE_FLAGS +=BUILD_INFO='"(localbuild)"' CONFIGURE_ARGS += \ diff --git a/utils/unrar/Makefile b/utils/unrar/Makefile index 2701207005..22e194ca3a 100644 --- a/utils/unrar/Makefile +++ b/utils/unrar/Makefile @@ -22,10 +22,11 @@ PKG_CPE_ID:=cpe:/a:rarlab:unrar PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk -TARGET_CXXFLAGS +=-fno-rtti -flto +TARGET_CXXFLAGS +=-fno-rtti TARGET_LDFLAGS +=$(FPIC) -Wl,--gc-sections $(if $(CONFIG_USE_GLIBC),-lpthread) define Package/unrar/Default diff --git a/utils/xz/Makefile b/utils/xz/Makefile index 3d26b1f527..834bfdbc70 100644 --- a/utils/xz/Makefile +++ b/utils/xz/Makefile @@ -23,6 +23,7 @@ PKG_CPE_ID:=cpe:/a:tukaani:xz PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 +PKG_BUILD_FLAGS:=lto include $(INCLUDE_DIR)/package.mk @@ -71,7 +72,7 @@ define BuildSubPackage $$(eval $$(call BuildPackage,$(1))) endef -TARGET_LDFLAGS += -Wl,--gc-sections -flto +TARGET_LDFLAGS += -Wl,--gc-sections CONFIGURE_ARGS += \ --enable-small \ diff --git a/utils/zsh/Makefile b/utils/zsh/Makefile index 9ab461df7e..6fc713a5db 100644 --- a/utils/zsh/Makefile +++ b/utils/zsh/Makefile @@ -22,7 +22,7 @@ PKG_CPE_ID:=cpe:/a:zsh_project:zsh PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 -PKG_BUILD_FLAGS:=gc-sections +PKG_BUILD_FLAGS:=gc-sections lto include $(INCLUDE_DIR)/package.mk @@ -83,8 +83,8 @@ define Build/Configure $(MAKE) -C $(PKG_BUILD_DIR) DESTDIR="$(PKG_INSTALL_DIR)" prep endef -TARGET_CFLAGS += $(FPIC) -flto -TARGET_LDFLAGS += $(FPIC) -flto +TARGET_CFLAGS += $(FPIC) +TARGET_LDFLAGS += $(FPIC) define Package/zsh/postinst #!/bin/sh -- 2.30.2