Skip to contentSkip to conversation

kbuild: Add ability to test Clang's integrated assembler

PATCH In review Nathan Chancellor 3 participants 3 messages Jun 27, 2019 – Jul 3, 2019 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Add ability to test Clang's integrated assembler

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.

---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -0
index 5102b2bbd224..d77481129339 100644
@@ -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)
Signature · 1 line
2.22.0
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 18 lines · Nathan Chancellor

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.

---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +0 -0
index 5102b2bbd224..d77481129339 100644

Makefile endif · line 532

Quoted 6 lines
Makefile +2 -0
@@ -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

This is a nice suggestion and solution. Thanks Dima and Nathan.

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw
In reply to Nathan Chancellor
Quoted 9 lines · Nathan Chancellor

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.

Applied to linux-kbuild. Thanks.

Quoted 19 lines
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -1
index 5102b2bbd224..d77481129339 100644
@@ -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)
--
Quoted 2 lines

2.22.0

--
Best Regards
Masahiro Yamada