-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: invalid instruction arch/arm/mm/tlb-v7.S #1195
Comments
eh, this is pretty common due to commit aff7b4f ("ARM: Ensure ARMv6/7 mm files are built using appropriate assembler options") |
tempted to mark this a dup of #957. |
Note that arch/arm64/Makefile has code like:
and it seems like the Kconfig checks are working, so is it the case that we support |
Isn't the issue that |
cc @arndb should those be mutually exclusive? |
Modifying the kernel would involve touching at least 20 .S sources, and their Makefiles.
|
CONFIG_CPU_32v7 and CONFIG_CPU_32v6 are mutually exclusive, however CONFIG_CPU_32v6K is a special symbol that tells us that the 'K' extension of v6 is present. As 'K' is implied by ARMv7, CONFIG_CPU_32v6K is always enabled on any ARMv7 configuration. I agree this is really confusing, but it works as designed. |
@DavidSpickett at Linaro also has a patch for LLVM: https://reviews.llvm.org/D95872. I'll try to get it reviewed and tested asap. |
I still get the "argument unused during compilation" warning, though I no longer get the "invalid instruction" errors. I think something is still wrong here. For instance when building the kernel without my earlier patch: clang-13 -Wp,-MMD,drivers/memory/.ti-emif-sram-pm.o.d -nostdinc -isystem /usr/lib/llvm-13/lib/clang/13.0.0/include -I/git/arm-soc/arch/arm/include -I./arch/arm/include/generated -I/git/arm-soc/include -I./include -I/git/arm-soc/arch/arm/include/uapi -I./arch/arm/include/generated/uapi -I/git/arm-soc/include/uapi -I./include/generated/uapi -include /git/arm-soc/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -fmacro-prefix-map=/git/arm-soc/= -D__ASSEMBLY__ -fno-PIE --target=arm-linux-gnueabi --prefix=/home/arnd/cross/x86_64/gcc-10.1.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- --gcc-toolchain=/home/arnd/cross/x86_64/gcc-10.1.0-nolibc/arm-linux-gnueabi -Werror=unknown-warning-option -mabi=aapcs-linux -mfpu=vfp -meabi gnu -marm -Wa,-W -D__LINUX_ARM_ARCH__=6 -march=armv6k -mtune=arm1136j-s -include asm/unified.h -msoft-float -Wa,--fatal-warnings -Wa,-march=armv7-a -I /git/arm-soc/drivers/memory -I ./drivers/memory -DMODULE -c -o drivers/memory/ti-emif-sram-pm.o /git/arm-soc/drivers/memory/ti-emif-sram-pm.S It seems that clang now accepts the "-Wa,-march=armv7" bit and correctly builds the file with that, but when we pass both "-march=" and "-Wa,-march=" options, it complains about one of them being unused. |
That looks like a separate issue. Let's track it in #1315. |
ClangBuiltLinux/linux#1195 was not resolved in LLVM 12, resulting in errors of that nature when using the integrated assembler: https://github.com/ClangBuiltLinux/continuous-integration2/runs/2434374437?check_suite_focus=true Make these builds just LLVM=1 to keep the arm coverage on Android. Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang's integrated assembler does not support -Wa,-march (and the logic to overrule one when multiple of the above are used), and this can cause annoying warnings such as: clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang was missing support for -Wa,-march=, but this was implemented in clang-13. The behavior of both GCC and Clang is to prefer -Wa,-march= over -march= for assembler and assembler-with-cpp sources, but Clang will warn about the -march= being unused. clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Link: llvm/llvm-project@1d51c69 Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Link: ClangBuiltLinux#1315 Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com> [arnd] add a few more instances found in compile testing Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang was missing support for -Wa,-march=, but this was implemented in clang-13. The behavior of both GCC and Clang is to prefer -Wa,-march= over -march= for assembler and assembler-with-cpp sources, but Clang will warn about the -march= being unused. clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Add a few more instances found in compile testing as found by Arnd and Nathan. Link: llvm/llvm-project@1d51c69 Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Link: ClangBuiltLinux#1315 Suggested-by: Arnd Bergmann <arnd@arndb.de> Suggested-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
…lags Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang was missing support for -Wa,-march=, but this was implemented in clang-13. The behavior of both GCC and Clang is to prefer -Wa,-march= over -march= for assembler and assembler-with-cpp sources, but Clang will warn about the -march= being unused. clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Add a few more instances found in compile testing as found by Arnd and Nathan. Link: llvm/llvm-project@1d51c69 Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Link: ClangBuiltLinux#1315 Suggested-by: Arnd Bergmann <arnd@arndb.de> Suggested-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> 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>
…lags Similar to commit a6c3087 ("ARM: 8989/1: use .fpu assembler directives instead of assembler arguments"). GCC and GNU binutils support setting the "sub arch" via -march=, -Wa,-march, target function attribute, and .arch assembler directive. Clang was missing support for -Wa,-march=, but this was implemented in clang-13. The behavior of both GCC and Clang is to prefer -Wa,-march= over -march= for assembler and assembler-with-cpp sources, but Clang will warn about the -march= being unused. clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument] Since most assembler is non-conditionally assembled with one sub arch (modulo arch/arm/delay-loop.S which conditionally is assembled as armv4 based on CONFIG_ARCH_RPC, and arch/arm/mach-at91/pm-suspend.S which is conditionally assembled as armv7-a based on CONFIG_CPU_V7), prefer the .arch assembler directive. Add a few more instances found in compile testing as found by Arnd and Nathan. Link: llvm/llvm-project@1d51c69 Link: https://bugs.llvm.org/show_bug.cgi?id=48894 Link: ClangBuiltLinux#1195 Link: ClangBuiltLinux#1315 Suggested-by: Arnd Bergmann <arnd@arndb.de> Suggested-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> 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>
building allyesconfig with LLVM_IAS=1:
similar to 7548bf8
fixes the error. cc @jcai19
The text was updated successfully, but these errors were encountered: