kbuild: clang: do not use CROSS_COMPILE for target triple

The target triple is overridden by the user-supplied CROSS_COMPILE,
but I do not see a good reason to support it. Users can use a new
architecture without adding CLANG_TARGET_FLAGS_*, but that would be
a rare case.

Use the hard-coded and deterministic target triple all the time.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
This commit is contained in:
Masahiro Yamada 2023-04-02 02:01:17 +09:00
parent fb318e54fe
commit ddc72c9659

View File

@ -13,15 +13,11 @@ CLANG_TARGET_FLAGS_x86 := x86_64-linux-gnu
CLANG_TARGET_FLAGS_um := $(CLANG_TARGET_FLAGS_$(SUBARCH)) CLANG_TARGET_FLAGS_um := $(CLANG_TARGET_FLAGS_$(SUBARCH))
CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH)) CLANG_TARGET_FLAGS := $(CLANG_TARGET_FLAGS_$(SRCARCH))
ifeq ($(CROSS_COMPILE),)
ifeq ($(CLANG_TARGET_FLAGS),) ifeq ($(CLANG_TARGET_FLAGS),)
$(error Specify CROSS_COMPILE or add '--target=' option to scripts/Makefile.clang) $(error add '--target=' option to scripts/Makefile.clang)
else else
CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS) CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS)
endif # CLANG_TARGET_FLAGS endif
else
CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%))
endif # CROSS_COMPILE
ifeq ($(LLVM_IAS),0) ifeq ($(LLVM_IAS),0)
CLANG_FLAGS += -fno-integrated-as CLANG_FLAGS += -fno-integrated-as