summaryrefslogtreecommitdiffstats
path: root/recipes-microblaze
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2016-09-27 21:56:32 +1000
committerNathan Rossi <nathan@nathanrossi.com>2016-10-11 21:10:52 +1000
commitd904dafd51dd0f1ec2264b8dbcb7b637b4c5b11a (patch)
tree04de69bd64899287548b3eac66f8aa9a8b4f1fb6 /recipes-microblaze
parent59e716bc054d2ca2f3ad138f6fa9043e985e6f3c (diff)
downloadmeta-xilinx-d904dafd51dd0f1ec2264b8dbcb7b637b4c5b11a.tar.gz
gcc-source: Add patch to fix MicroBlaze ABI bug
Add a patch which fixes a bug in GCC regarding the usage of the r20 and r21 registers specifically for the use in Linux. Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
Diffstat (limited to 'recipes-microblaze')
-rw-r--r--recipes-microblaze/gcc/files/gcc-config-microblaze-Make-r21-fixed-due-to-Linux-AB.patch48
-rw-r--r--recipes-microblaze/gcc/gcc-source_6.%.bbappend1
2 files changed, 49 insertions, 0 deletions
diff --git a/recipes-microblaze/gcc/files/gcc-config-microblaze-Make-r21-fixed-due-to-Linux-AB.patch b/recipes-microblaze/gcc/files/gcc-config-microblaze-Make-r21-fixed-due-to-Linux-AB.patch
new file mode 100644
index 00000000..373b158a
--- /dev/null
+++ b/recipes-microblaze/gcc/files/gcc-config-microblaze-Make-r21-fixed-due-to-Linux-AB.patch
@@ -0,0 +1,48 @@
1From 3a73b9abccefa81cdee4cdf28f8b3b8fb0ed6c6e Mon Sep 17 00:00:00 2001
2From: Nathan Rossi <nathan@nathanrossi.com>
3Date: Tue, 27 Sep 2016 04:14:50 +1000
4Subject: [PATCH] gcc/config/microblaze: Make r21 fixed due to Linux ABI
5
6Commit 6dcad60c0ef48af584395a40feeb256fb82986a8 introduced a change to
7how the r20 and r21 registers are handled for MicroBlaze. Specifically
8removing the fixed nature of the r21 register.
9
10In the Linux ABI the r21 register is reserved as a fixed register for
11the purposes of storing a pointer to the thread related object. This is
12of particular importance for libc (glibc and musl) which use this
13register and expect it to be fixed for this purpose.
14
15GCC uses the r20 register for GOT pointing. This commit mentioned above
16confusingly states it preserved the fixed nature but in fact changes r20
17to be non-fixed. This patch fixes that up.
18
19Signed-off-by: Nathan Rossi <nathan@nathanrossi.com>
20Upstream-Status: Pending
21---
22 gcc/config/microblaze/microblaze.h | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
24
25diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h
26index dbfb6522c7..e115c42839 100644
27--- a/gcc/config/microblaze/microblaze.h
28+++ b/gcc/config/microblaze/microblaze.h
29@@ -253,14 +253,14 @@ extern enum pipeline_type microblaze_pipe;
30 #define FIXED_REGISTERS \
31 { \
32 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, \
33- 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
34+ 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
35 1, 1, 1, 1 \
36 }
37
38 #define CALL_USED_REGISTERS \
39 { \
40 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
41- 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
42+ 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
43 1, 1, 1, 1 \
44 }
45 #define GP_REG_FIRST 0
46--
472.9.3
48
diff --git a/recipes-microblaze/gcc/gcc-source_6.%.bbappend b/recipes-microblaze/gcc/gcc-source_6.%.bbappend
index 50075f0d..76b4f60c 100644
--- a/recipes-microblaze/gcc/gcc-source_6.%.bbappend
+++ b/recipes-microblaze/gcc/gcc-source_6.%.bbappend
@@ -3,5 +3,6 @@
3FILESEXTRAPATHS_append := "${THISDIR}/files:" 3FILESEXTRAPATHS_append := "${THISDIR}/files:"
4SRC_URI_append = " \ 4SRC_URI_append = " \
5 file://microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch \ 5 file://microblaze.md-Improve-adddi3-and-subdi3-insn-definit.patch \
6 file://gcc-config-microblaze-Make-r21-fixed-due-to-Linux-AB.patch \
6 " 7 "
7 8