diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index dfa6a5cb99e4..12229cc5d908 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -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)