treewide: refactor to use PKG_BUILD_FLAGS:=lto
authorAndre Heider <a.heider@gmail.com>
Thu, 23 Mar 2023 08:27:01 +0000 (09:27 +0100)
committerAndre Heider <a.heider@gmail.com>
Sat, 8 Apr 2023 06:38:54 +0000 (08:38 +0200)
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 <a.heider@gmail.com>
54 files changed:
libs/boost/Makefile
libs/libcap-ng/Makefile
libs/libdcwproto/Makefile
libs/libdcwsocket/Makefile
libs/libgd/Makefile
libs/libnpupnp/Makefile
libs/libplist/Makefile
libs/libtins/Makefile
libs/libv4l/Makefile
libs/libwebp/Makefile
libs/log4cplus/Makefile
libs/minizip/Makefile
libs/nspr/Makefile
libs/qrencode/Makefile
libs/sbc/Makefile
libs/taglib/Makefile
mail/emailrelay/Makefile
multimedia/graphicsmagick/Makefile
multimedia/imagemagick/Makefile
multimedia/ttymidi-sysex/Makefile
multimedia/v4l2rtspserver/Makefile
net/aria2/Makefile
net/chrony/Makefile
net/cifs-utils/Makefile
net/clamav/Makefile
net/dcstad/Makefile
net/dcwapd/Makefile
net/foolsm/Makefile
net/frr/Makefile
net/iperf/Makefile
net/libreswan/Makefile
net/microsocks/Makefile
net/mosh/Makefile
net/mrmctl/Makefile
net/nfdump/Makefile
net/open-iscsi/Makefile
net/open-isns/Makefile
net/openvswitch/Makefile
net/ovn/Makefile
net/shadowsocks-libev/Makefile
net/tor/Makefile
net/transmission/Makefile
sound/espeak/Makefile
utils/acpid/Makefile
utils/ap51-flash/Makefile
utils/coremark/Makefile
utils/domoticz/Makefile
utils/dump1090/Makefile
utils/gptfdisk/Makefile
utils/readsb/Makefile
utils/smartmontools/Makefile
utils/unrar/Makefile
utils/xz/Makefile
utils/zsh/Makefile

index cb92e27a46329c6e3ee512421f843803ec53ee7d..295e4b2436089c363a1c602a6d6ca06f7c169d68 100644 (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 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
index b8d12ff04fab156d98dc65aacdf2950aeb7e0188..ab3c6272aa7dda1ee84e7e6ca93c694b115b97e0 100644 (file)
@@ -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
index caaec8f79d5cc571a26f876e09157f629054df26..4ac94d7b17e7bffcddb4f3d819d31ea82a5af268 100644 (file)
@@ -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
index dc3bf3f1eb0115ad0d6e6ce0624cb814c1e07104..60241923300e952f5da32b04697d89b62236f40a 100644 (file)
@@ -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
index 9e0108915a878657eec3d26f13113e17be00664d..750733fecd42ddae6890d056748dbe264e11b1a0 100644 (file)
@@ -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 \
index dcfa5137763c0f028e9d1e8318a7371b13ef6b75..9eb961af8f639fe13b8d7acdf96b237cb50048b6 100644 (file)
@@ -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/
index d5cbc0e9434858df907df03dda37c1a2cd7efd2c..eb8265b1b8b3d56621076053aa1ea0bb817653b1 100644 (file)
@@ -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
index 644eecdbf3704dac3b6e7ce4a6104d1ae5589170..b9bf273220b7399abfacff682cbdf191e3e4e497 100644 (file)
@@ -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
index fa577da2e7b77851626f9c7029c3e71b492d2579..9e60a2b3e7172b91d354dc8c30524856854f6dfb 100644 (file)
@@ -15,7 +15,7 @@ PKG_HASH:=65c6fbe830a44ca105c443b027182c1b2c9053a91d1e72ad849dfab388b94e31
 
 PKG_MAINTAINER:=Ted Hess <thess@kitschensync.net>
 
-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
index a58062f359280002f7036de25fbb32f2798d9336..d16bc752af19c57ce691450e2b1248caabde756d 100644 (file)
@@ -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/
index accfeb5fa3f1790e751aa724e198ce61d5e9a40a..c4e103fd2b075ba44065290b12718f4ccc7e6605 100644 (file)
@@ -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
index 8e4ee216b5c99c9ed3686666a875f8bffccdc0dd..e38ed167c65bff6c7c8f2f6afbf2d73ac8bdc4aa 100644 (file)
@@ -18,6 +18,8 @@ PKG_MAINTAINER:=David Woodhouse <dwmw2@infradead.org>
 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
index 355322b74de32afd810cf349834a3e009e2b91da..4315c42e048bb4ea67f6b68bb26471f58c229bb3 100644 (file)
@@ -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) \
index 8411284803bf2899505478648e6fe68cee02fc1c..ee1f925b1f855bc04df338d0e9313ed30aaa572b 100644 (file)
@@ -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
index ca5b8488f099c5ac49ae3ed6fb1f80e85079b551..fd147174a9b4299409b06573c6623eba2e9ca067 100644 (file)
@@ -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/
index 78decddcf216b9c4e15ff10c95f91b32cf4aa1c1..f75c397352d3be98364660175824ef55237319ba 100644 (file)
@@ -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
index 5b9704257e03d2bb82b984be1f6abc1b516f4b2e..280a3de5e195474599aafdfa5d9484343e6b0b6d 100644 (file)
@@ -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
index 70a3408641f3fd2a037d95bab95f1b7ced7150df..0de3060d667db9d91fc6beb58cc5582670d0f05d 100644 (file)
@@ -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) \
index 59dbe0bb37ebcb74282a16b8063ec38f0a7730d2..4f0a976ab44d8e3679010657fd46a9088c01ad8b 100644 (file)
@@ -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) \
index 7839e783306cc8b6bbb2959b10a7c7a2862624ae..7f4fb84267afcfe0b22ebe2d502f22d0ffe5c718 100644 (file)
@@ -12,6 +12,7 @@ PKG_MIRROR_HASH:=8d6bb738a08a65c25fcc442777750abbee812a24a29236242032e2d76177454
 PKG_LICENSE:=GPL-3.0-or-later
 PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
 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
