aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2019-10-07 12:27:59 +0100
committerWill Deacon <will@kernel.org>2019-10-07 13:32:09 +0100
commit7424ee2b1617de62c3761bdd6260857363e1e4d4 (patch)
tree6b2b1d915ee5b0d8256dde49b786493a1f222d01
parentarm64: vdso32: Don't use KBUILD_CPPFLAGS unconditionally (diff)
downloadlinux-dev-7424ee2b1617de62c3761bdd6260857363e1e4d4.tar.xz
linux-dev-7424ee2b1617de62c3761bdd6260857363e1e4d4.zip
arm64: vdso32: Pass '--target' option to clang via VDSO_CAFLAGS
Directly passing the '--target' option to clang by appending to COMPATCC does not work if COMPATCC has been specified explicitly as an argument to Make unless the 'override' directive is used, which is ugly and different to what is done in the top-level Makefile. Move the '--target' option for clang out of COMPATCC and into VDSO_CAFLAGS, where it will be picked up when compiling and assembling the 32-bit vDSO under clang. Reported-by: Catalin Marinas <catalin.marinas@arm.com> Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--arch/arm64/kernel/vdso32/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
index 7de96a6a56f9..60e19a3fc109 100644
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -10,7 +10,7 @@ include $(srctree)/lib/vdso/Makefile
# Same as cc-*option, but using COMPATCC instead of CC
ifeq ($(CONFIG_CC_IS_CLANG), y)
-COMPATCC ?= $(CC) --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
+COMPATCC ?= $(CC)
else
COMPATCC ?= $(CROSS_COMPILE_COMPAT)gcc
endif
@@ -38,6 +38,10 @@ VDSO_CPPFLAGS += $(LINUXINCLUDE)
# Common C and assembly flags
# From top-level Makefile
VDSO_CAFLAGS := $(VDSO_CPPFLAGS)
+ifneq ($(shell $(COMPATCC) --version 2>&1 | head -n 1 | grep clang),)
+VDSO_CAFLAGS += --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
+endif
+
VDSO_CAFLAGS += $(call cc32-option,-fno-PIE)
ifdef CONFIG_DEBUG_INFO
VDSO_CAFLAGS += -g