• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From 0e1b74b6ffbeadab5351d6a426e530886e00aa69 Mon Sep 17 00:00:00 2001
2From: Lai Wei-Chih <Robert.Lai@mediatek.com>
3Date: Mon, 6 Apr 2015 13:59:54 +0800
4Subject: [PATCH] Modify LINK_SPEC to pass --fix-cortex-a53-843419 as default.
5
6For NDK toolchains, always enable the fix of cortex-a53 erratum 843419.
7Use -mno-fix-cortex-a53-843419 to disable this workaround.
8
9Change-Id: I69b8a71113abb172138bf0986697a94e42a5117e
10---
11 gcc-4.9/gcc/config/aarch64/aarch64-elf-raw.h | 6 +++++-
12 gcc-4.9/gcc/config/aarch64/aarch64-linux.h   | 7 ++++++-
13 gcc-4.9/gcc/config/aarch64/aarch64.c         | 5 +++++
14 gcc-4.9/gcc/config/aarch64/aarch64.opt       | 4 ++++
15 4 files changed, 20 insertions(+), 2 deletions(-)
16
17diff --git a/gcc-4.9/gcc/config/aarch64/aarch64-elf-raw.h b/gcc-4.9/gcc/config/aarch64/aarch64-elf-raw.h
18index eafdd55..99611c5 100644
19--- a/gcc-4.9/gcc/config/aarch64/aarch64-elf-raw.h
20+++ b/gcc-4.9/gcc/config/aarch64/aarch64-elf-raw.h
21@@ -33,10 +33,14 @@
22   " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}"
23 #endif
24
25+#define CA53_ERR_843419_SPEC \
26+  " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}"
27+
28 #ifndef LINK_SPEC
29 #define LINK_SPEC "%{mbig-endian:-EB} %{mlittle-endian:-EL} -X \
30   -maarch64elf%{mabi=ilp32*:32}%{mbig-endian:b}" \
31-  CA53_ERR_835769_SPEC
32+  CA53_ERR_835769_SPEC \
33+  CA53_ERR_843419_SPEC
34 #endif
35
36 #endif /* GCC_AARCH64_ELF_RAW_H */
37diff --git a/gcc-4.9/gcc/config/aarch64/aarch64-linux.h b/gcc-4.9/gcc/config/aarch64/aarch64-linux.h
38index b77becd..7b77c42 100644
39--- a/gcc-4.9/gcc/config/aarch64/aarch64-linux.h
40+++ b/gcc-4.9/gcc/config/aarch64/aarch64-linux.h
41@@ -48,7 +48,12 @@
42   " %{mfix-cortex-a53-835769:--fix-cortex-a53-835769}"
43 #endif
44
45-#define LINUX_TARGET_LINK_SPEC LINUX_TARGET_LINK_SPEC0 CA53_ERR_835769_SPEC
46+#define CA53_ERR_843419_SPEC \
47+  " %{!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419}"
48+
49+#define LINUX_TARGET_LINK_SPEC LINUX_TARGET_LINK_SPEC0 \
50+                               CA53_ERR_835769_SPEC \
51+                               CA53_ERR_843419_SPEC
52
53 #define LINK_SPEC LINUX_TARGET_LINK_SPEC
54
55diff --git a/gcc-4.9/gcc/config/aarch64/aarch64.c b/gcc-4.9/gcc/config/aarch64/aarch64.c
56index 2ff6c7c..0efb7e4 100644
57--- a/gcc-4.9/gcc/config/aarch64/aarch64.c
58+++ b/gcc-4.9/gcc/config/aarch64/aarch64.c
59@@ -5265,6 +5265,11 @@ aarch64_override_options (void)
60 #endif
61     }
62
63+  if (aarch64_fix_a53_err843419 == 2)
64+    {
65+      aarch64_fix_a53_err843419 = 1;
66+    }
67+
68   aarch64_override_options_after_change ();
69
70   if (TARGET_ANDROID)
71diff --git a/gcc-4.9/gcc/config/aarch64/aarch64.opt b/gcc-4.9/gcc/config/aarch64/aarch64.opt
72index fc0307e..ca27f50 100644
73--- a/gcc-4.9/gcc/config/aarch64/aarch64.opt
74+++ b/gcc-4.9/gcc/config/aarch64/aarch64.opt
75@@ -71,6 +71,10 @@ mfix-cortex-a53-835769
76 Target Report Var(aarch64_fix_a53_err835769) Init(2)
77 Workaround for ARM Cortex-A53 Erratum number 835769
78
79+mfix-cortex-a53-843419
80+Target Report Var(aarch64_fix_a53_err843419) Init(2)
81+Workaround for ARM Cortex-A53 Erratum number 843419
82+
83 mlittle-endian
84 Target Report RejectNegative InverseMask(BIG_END)
85 Assume target CPU is configured as little endian
86--
871.9.1
88
89