Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Makefile: move initial clang flag handling into scripts/Makefile.clang

With some of the changes we'd like to make to CROSS_COMPILE, the initial
block of clang flag handling which controls things like the target triple,
whether or not to use the integrated assembler and how to find GAS,
and erroring on unknown warnings is becoming unwieldy. Move it into its
own file under scripts/.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Nick Desaulniers and committed by
Masahiro Yamada
6f5b41a2 6072b2c4

+16 -14
+1
MAINTAINERS
··· 4501 4501 C: irc://chat.freenode.net/clangbuiltlinux 4502 4502 F: Documentation/kbuild/llvm.rst 4503 4503 F: include/linux/compiler-clang.h 4504 + F: scripts/Makefile.clang 4504 4505 F: scripts/clang-tools/ 4505 4506 K: \b(?i:clang|llvm)\b 4506 4507
+1 -14
Makefile
··· 584 584 CC_VERSION_TEXT = $(subst $(pound),,$(shell LC_ALL=C $(CC) --version 2>/dev/null | head -n 1)) 585 585 586 586 ifneq ($(findstring clang,$(CC_VERSION_TEXT)),) 587 - ifneq ($(CROSS_COMPILE),) 588 - CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) 589 - endif 590 - ifeq ($(LLVM_IAS),1) 591 - CLANG_FLAGS += -integrated-as 592 - else 593 - CLANG_FLAGS += -no-integrated-as 594 - GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) 595 - CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) 596 - endif 597 - CLANG_FLAGS += -Werror=unknown-warning-option 598 - KBUILD_CFLAGS += $(CLANG_FLAGS) 599 - KBUILD_AFLAGS += $(CLANG_FLAGS) 600 - export CLANG_FLAGS 587 + include $(srctree)/scripts/Makefile.clang 601 588 endif 602 589 603 590 # Include this also for config targets because some architectures need
+14
scripts/Makefile.clang
··· 1 + ifneq ($(CROSS_COMPILE),) 2 + CLANG_FLAGS += --target=$(notdir $(CROSS_COMPILE:%-=%)) 3 + endif 4 + ifeq ($(LLVM_IAS),1) 5 + CLANG_FLAGS += -integrated-as 6 + else 7 + CLANG_FLAGS += -no-integrated-as 8 + GCC_TOOLCHAIN_DIR := $(dir $(shell which $(CROSS_COMPILE)elfedit)) 9 + CLANG_FLAGS += --prefix=$(GCC_TOOLCHAIN_DIR)$(notdir $(CROSS_COMPILE)) 10 + endif 11 + CLANG_FLAGS += -Werror=unknown-warning-option 12 + KBUILD_CFLAGS += $(CLANG_FLAGS) 13 + KBUILD_AFLAGS += $(CLANG_FLAGS) 14 + export CLANG_FLAGS