index f93d0647e95e6984399275f220b6951138d134cb..aee5cdce7e62185d9232e7cd70f58434af078f83 100644 (file)
@@ -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 += \
index 5004eff422a2c31bcef70050992d175d1ad71880..af441bf52678ff328443cdc18507411d1db9fa9a 100644 (file)
@@ -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 <kaloz@openwrt.org>, \
        Hsing-Wang Liao <kuoruan@gmail.com>
@@ -84,9 +84,6 @@ CONFIGURE_ARGS += \
        --without-libuv \
        --with-libz
 
-TARGET_CXXFLAGS += -flto
-TARGET_LDFLAGS += -flto
-
 define Package/aria2/conffiles
 /etc/config/aria2
 endef
index bf233f3474cf13aff1fc00ce9b0f62995f44712d..f4c277b75bd9db526f0b147be850e9c6f8d074ca 100644 (file)
@@ -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/
index 0662315ba86fae1b8e76766b3127ee247f513da9..fcc4b477387b9be21c10e49768182af1ea751050 100644 (file)
@@ -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
index 8d6e7676fd535fd15e193439d2e03a8de655b132..035d91fc3dd1e191b3bcb7f08186e90df36efaf6 100644 (file)
@@ -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
index bd07a8e4a422325232943db35fab7881acf6ee62..12da6fdca9b96dd7cd9bd46b527a6b0829aab980 100644 (file)
@@ -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/
index 34e2861af82abec92b3f9b52065ef425e637e0f9..28a9698db9b2c953423f51797c7a4ca5ed4d0972 100644 (file)
@@ -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
index 0cbe3f2472a373e70aa811c54e2a37db9e20afb1..1badaed193ebed0ca6e0efca25f1a1b1901ccdab 100644 (file)
@@ -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
index 997b554012578c30ce06066afb8e99e54c70f647..0f9f7fba81face5bb766f409016ad2f25995f0aa 100644 (file)
@@ -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 <lucian.cristian@gmail.com>
 
@@ -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)
index 3c320bff705a1e8a2d3f83be5f41a7934010fa12..3e13a04a2d98b4932fadff1eecf01786bc53a3b3 100644 (file)
@@ -19,6 +19,7 @@ PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
 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
index cbbb33cadf95ebf8f2e22d11d54f952bf0a0581a..6a8329b83eabaeb1bd693ec7d64de57a67f32dab 100644 (file)
@@ -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=" " \
index e16e577b36dfc8b4b3c68efc2dfcd3168b8d38a2..82abec56acf95bff3fdf474d5ea7b642914712be 100644 (file)
@@ -12,6 +12,8 @@ PKG_MAINTAINER:=Mateusz Korniak <matkorgithubcom@ant.gliwice.pl>
 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
