summaryrefslogtreecommitdiffstats
path: root/arch/arm64/Makefile
diff options
context:
space:
mode:
authorWill Deacon <will@kernel.org>2019-08-30 13:55:39 +0200
committerWill Deacon <will@kernel.org>2019-08-30 13:55:39 +0200
commit61b7cddfe861f239bf39ab19a065e29b58153a80 (patch)
treee4930ac4950b72203cfebfc3b6565b346747b33f /arch/arm64/Makefile
parentMerge branches 'for-next/52-bit-kva', 'for-next/cpu-topology', 'for-next/erro... (diff)
parentarm64: atomics: Use K constraint when toolchain appears to support it (diff)
downloadlinux-61b7cddfe861f239bf39ab19a065e29b58153a80.tar.xz
linux-61b7cddfe861f239bf39ab19a065e29b58153a80.zip
Merge branch 'for-next/atomics' into for-next/core
* for-next/atomics: (10 commits) Rework LSE instruction selection to use static keys instead of alternatives
Diffstat (limited to 'arch/arm64/Makefile')
-rw-r--r--arch/arm64/Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 2847b36f72ed..f843d298792d 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -39,6 +39,12 @@ $(warning LSE atomics not supported by binutils)
endif
endif
+cc_has_k_constraint := $(call try-run,echo \
+ 'int main(void) { \
+ asm volatile("and w0, w0, %w0" :: "K" (4294967295)); \
+ return 0; \
+ }' | $(CC) -S -x c -o "$$TMP" -,,-DCONFIG_CC_HAS_K_CONSTRAINT=1)
+
ifeq ($(CONFIG_ARM64), y)
brokengasinst := $(call as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n,,-DCONFIG_BROKEN_GAS_INST=1)
@@ -63,7 +69,8 @@ ifeq ($(CONFIG_GENERIC_COMPAT_VDSO), y)
endif
endif
-KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) $(compat_vdso)
+KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr) $(brokengasinst) \
+ $(compat_vdso) $(cc_has_k_constraint)
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) $(compat_vdso)