Skip to content
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

Closed
nickdesaulniers opened this issue Nov 9, 2020 · 13 comments
Closed

error: invalid instruction arch/arm/mm/tlb-v7.S #1195

nickdesaulniers opened this issue Nov 9, 2020 · 13 comments
Labels
[ARCH] arm32 This bug impacts ARCH=arm [BUG] linux A bug that should be fixed in the mainline kernel. [CONFIG] allyesconfig Issue affects allyesconfig on certain architectures [FIXED][LLVM] 13 This bug was fixed in LLVM 13.x Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. [TOOL] integrated-as The issue is relevant to LLVM integrated assembler

Comments

@nickdesaulniers
Copy link
Member

building allyesconfig with LLVM_IAS=1:

$ ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make LLVM=1 LLVM_IAS=1 -j71 arch/arm/mm/tlb-v7.o
...
clang-12: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument]
clang-12: warning: argument unused during compilation: '-Wa,-march=armv7-a' [-Wunused-command-line-argument]
arch/arm/mm/tlb-v7.S:35:2: error: invalid instruction
 dsb ish
 ^
arch/arm/mm/tlb-v7.S:56:2: error: invalid instruction
 dsb ish
 ^
arch/arm/mm/tlb-v7.S:69:2: error: invalid instruction
 dsb ish
 ^
arch/arm/mm/tlb-v7.S:84:2: error: invalid instruction
 dsb ish
 ^
arch/arm/mm/tlb-v7.S:85:2: error: instruction requires: data-barriers
 isb
 ^

similar to 7548bf8

diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 3510503bc5e6..6e9b54714500 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -73,7 +73,6 @@ obj-$(CONFIG_CPU_TLB_V7)      += tlb-v7.o
 obj-$(CONFIG_CPU_TLB_FA)       += tlb-fa.o
 
 AFLAGS_tlb-v6.o                :=-Wa,-march=armv6
-AFLAGS_tlb-v7.o                :=-Wa,-march=armv7-a
 
 obj-$(CONFIG_CPU_ARM7TDMI)     += proc-arm7tdmi.o
 obj-$(CONFIG_CPU_ARM720T)      += proc-arm720.o
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
index 1bb28d7db567..2643e2f51b6a 100644
--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -16,6 +16,8 @@
 #include <asm/tlbflush.h>
 #include "proc-macros.S"
 
