From 3ca50b684047c7f25437451b67a36f9e791ae0a3 Mon Sep 17 00:00:00 2001 From: Daniel Mentz Date: Wed, 20 Feb 2019 16:59:14 -0800 Subject: [PATCH] vdso32: Invoke clang with correct path to GCC toolchain Clang needs to have access to a GCC toolchain which we advertise using the command line option --gcc-toolchain=. Clang previously picked the wrong toolchain which resulted in the following error message: /..//bin/as: unrecognized option '-EL' Bug: 123422077 Signed-off-by: Daniel Mentz Change-Id: I3e339dd446b71e2c75eb9e2c186eba715b3771cd Signed-off-by: Adam W. Willis --- arch/arm64/Makefile | 4 ++++ arch/arm64/kernel/vdso32/Makefile | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 60ad569040cf..cc6ca73c78a2 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -68,6 +68,10 @@ ifeq ($(CONFIG_COMPAT_VDSO), y) else ifeq ($(cc-name),clang) export CLANG_TRIPLE_ARM32 ?= $(CROSS_COMPILE_ARM32) export CLANG_TARGET_ARM32 := --target=$(notdir $(CLANG_TRIPLE_ARM32:%-=%)) + export GCC_TOOLCHAIN32_DIR := $(dir $(shell which $(CROSS_COMPILE_ARM32)ld)) + export GCC_TOOLCHAIN32 := $(realpath $(GCC_TOOLCHAIN32_DIR)/..) + export CLANG_PREFIX32 := --prefix=$(GCC_TOOLCHAIN32_DIR) + export CLANG_GCC32_TC := --gcc-toolchain=$(GCC_TOOLCHAIN32) export CONFIG_VDSO32 := y vdso32 := -DCONFIG_VDSO32=1 else ifeq ($(shell which $(CROSS_COMPILE_ARM32)$(cc-name) 2> /dev/null),) diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile index 837e877a326b..ceff67976e63 100644 --- a/arch/arm64/kernel/vdso32/Makefile +++ b/arch/arm64/kernel/vdso32/Makefile @@ -5,7 +5,7 @@ # A mix between the arm64 and arm vDSO Makefiles. ifeq ($(cc-name),clang) - CC_ARM32 := $(CC) $(CLANG_TARGET_ARM32) -no-integrated-as + CC_ARM32 := $(CC) $(CLANG_TARGET_ARM32) -no-integrated-as $(CLANG_GCC32_TC) $(CLANG_PREFIX32) else CC_ARM32 := $(CROSS_COMPILE_ARM32)$(cc-name) endif