diff options
Diffstat (limited to 'arch/arm64/include/asm/lse.h')
-rw-r--r-- | arch/arm64/include/asm/lse.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h index eec95768eaad..7bf78372da69 100644 --- a/arch/arm64/include/asm/lse.h +++ b/arch/arm64/include/asm/lse.h @@ -17,7 +17,12 @@ #else /* __ASSEMBLER__ */ +#ifdef CONFIG_LTO_CLANG +#define __LSE_PREAMBLE ".arch armv8-a+lse\n" +#else __asm__(".arch_extension lse"); +#define __LSE_PREAMBLE +#endif /* Move the ll/sc atomics out-of-line */ #define __LL_SC_INLINE notrace @@ -30,7 +35,7 @@ __asm__(".arch_extension lse"); /* In-line patching at runtime */ #define ARM64_LSE_ATOMIC_INSN(llsc, lse) \ - ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS) + ALTERNATIVE(llsc, __LSE_PREAMBLE lse, ARM64_HAS_LSE_ATOMICS) #endif /* __ASSEMBLER__ */ #else /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ |