I'm trying to compile arm32_v5/arm32_v6/arm32_v7 kernel using AS=clang (integrated-as in being used). The following error message is produced when compiling scripts/mod/empty.o:
clang: error: unsupported argument '-W' to option 'Wa,'
This argument is added here:
https://github.com/ClangBuiltLinux/linux/blob/b08918fb3f27d1843152986e6bc79ec723dba8cc/arch/arm/Makefile#L116
The compilation continues without error if the option is removed:
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -113,7 +113,7 @@ CFLAGS_ABI +=-funwind-tables
endif
# Accept old syntax despite ".syntax unified"
-AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
+AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated)
ifeq ($(CONFIG_THUMB2_KERNEL),y)
CFLAGS_ISA :=-mthumb -Wa,-mimplicit-it=always $(AFLAGS_NOWARN)
What should -W do when passed to the assembler?
From man page of GNU as:
-W
--no-warn
Suppress warning messages.
That sounds useful to implement in Clang.
def massembler_no_warn : Flag<["-"], "massembler-no-warn">,
205: HelpText<"Make assembler not emit warnings">;
Seems we could simply add -W as an alis for this option in llvm.
upstream bug: https://bugs.llvm.org/show_bug.cgi?id=43651
code review: https://reviews.llvm.org/D68884
fixed in r374834