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 <a.heider@gmail.com>
This commit is contained in:
Andre Heider
2023-03-23 09:27:01 +01:00
parent 35f4ef76e0
commit e7d9c86503
54 changed files with 84 additions and 107 deletions
+2 -2
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 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