kbuild: Add ability to test Clang's integrated assembler
authorNathan Chancellor <natechancellor@gmail.com>
Thu, 27 Jun 2019 19:14:48 +0000 (12:14 -0700)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 3 Jul 2019 23:28:29 +0000 (08:28 +0900)
There are some people interested in experimenting with Clang's
integrated assembler. To make it easy to do so without source
modification, allow the user to specify 'AS=clang' as part of the
make command to avoid adding '-no-integrated-as' to the {A,C}FLAGS.

Link: https://github.com/ClangBuiltLinux/linux/issues/577
Suggested-by: Dmitry Golovin <dima@golovin.in>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile

index c3b6dcd..d6c3dba 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -527,7 +527,9 @@ endif
 ifneq ($(GCC_TOOLCHAIN),)
 CLANG_FLAGS    += --gcc-toolchain=$(GCC_TOOLCHAIN)
 endif
+ifeq ($(shell $(AS) --version 2>&1 | head -n 1 | grep clang),)
 CLANG_FLAGS    += -no-integrated-as
+endif
 CLANG_FLAGS    += -Werror=unknown-warning-option
 KBUILD_CFLAGS  += $(CLANG_FLAGS)
 KBUILD_AFLAGS  += $(CLANG_FLAGS)