Skip to content

Commit 8bf9284

Browse files
murzinvwilldeacon
authored andcommitted
arm64: Turn "broken gas inst" into real config option
Use the new 'as-instr' Kconfig macro to define CONFIG_BROKEN_GAS_INST directly, making it available everywhere. Signed-off-by: Vladimir Murzin <[email protected]> [will: Drop redundant 'y if' logic] Signed-off-by: Will Deacon <[email protected]>
1 parent 395af86 commit 8bf9284

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

arch/arm64/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ config ARCH_SUPPORTS_UPROBES
301301
config ARCH_PROC_KCORE_TEXT
302302
def_bool y
303303

304+
config BROKEN_GAS_INST
305+
def_bool !$(as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n)
306+
304307
config KASAN_SHADOW_OFFSET
305308
hex
306309
depends on KASAN

arch/arm64/Makefile

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,15 @@ cc_has_k_constraint := $(call try-run,echo \
4242
return 0; \
4343
}' | $(CC) -S -x c -o "$$TMP" -,,-DCONFIG_CC_HAS_K_CONSTRAINT=1)
4444

45-
ifeq ($(CONFIG_ARM64), y)
46-
brokengasinst := $(call as-instr,1:\n.inst 0\n.rept . - 1b\n\nnop\n.endr\n,,-DCONFIG_BROKEN_GAS_INST=1)
47-
48-
ifneq ($(brokengasinst),)
45+
ifeq ($(CONFIG_BROKEN_GAS_INST),y)
4946
$(warning Detected assembler with broken .inst; disassembly will be unreliable)
50-
endif
5147
endif
5248

53-
KBUILD_CFLAGS += -mgeneral-regs-only $(brokengasinst) \
49+
KBUILD_CFLAGS += -mgeneral-regs-only \
5450
$(compat_vdso) $(cc_has_k_constraint)
5551
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
5652
KBUILD_CFLAGS += $(call cc-disable-warning, psabi)
57-
KBUILD_AFLAGS += $(brokengasinst) $(compat_vdso)
53+
KBUILD_AFLAGS += $(compat_vdso)
5854

5955
KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
6056
KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)

0 commit comments

Comments
 (0)