arm64: Default to building compat vDSO with clang when CONFIG_CC_IS_CLANG
authorWill Deacon <will@kernel.org>
Fri, 4 Oct 2019 13:08:13 +0000 (14:08 +0100)
committerWill Deacon <will@kernel.org>
Mon, 7 Oct 2019 12:31:45 +0000 (13:31 +0100)
Rather than force the use of GCC for the compat cross-compiler, instead
extract the target from CROSS_COMPILE_COMPAT and pass it to clang if the
main compiler is clang.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/Makefile

index dfa6a5cb99e469cbe25eb365040b093eb416044e..12229cc5d908917836dcbc4182a2e8a231c731a2 100644 (file)
@@ -53,7 +53,11 @@ $(warning Detected assembler with broken .inst; disassembly will be unreliable)
   endif
 endif
 
+ifeq ($(CONFIG_CC_IS_CLANG), y)
+COMPATCC ?= $(CC) --target=$(notdir $(CROSS_COMPILE_COMPAT:%-=%))
+else
 COMPATCC ?= $(CROSS_COMPILE_COMPAT)gcc
+endif
 export COMPATCC
 
 ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y)