+.arch armv7-a
+
 /*
  *     v7wbi_flush_user_tlb_range(start, end, vma)
  *

fixes the error. cc @jcai19

@nickdesaulniers nickdesaulniers added [PATCH] Exists There is a patch that fixes this issue [TOOL] integrated-as The issue is relevant to LLVM integrated assembler [ARCH] arm32 This bug impacts ARCH=arm [CONFIG] allyesconfig Issue affects allyesconfig on certain architectures [BUG] linux A bug that should be fixed in the mainline kernel. labels Nov 9, 2020
@nickdesaulniers
Copy link
Member Author

eh, this is pretty common due to commit aff7b4f ("ARM: Ensure ARMv6/7 mm files are built using appropriate assembler options")

@nickdesaulniers
Copy link
Member Author

tempted to mark this a dup of #957.

@nickdesaulniers
Copy link
Member Author

Note that arch/arm64/Makefile has code like:

 91 ifeq ($(CONFIG_AS_HAS_PAC), y)                                                                                                                                                                                                         
 92 asm-arch := armv8.3-a                                                                                                                                                                                                                  
 93 endif                                                                                                                                                                                                                                  
 94 endif                                                                                                                                                                                                                                  
 95                                                                                                                                                                                                                                        
 96 KBUILD_CFLAGS += $(branch-prot-flags-y)                                                                                                                                                                                                
 97                                                                                                                                                                                                                                        
 98 ifeq ($(CONFIG_AS_HAS_ARMV8_4), y)                                                                                                                                                                                                     
 99 # make sure to pass the newest target architecture to -march.                                                                                                                                                                          
100 asm-arch := armv8.4-a                                                                                                                                                                                                                  
101 endif                                                                                                                                                                                                                                  
102                                                                                                                                                                                                                                        
103 ifdef asm-arch                                                                                                                                                                                                                         
104 KBUILD_CFLAGS += -Wa,-march=$(asm-arch) \                                                                                                                                                                                              
105        -DARM64_ASM_ARCH='"$(asm-arch)"'                                                                                                                                                                                                
106 endif 

and it seems like the Kconfig checks are working, so is it the case that we support -Wa,-march= for aarch64 but not 32b arm?

@nathanchance
Copy link
Member

Isn't the issue that -Wa,... is not used with the integrated assembler? That block was added due to the outcome of #1106.

@nickdesaulniers
Copy link
Member Author

@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Jan 27, 2021

https://llvm.org/pr48894

@nickdesaulniers nickdesaulniers added the Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. label Jan 27, 2021
@nickdesaulniers
Copy link
Member Author

ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make LLVM=1 LLVM_IAS=1 -j72 defconfig enabled both

CONFIG_CPU_32v6K=y                                                                                                                                                         
CONFIG_CPU_32v7=y    

cc @arndb should those be mutually exclusive?

@nickdesaulniers
Copy link
Member Author

Modifying the kernel would involve touching at least 20 .S sources, and their Makefiles.

$ ag AFLAGS | grep march
mm/Makefile:36:AFLAGS_abort-ev6.o       :=-Wa,-march=armv6k
mm/Makefile:37:AFLAGS_abort-ev7.o       :=-Wa,-march=armv7-a
mm/Makefile:52:AFLAGS_cache-v6.o        :=-Wa,-march=armv6
mm/Makefile:53:AFLAGS_cache-v7.o        :=-Wa,-march=armv7-a
mm/Makefile:54:AFLAGS_cache-v7m.o       :=-Wa,-march=armv7-m
mm/Makefile:75:AFLAGS_tlb-v6.o          :=-Wa,-march=armv6
mm/Makefile:76:AFLAGS_tlb-v7.o          :=-Wa,-march=armv7-a
mm/Makefile:104:AFLAGS_proc-v6.o        :=-Wa,-march=armv6
mm/Makefile:105:AFLAGS_proc-v7.o        :=-Wa,-march=armv7-a
mach-npcm/Makefile:2:AFLAGS_headsmp.o           += -march=armv7-a
kernel/Makefile:102:AFLAGS_hyp-stub.o           :=-Wa,-march=armv7-a
mach-imx/Makefile:39:AFLAGS_headsmp.o :=-Wa,-march=armv7-a
mach-imx/Makefile:53:AFLAGS_suspend-imx6.o :=-Wa,-march=armv7-a
mach-imx/Makefile:58:AFLAGS_resume-imx6.o :=-Wa,-march=armv7-a
boot/compressed/Makefile:196:AFLAGS_hyp-stub.o := -Wa,-march=armv7-a
mach-at91/Makefile:17:AFLAGS_pm_suspend.o := -march=armv7-a
lib/Makefile:40:  AFLAGS_delay-loop.o           += -march=armv4
mach-mvebu/Makefile:4:AFLAGS_coherency_ll.o             := -Wa,-march=armv7-a
common/Makefile:17:AFLAGS_mcpm_head.o           := -march=armv7-a
common/Makefile:18:AFLAGS_vlock.o                       := -march=armv7-a
$ ag AFLAGS | grep march | wc -l
20

@arndb
Copy link

arndb commented Jan 27, 2021

cc @arndb should those be mutually exclusive?

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.

@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Feb 2, 2021

@DavidSpickett at Linaro also has a patch for LLVM: https://reviews.llvm.org/D95872. I'll try to get it reviewed and tested asap.

@nickdesaulniers
Copy link
Member Author

@arndb
Copy link

arndb commented Feb 27, 2021

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
clang: warning: argument unused during compilation: '-march=armv6k' [-Wunused-command-line-argument]

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.

@nickdesaulniers
Copy link
Member Author

That looks like a separate issue. Let's track it in #1315.

nathanchance added a commit to nathanchance/continuous-integration2 that referenced this issue Apr 26, 2021
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>
fengguang pushed a commit to 0day-ci/linux that referenced this issue Oct 9, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Nov 18, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Nov 23, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Nov 24, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Nov 25, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Nov 26, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Nov 29, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Nov 30, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 3, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 7, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 8, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 14, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 15, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 16, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 17, 2021
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>
roxell pushed a commit to roxell/linux that referenced this issue Dec 20, 2021
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>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue May 16, 2022
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>
intel-lab-lkp pushed a commit to intel-lab-lkp/linux that referenced this issue Oct 17, 2022
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>
jonhunter pushed a commit to jonhunter/linux that referenced this issue Nov 9, 2022
…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>
cristibirsan pushed a commit to linux4microchip/linux that referenced this issue Feb 15, 2023
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] arm32 This bug impacts ARCH=arm [BUG] linux A bug that should be fixed in the mainline kernel. [CONFIG] allyesconfig Issue affects allyesconfig on certain architectures [FIXED][LLVM] 13 This bug was fixed in LLVM 13.x Reported upstream This bug was filed on LLVM’s issue tracker, Phabricator, or the kernel mailing list. [TOOL] integrated-as The issue is relevant to LLVM integrated assembler
Projects
None yet
Development

No branches or pull requests

3 participants