Skip to content

Commit 64ee84c

Browse files
masahir0ywilldeacon
authored andcommitted
arm64: move warning about toolchains to archprepare
Commit 987fdfe ("arm64: move --fix-cortex-a53-843419 linker test to Kconfig") fixed the false-positive warning in the installation step. Yet, there are some cases where this false-positive is shown. For example, you can see it when you cross 987fdfe during git-bisect. $ git checkout 987fdfe^ [ snip ] $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig all [ snip ] $ git checkout v5.13 [ snip] $ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig all [ snip ] arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum In the stale include/config/auto.config, CONFIG_ARM64_ERRATUM_843419=y is set without CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419, so the warning is displayed while parsing the Makefiles. Make will restart with the updated include/config/auto.config, hence CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419 will be set eventually, but this warning is a surprise for users. Commit 25896d0 ("x86/build: Fix compiler support check for CONFIG_RETPOLINE") addressed a similar issue. Move $(warning ...) out of the parse stage of Makefiles. The same applies to CONFIG_ARM64_USE_LSE_ATOMICS. Signed-off-by: Masahiro Yamada <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent e30e8d4 commit 64ee84c

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

arch/arm64/Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,11 @@ LDFLAGS_vmlinux += -shared -Bsymbolic -z notext \
2121
endif
2222

2323
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
24-
ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
25-
$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
26-
else
24+
ifeq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
2725
LDFLAGS_vmlinux += --fix-cortex-a53-843419
2826
endif
2927
endif
3028

31-
ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS), y)
32-
ifneq ($(CONFIG_ARM64_LSE_ATOMICS), y)
33-
$(warning LSE atomics not supported by binutils)
34-
endif
35-
endif
36-
3729
cc_has_k_constraint := $(call try-run,echo \
3830
'int main(void) { \
3931
asm volatile("and w0, w0, %w0" :: "K" (4294967295)); \
@@ -176,6 +168,17 @@ vdso_install:
176168

177169
archprepare:
178170
$(Q)$(MAKE) $(build)=arch/arm64/tools kapi
171+
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
172+
ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
173+
@echo "warning: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum" >&2
174+
endif
175+
endif
176+
ifeq ($(CONFIG_ARM64_USE_LSE_ATOMICS),y)
177+
ifneq ($(CONFIG_ARM64_LSE_ATOMICS),y)
178+
@echo "warning: LSE atomics not supported by binutils" >&2
179+
endif
180+
endif
181+
179182

180183
# We use MRPROPER_FILES and CLEAN_FILES now
181184
archclean:

0 commit comments

Comments
 (0)