Commit 321b148f authored by Masahiro Yamada's avatar Masahiro Yamada Committed by sanglipeng
Browse files

kbuild: check CONFIG_AS_IS_LLVM instead of LLVM_IAS

stable inclusion
from stable-v5.10.178
commit c36a251011793e1c86ab7c7a0e79ce6794a9bd2c
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8ALH3

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=c36a251011793e1c86ab7c7a0e79ce6794a9bd2c



--------------------------------

commit 52cc02b9 upstream.

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 ba64beb1 ("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: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
[nathan: Backport to 5.10]
Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent a98587e3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -862,7 +862,7 @@ else
DEBUG_CFLAGS	+= -g
endif

ifeq ($(LLVM_IAS),1)
ifdef CONFIG_AS_IS_LLVM
KBUILD_AFLAGS	+= -g
else
KBUILD_AFLAGS	+= -Wa,-gdwarf-2
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ ifeq ($(CONFIG_LD_IS_LLD),y)
ifeq ($(shell test $(CONFIG_LLD_VERSION) -lt 150000; echo $$?),0)
	KBUILD_CFLAGS += -mno-relax
	KBUILD_AFLAGS += -mno-relax
ifneq ($(LLVM_IAS),1)
ifndef CONFIG_AS_IS_LLVM
	KBUILD_CFLAGS += -Wa,-mno-relax
	KBUILD_AFLAGS += -Wa,-mno-relax
endif