summaryrefslogtreecommitdiffstats
path: root/include/package.mk
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2023-01-27 16:35:46 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2023-07-04 20:25:41 +0200
commit32ed9764462ae04fad5809f857450d4f606ac4c0 (patch)
treed70d73c076cfb423876ad72d76199443dead47e1 /include/package.mk
parent42ef375cb658d2de0d44a8b1da4df939341b6021 (diff)
downloadopenwrt-32ed9764462ae04fad5809f857450d4f606ac4c0.tar.gz
openwrt-32ed9764462ae04fad5809f857450d4f606ac4c0.tar.bz2
openwrt-32ed9764462ae04fad5809f857450d4f606ac4c0.zip
build: add support to use the mold linker for packages
If CONFIG_USE_MOLD is set, all target packages will use the mold linker. Except the ones which opted-out via setting PKG_BUILD_FLAGS:=no-mold. Signed-off-by: Andre Heider <a.heider@gmail.com>
Diffstat (limited to 'include/package.mk')
-rw-r--r--include/package.mk5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/package.mk b/include/package.mk
index 1762080b9b..61a26f0c43 100644
--- a/include/package.mk
+++ b/include/package.mk
@@ -55,6 +55,11 @@ ifeq ($(call pkg_build_flag,lto,$(if $(CONFIG_USE_LTO),1,0)),1)
TARGET_CXXFLAGS+= -flto=auto -fno-fat-lto-objects
TARGET_LDFLAGS+= -flto=auto -fuse-linker-plugin
endif
+ifdef CONFIG_USE_MOLD
+ ifeq ($(call pkg_build_flag,mold,1),1)
+ TARGET_LINKER:=mold
+ endif
+endif
include $(INCLUDE_DIR)/hardening.mk
include $(INCLUDE_DIR)/prereq.mk