Skip to content

Commit dd1f630

Browse files
fvincenzowilldeacon
authored andcommitted
arm64: lse: Fix LSE atomics with LLVM
Commit e0d5896 ("arm64: lse: fix LSE atomics with LLVM's integrated assembler") broke the build when clang is used in connjunction with the binutils assembler ("-no-integrated-as"). This happens because __LSE_PREAMBLE is defined as ".arch armv8-a+lse", which overrides the version of the CPU architecture passed via the "-march" paramter to gas: $ aarch64-none-linux-gnu-as -EL -I ./arch/arm64/include -I ./arch/arm64/include/generated -I ./include -I ./include -I ./arch/arm64/include/uapi -I ./arch/arm64/include/generated/uapi -I ./include/uapi -I ./include/generated/uapi -I ./init -I ./init -march=armv8.3-a -o init/do_mounts.o /tmp/do_mounts-d7992a.s /tmp/do_mounts-d7992a.s: Assembler messages: /tmp/do_mounts-d7992a.s:1959: Error: selected processor does not support `autiasp' /tmp/do_mounts-d7992a.s:2021: Error: selected processor does not support `paciasp' /tmp/do_mounts-d7992a.s:2157: Error: selected processor does not support `autiasp' /tmp/do_mounts-d7992a.s:2175: Error: selected processor does not support `paciasp' /tmp/do_mounts-d7992a.s:2494: Error: selected processor does not support `autiasp' Fix the issue by replacing ".arch armv8-a+lse" with ".arch_extension lse". Sami confirms that the clang integrated assembler does now support the '.arch_extension' directive, so this change will be fine even for LTO builds in future. Fixes: e0d5896 ("arm64: lse: fix LSE atomics with LLVM's integrated assembler") Cc: Catalin Marinas <[email protected]> Cc: Will Deacon <[email protected]> Reported-by: Amit Kachhap <[email protected]> Tested-by: Sami Tolvanen <[email protected]> Signed-off-by: Vincenzo Frascino <[email protected]> Signed-off-by: Will Deacon <[email protected]>
1 parent d917718 commit dd1f630

File tree

1 file changed

+1
-1
lines changed
  • arch/arm64/include/asm

1 file changed

+1
-1
lines changed

arch/arm64/include/asm/lse.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#ifdef CONFIG_ARM64_LSE_ATOMICS
88

9-
#define __LSE_PREAMBLE ".arch armv8-a+lse\n"
9+
#define __LSE_PREAMBLE ".arch_extension lse\n"
1010

1111
#include <linux/compiler_types.h>
1212
#include <linux/export.h>

0 commit comments

Comments
 (0)