diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2022-10-24 20:46:05 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-11-08 18:36:18 +0000 |
commit | 1d2e9b67b001f8c0d10138797b9df4779609c03c (patch) | |
tree | cb570d14ea3d125d90c63fdd69c4550d4411d8a7 /arch/arm/kernel/stacktrace.c | |
parent | 26b12e084bce78f339bf9069ff25e0128313d9bc (diff) | |
download | linux-1d2e9b67b001f8c0d10138797b9df4779609c03c.tar.gz linux-1d2e9b67b001f8c0d10138797b9df4779609c03c.tar.bz2 linux-1d2e9b67b001f8c0d10138797b9df4779609c03c.zip |
ARM: 9265/1: pass -march= only to compiler
When both -march= and -Wa,-march= are specified for assembler or
assembler-with-cpp sources, GCC and Clang will prefer the -Wa,-march=
value but Clang will warn that -march= is unused.
warning: argument unused during compilation: '-march=armv6k'
[-Wunused-command-line-argument]
This is the top group of warnings we observe when using clang to
assemble the kernel via `ARCH=arm make LLVM=1`.
Split the arch-y make variable into two, so that -march= flags only get
passed to the compiler, not the assembler. -D flags are added to
KBUILD_CPPFLAGS which is used for both C and assembler-with-cpp sources.
Clang is trying to warn that it doesn't support different values for
-march= and -Wa,-march= (like GCC does, but the kernel doesn't need this)
though the value of the preprocessor define __thumb2__ is based on
-march=. Make sure to re-set __thumb2__ via -D flag for assembler
sources now that we're no longer passing -march= to the assembler. Set
it to a different value than the preprocessor would for -march= in case
-march= gets accidentally re-added to KBUILD_AFLAGS in the future.
Thanks to Ard and Nathan for this suggestion.
Link: https://github.com/ClangBuiltLinux/linux/issues/1315
Link: https://github.com/ClangBuiltLinux/linux/issues/1587
Link: https://github.com/llvm/llvm-project/issues/55656
Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Suggested-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'arch/arm/kernel/stacktrace.c')
0 files changed, 0 insertions, 0 deletions