Skip to content

Commit

Permalink
build: add support to use the mold linker for packages
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
dhewg authored and Ansuel committed Jul 4, 2023
1 parent 42ef375 commit 32ed976
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 32ed976

Please sign in to comment.