Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 83dee70c authored by Luca Stefani's avatar Luca Stefani
Browse files

kernel: Allow specifying a custom linker binary

* This is needed for using LLVM LLD ( and ThinLTO )

Change-Id: If603274326f0ff22f967455847ffe1c595f04aa5
parent 0b501d53
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@
#
#   KERNEL_CC                          = The C Compiler used. This is automatically set based
#                                          on whether the clang version is set, optional.
#   KERNEL_LD                          = The Linker used. This is automatically set based
#                                          on whether the clang/gcc version is set, optional.
#
#   KERNEL_CLANG_TRIPLE                = Target triple for clang (e.g. aarch64-linux-gnu-)
#                                          defaults to arm-linux-gnu- for arm
@@ -183,6 +185,9 @@ ifeq ($(TARGET_KERNEL_CLANG_COMPILE),true)
    ifeq ($(KERNEL_CC),)
        KERNEL_CC := CC="$(CCACHE_BIN) clang"
    endif
    ifeq ($(KERNEL_LD),)
        KERNEL_LD :=
    endif
endif

ifneq ($(TARGET_KERNEL_MODULES),)
@@ -200,7 +205,7 @@ KERNEL_ADDITIONAL_CONFIG_OUT := $(KERNEL_OUT)/.additional_config
# $(1): output path (The value passed to O=)
# $(2): target to build (eg. defconfig, modules, dtbo.img)
define internal-make-kernel-target
$(PATH_OVERRIDE) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_BUILD_OUT_PREFIX)$(1) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) $(2)
$(PATH_OVERRIDE) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(KERNEL_SRC) O=$(KERNEL_BUILD_OUT_PREFIX)$(1) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) $(KERNEL_CLANG_TRIPLE) $(KERNEL_CC) $(KERNEL_LD) $(2)
endef

# Make a kernel target