Re: [PATCH] arm64: drop CROSS_COMPILE for LLVM=1 LLVM_IAS=1

From: Tom Stellard
Date: Thu Jul 01 2021 - 21:05:53 EST

On 7/1/21 4:55 PM, 'Nick Desaulniers' via Clang Built Linux wrote:
We get constant feedback that the command line invocation of make is too
long. CROSS_COMPILE is helpful when a toolchain has a prefix of the
target triple, or is an absolute path outside of $PATH, but it's mostly
redundant for a given ARCH.

If CROSS_COMPILE is not set, simply set --target=aarch64-linux for

Previously, we'd cross compile via:
$ ARCH=arm64 CROSS_COMPILE=aarch64-linxu-gnu make LLVM=1 LLVM_IAS=1
$ ARCH=arm64 make LLVM=1 LLVM_IAS=1

We can drop gnu from the triple, but dropping linux from the triple
produces different .config files for the above invocations for the
defconfig target.

Suggested-by: Arnd Bergmann <arnd@xxxxxxxxxx>
Suggested-by: Fangrui Song <maskray@xxxxxxxxxx>
Signed-off-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>
arch/arm64/Makefile | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 7bc37d0a1b68..016873fddcc3 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile

Are there plans to do this for other architectures?


@@ -34,6 +34,17 @@ $(warning LSE atomics not supported by binutils)
+ifneq ($(LLVM),)
+ifneq ($(LLVM_IAS),)
+ifeq ($(CROSS_COMPILE),)
+CLANG_TARGET :=--target=aarch64-linux
cc_has_k_constraint := $(call try-run,echo \
'int main(void) { \
asm volatile("and w0, w0, %w0" :: "K" (4294967295)); \