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

kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS

LLVM_IAS is the user interface to set the -(no-)integrated-as flag,
and it should be used only for that purpose.

LLVM_IAS is checked in some places to determine the assembler type,
but it is not precise.

For example,

$ make CC=gcc LLVM_IAS=1

... will use the GNU assembler (i.e. binutils) since LLVM_IAS=1 is
effective only when $(CC) is clang.

Of course, 'CC=gcc LLVM_IAS=1' is an odd combination, but the build
system can be more robust against such insane input.

Commit ba64beb17493a ("kbuild: check the minimum assembler version in
Kconfig") introduced CONFIG_AS_IS_GNU/LLVM, which is more precise
because Kconfig checks the version string from the assembler in use.

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

+2 -2
+1 -1
Makefile
··· 843 843 DEBUG_CFLAGS += -g 844 844 endif 845 845 846 - ifneq ($(LLVM_IAS),1) 846 + ifndef CONFIG_AS_IS_LLVM 847 847 KBUILD_AFLAGS += -Wa,-gdwarf-2 848 848 endif 849 849
+1 -1
arch/riscv/Makefile
··· 41 41 ifeq ($(CONFIG_LD_IS_LLD),y) 42 42 KBUILD_CFLAGS += -mno-relax 43 43 KBUILD_AFLAGS += -mno-relax 44 - ifneq ($(LLVM_IAS),1) 44 + ifndef CONFIG_AS_IS_LLVM 45 45 KBUILD_CFLAGS += -Wa,-mno-relax 46 46 KBUILD_AFLAGS += -Wa,-mno-relax 47 47 endif