diff options
author | Nathan Rossi <nathan@nathanrossi.com> | 2016-09-27 21:56:32 +1000 |
---|---|---|
committer | Nathan Rossi <nathan@nathanrossi.com> | 2016-10-11 21:10:52 +1000 |
commit | d904dafd51dd0f1ec2264b8dbcb7b637b4c5b11a (patch) | |
tree | 04de69bd64899287548b3eac66f8aa9a8b4f1fb6 /recipes-microblaze | |
parent | 59e716bc054d2ca2f3ad138f6fa9043e985e6f3c (diff) | |
download | meta-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.patch | 48 | ||||
-rw-r--r-- | recipes-microblaze/gcc/gcc-source_6.%.bbappend | 1 |
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 @@ | |||
1 | From 3a73b9abccefa81cdee4cdf28f8b3b8fb0ed6c6e Mon Sep 17 00:00:00 2001 | ||
2 | From: Nathan Rossi <nathan@nathanrossi.com> | ||
3 | Date: Tue, 27 Sep 2016 04:14:50 +1000 | ||
4 | Subject: [PATCH] gcc/config/microblaze: Make r21 fixed due to Linux ABI | ||
5 | |||
6 | Commit 6dcad60c0ef48af584395a40feeb256fb82986a8 introduced a change to | ||
7 | how the r20 and r21 registers are handled for MicroBlaze. Specifically | ||
8 | removing the fixed nature of the r21 register. | ||
9 | |||
10 | In the Linux ABI the r21 register is reserved as a fixed register for | ||
11 | the purposes of storing a pointer to the thread related object. This is | ||
12 | of particular importance for libc (glibc and musl) which use this | ||
13 | register and expect it to be fixed for this purpose. | ||
14 | |||
15 | GCC uses the r20 register for GOT pointing. This commit mentioned above | ||
16 | confusingly states it preserved the fixed nature but in fact changes r20 | ||
17 | to be non-fixed. This patch fixes that up. | ||
18 | |||
19 | Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> | ||
20 | Upstream-Status: Pending | ||
21 | --- | ||
22 | gcc/config/microblaze/microblaze.h | 4 ++-- | ||
23 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
24 | |||
25 | diff --git a/gcc/config/microblaze/microblaze.h b/gcc/config/microblaze/microblaze.h | ||
26 | index 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 | -- | ||
47 | 2.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 @@ | |||
3 | FILESEXTRAPATHS_append := "${THISDIR}/files:" | 3 | FILESEXTRAPATHS_append := "${THISDIR}/files:" |
4 | SRC_URI_append = " \ | 4 | SRC_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 | ||