index 53b8659f49388e354571052937ff08aaadcae3d8..0b840f399dddf8fa559cdc4e17ad84921f3d1a57 100644 (file)
@@ -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
index 3fdf4cb861c72e22f93f7518dd63f03b3d9ceb08..44480bfdbce5f07090137e4f73e67e0f18a53a82 100644 (file)
@@ -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
index f1879b984dd6b2ac1c8ae5ca3483260d9d3ab2c2..0af7f2ad1c2e2474c662fea3ef47cdc6274f6664 100644 (file)
@@ -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
index b7b7891bff6ea8fd4dadd1579b819144a82267a3..755c29cba6ecba800dacdb2d17199fb823ab4227 100644 (file)
@@ -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
index f2a0991e5ab38343f4e87b35f2102bbaf0ea603b..6aaffa6c488daf6dfa9b288ba3540b415fbd1855 100644 (file)
@@ -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
index 5106f60862a09cd6c3f7e45b672269bc154cf72a..fa1fa5d344c7e591ee433ed34ff7a6e9d99f5649 100644 (file)
@@ -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)
index 7c5afae9281b051eb98b83561a5e05d56691a34e..999986f93a78b3c5ca0abf44de2d10e623dd5423 100644 (file)
@@ -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
index 7bd094f74cfcb1348aef0531e18ff97d29ff208f..3642746e947828d8a830ccaded432737d19ac071 100644 (file)
@@ -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))
index cd5946b46fe3450418517d46e5cb7012c5f6a6f9..a8edb32278574a3d58a3428ad5e134a8d209865b 100644 (file)
@@ -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" \
index dc4244c092dcd709ee74a82885137b340ddbd121..7cec5179422faa99c4a180a3d15ba260d1ea5762 100644 (file)
@@ -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 += \
index bcd7686142aebb07cb0ac22ff1028e94d92786f6..260b2c448e0769ffa011e0f40ac5306ac6c707bb 100644 (file)
@@ -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
index ec1d41c8a1b5469f7e72c8ea8f99aa4e2b958001..dc9421426d72e173d266a3235d21a93e0bbb204c 100644 (file)
@@ -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
index 26eb1f0f1e807adeee032c9f62e8c5ac0d7c9a5f..c7181205ef0b67997b5fb18c6e8c214a8690e115 100644 (file)
@@ -18,6 +18,8 @@ PKG_MAINTAINER:=Russell Senior <russell@personaltelco.net>
 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
index aead11c66803700082e5f869712275c6213f7a9d..06a05c8753f87424c63095c6c34c398c28317ade 100644 (file)
@@ -22,7 +22,7 @@ PKG_MAINTAINER:=Lim Guo Wei <limguowei@gmail.com> \
 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
index a480caae05bde72901fcbcb0bda1817bdd59b9ca..c1a2b026961772965ddc74bc8aad34a22c887534 100644 (file)
@@ -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)
index 2f37cd06d9aae1175d648d0a0e26f1787b270130..ad3fbac36025f61d105d15ad21fc7abc759c8eec 100644 (file)
@@ -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
index 7295b6f6c00bee96e23fbc063de3149fb092a776..f466377cf95996ff601b9bf38aab9f166f81958d 100644 (file)
@@ -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
index 47b966728251ae5e109ab3cd19705062dc046dec..844fc0d51e70d8f7523db0cf8f8744c627a64e16 100644 (file)
@@ -20,7 +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
+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
index 9db02d0d016a746db3c7b4225294104101d1d9d1..8281736b5d5268b8ec4aa304eb85f11c08bc2d40 100644 (file)
@@ -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 += \
index 270120700514ea319059e9c34c9e54dd2246b5b6..22e194ca3ad657fd5b28e49595fcdbcf73e2a06f 100644 (file)
@@ -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
index 3d26b1f527c89d14ad92dd7b6ce9cb3e7f792ec2..834bfdbc705865ef73bd6e62ce9fd9db2518e788 100644 (file)
@@ -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 \
index 9ab461df7ec8e4e16ba3f35c5991282745eace4e..6fc713a5db0ed8abd4543d5b1522ba0dca1fce5b 100644 (file)
@@ -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