[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210324071128.1723273-1-masahiroy@kernel.org>
Date: Wed, 24 Mar 2021 16:11:28 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org,
Masahiro Yamada <masahiroy@...nel.org>,
Nathan Chancellor <nathan@...nel.org>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>
Subject: [PATCH] arm64: move --fix-cortex-a53-843419 linker test to Kconfig
$(call ld-option, --fix-cortex-a53-843419) in arch/arm64/Makefile is
evaluated every time even for Make targets that do not need the linker,
such as "make ARCH=arm64 install".
Recently, the Kbuild tree queued up a patch to avoid needless
compiler/linker flag evaluation. I beleive it is a good improvement
itself, but causing a false-positive warning for arm64 installation
in linux-next. (Thanks to Nathan for the report)
Kconfig can test the linker capability just once, and store it in the
.config file. The build and installation steps that follow do not need
to test the liniker over again.
Reported-by: Nathan Chancellor <nathan@...nel.org>
Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
---
I was not sure what the preferred CONFIG option name is.
Please suggest a one if you have a better idea.
arch/arm64/Kconfig | 3 +++
arch/arm64/Makefile | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 5656e7aacd69..4a33428de8ac 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -521,6 +521,9 @@ config ARM64_ERRATUM_843419
If unsure, say Y.
+config ARM64_LD_HAS_FIX_ERRATUM_843419
+ def_bool $(ld-option,--fix-cortex-a53-843419)
+
config ARM64_ERRATUM_1024718
bool "Cortex-A55: 1024718: Update of DBM/AP bits without break before make might result in incorrect update"
default y
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 5b84aec31ed3..7ef44478560d 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -21,7 +21,7 @@ LDFLAGS_vmlinux += -shared -Bsymbolic -z notext \
endif
ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
- ifeq ($(call ld-option, --fix-cortex-a53-843419),)
+ ifneq ($(CONFIG_ARM64_LD_HAS_FIX_ERRATUM_843419),y)
$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
else
LDFLAGS_vmlinux += --fix-cortex-a53-843419
--
2.27.0
Powered by blists - more mailing lists