Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38531 )
Change subject: payloads/external/linux: Attempt to autodetect correct toolchain ......................................................................
payloads/external/linux: Attempt to autodetect correct toolchain
Change-Id: Ide7cd9ff838266823057d604addc8970939ccb86 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M payloads/external/LinuxBoot/targets/linux.mk 1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/38531/1
diff --git a/payloads/external/LinuxBoot/targets/linux.mk b/payloads/external/LinuxBoot/targets/linux.mk index 8be0926..aa3f168 100644 --- a/payloads/external/LinuxBoot/targets/linux.mk +++ b/payloads/external/LinuxBoot/targets/linux.mk @@ -27,6 +27,18 @@ project_dir=linuxboot tarball_dir:=$(project_dir)/tarball decompress_flag=.done +ifeq ($(LINUXBOOT_CROSS_COMPILE),) +$(info env LINUXBOOT_CROSS_COMPILE not set, auto-detecting host toolchain...) +# Don't use gnu-gcc as ccache falsely provides this single binary +ifeq ($(CONFIG_LINUXBOOT_X86_64),y) +LINUXBOOT_CROSS_COMPILE=$(shell which x86_64-linux-gnu-ld | sed -e "s/linux-gnu-ld/linux-gnu-/g") +else ifeq ($(CONFIG_LINUXBOOT_X86),y) +LINUXBOOT_CROSS_COMPILE=$(shell which i386-linux-gnu-ld | sed -e "s/linux-gnu-ld/linux-gnu-/g") +else ifeq ($(CONFIG_LINUXBOOT_ARM64),y) +LINUXBOOT_CROSS_COMPILE=$(shell which aarch64-linux-gnu-ld | sed -e "s/linux-gnu-ld/linux-gnu-/g") +endif +$(info Using '$(LINUXBOOT_CROSS_COMPILE)' as toolchain) +endif
OBJCOPY:=$(LINUXBOOT_CROSS_COMPILE)objcopy KERNEL_MAKE_FLAGS = \