summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSami Tolvanen <samitolvanen@google.com>2017-11-01 08:42:49 -0700
committerBruno Martins <bgcngm@gmail.com>2022-10-28 15:57:23 +0100
commitba3368756abf2c0d4b4bc31523e847955bb439da (patch)
tree2ce22b189fb1b5b69989a82f604892f8445fab5d
parent6dacd7e737fb520a4e4a41dd4e746007764f1485 (diff)
BACKPORT: arm64: explicitly pass --no-fix-cortex-a53-843419 to GNU gold
Some versions of GNU gold are known to produce broken code with --fix-cortex-a53-843419 as explained in this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=21491 If ARM64_ERRATUM_843419 is disabled and we're using GNU gold, pass --no-fix-cortex-a53-843419 to the linker to ensure the erratum fix is not used even if the linker is configured to enable it by default. This change also adds a warning if the erratum fix is enabled and gold version <1.14 is used. Bug: 62093296 Bug: 67506682 Change-Id: I5669fa920292adc0fd973035f27dafd4a76d919a (am from https://patchwork.kernel.org/patch/10085777/) Signed-off-by: Sami Tolvanen <samitolvanen@google.com> (cherry picked from commit 5c41c483accd942c053cc232148d7eb557f5a049) Signed-off-by: Dan Aloni <daloni@magicleap.com> Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
-rw-r--r--arch/arm64/Makefile9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index d94274a058dc..295008d86e6d 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -23,8 +23,17 @@ ifeq ($(CONFIG_ARM64_ERRATUM_843419),y)
ifeq ($(call ld-option, --fix-cortex-a53-843419),)
$(warning ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum)
else
+ ifeq ($(call gold-ifversion, -lt, 114000000, y), y)
+$(warning This version of GNU gold may generate incorrect code with --fix-cortex-a53-843419;\
+ see https://sourceware.org/bugzilla/show_bug.cgi?id=21491)
+ endif
LDFLAGS_vmlinux += --fix-cortex-a53-843419
endif
+else
+ ifeq ($(ld-name),gold)
+# Pass --no-fix-cortex-a53-843419 to ensure the erratum fix is disabled
+LDFLAGS += --no-fix-cortex-a53-843419
+ endif
endif
KBUILD_DEFCONFIG := defconfig