diff options
| author | Marek Vasut <marex@denx.de> | 2016-02-17 01:29:36 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-18 07:39:30 +0000 |
| commit | c9e5e347f74767ef66d9a477e648b39ff5d66247 (patch) | |
| tree | 9db0e4102368650a252dbde20c3b82995620270f | |
| parent | 012460d4ff714ee75f977c35af7749c5544da7b1 (diff) | |
| download | poky-c9e5e347f74767ef66d9a477e648b39ff5d66247.tar.gz | |
gcc: Backport nios2 r31 fix
Backport a fix from GCC mainline, which fixes libpcre 8.38 and expat 2.1.0
build on nios2. The example of the fixed error follows:
| ./nios2-poky-linux-libtool --silent --mode=compile nios2-poky-linux-gcc -mel -mhw-div -mhw-mul --sysroot=/mnt/work/Yocto/build-nios2/tmp/sysroots/10m50 -I../expat-2.1.0/lib -I. -O2 -pipe -g -feliminate-unused-debug-types -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions -DHAVE_EXPAT_CONFIG_H -o lib/xmltok.lo -c ../expat-2.1.0/lib/xmltok.c
| {standard input}: Assembler messages:
| {standard input}:4988: Error: r31 cannot be used with jmp; use ret instead
| {standard input}:9703: Error: r31 cannot be used with jmp; use ret instead
| {standard input}:20068: Error: r31 cannot be used with jmp; use ret instead
| {standard input}:24020: Error: r31 cannot be used with jmp; use ret instead
| Makefile:196: recipe for target 'lib/xmltok.lo' failed
| make: *** [lib/xmltok.lo] Error 1
| WARNING: exit code 1 from a shell command.
(From OE-Core rev: 24b0f08ae4fbaf285d494ab53a3b168a6dd17b20)
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-5.3.inc | 1 | ||||
| -rw-r--r-- | meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch | 103 |
2 files changed, 104 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-5.3.inc b/meta/recipes-devtools/gcc/gcc-5.3.inc index a653e5c4ff..a522bc40c2 100644 --- a/meta/recipes-devtools/gcc/gcc-5.3.inc +++ b/meta/recipes-devtools/gcc/gcc-5.3.inc | |||
| @@ -81,6 +81,7 @@ SRC_URI = "\ | |||
| 81 | file://0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch \ | 81 | file://0049-Disable-the-weak-reference-logic-in-gthr.h-for-os-ge.patch \ |
| 82 | file://0050-powerpc-pass-secure-plt-to-the-linker.patch \ | 82 | file://0050-powerpc-pass-secure-plt-to-the-linker.patch \ |
| 83 | file://0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \ | 83 | file://0051-Ignore-fdebug-prefix-map-in-producer-string-by-Danie.patch \ |
| 84 | file://0052-nios2-use-ret-with-r31.patch \ | ||
| 84 | " | 85 | " |
| 85 | 86 | ||
| 86 | BACKPORTS = "" | 87 | BACKPORTS = "" |
diff --git a/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch b/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch new file mode 100644 index 0000000000..f3cb47fd13 --- /dev/null +++ b/meta/recipes-devtools/gcc/gcc-5.3/0052-nios2-use-ret-with-r31.patch | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | From 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4> | ||
| 3 | Date: Tue, 12 May 2015 15:57:22 +0000 | ||
| 4 | Subject: [PATCH] 2015-05-12 Chung-Lin Tang <cltang@codesourcery.com> | ||
| 5 | Sandra Loosemore <sandra@codesourcery.com> | ||
| 6 | |||
| 7 | gcc/ | ||
| 8 | * config/nios2/nios2.h (enum reg_class): Add IJMP_REGS enum | ||
| 9 | value. | ||
| 10 | (REG_CLASS_NAMES): Add "IJMP_REGS". | ||
| 11 | (REG_CLASS_CONTENTS): Add new entry for IJMP_REGS. | ||
| 12 | * config/nios2/nios2.md (indirect_jump,*tablejump): Adjust to | ||
| 13 | use new "c" register constraint. | ||
| 14 | * config/nios2/constraint.md (c): New register constraint | ||
| 15 | corresponding to IJMP_REGS. | ||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@223082 138bc75d-0d04-0410-961f-82ee72b054a4 | ||
| 20 | Signed-off-by: Marek Vasut <marex@denx.de> | ||
| 21 | Upstream-Status: Backport [ git://gcc.gnu.org/git/gcc.git 1d67120d95c2c6e0ed4f7357d1cc62887eaba463 ] | ||
| 22 | --- | ||
| 23 | gcc/ChangeLog | 12 ++++++++++++ | ||
| 24 | gcc/config/nios2/constraints.md | 3 +++ | ||
| 25 | gcc/config/nios2/nios2.h | 11 +++++++---- | ||
| 26 | gcc/config/nios2/nios2.md | 4 ++-- | ||
| 27 | 4 files changed, 24 insertions(+), 6 deletions(-) | ||
| 28 | |||
| 29 | diff --git a/gcc/config/nios2/constraints.md b/gcc/config/nios2/constraints.md | ||
| 30 | index f4bd9f7..735f892 100644 | ||
| 31 | --- a/gcc/config/nios2/constraints.md | ||
| 32 | +++ b/gcc/config/nios2/constraints.md | ||
| 33 | @@ -39,6 +39,9 @@ | ||
| 34 | |||
| 35 | ;; Register constraints | ||
| 36 | |||
| 37 | +(define_register_constraint "c" "IJMP_REGS" | ||
| 38 | + "A register suitable for an indirect jump.") | ||
| 39 | + | ||
| 40 | (define_register_constraint "j" "SIB_REGS" | ||
| 41 | "A register suitable for an indirect sibcall.") | ||
| 42 | |||
| 43 | diff --git a/gcc/config/nios2/nios2.h b/gcc/config/nios2/nios2.h | ||
| 44 | index 510ab5f..ac33978 100644 | ||
| 45 | --- a/gcc/config/nios2/nios2.h | ||
| 46 | +++ b/gcc/config/nios2/nios2.h | ||
| 47 | @@ -173,6 +173,7 @@ enum reg_class | ||
| 48 | { | ||
| 49 | NO_REGS, | ||
| 50 | SIB_REGS, | ||
| 51 | + IJMP_REGS, | ||
| 52 | GP_REGS, | ||
| 53 | ALL_REGS, | ||
| 54 | LIM_REG_CLASSES | ||
| 55 | @@ -183,6 +184,7 @@ enum reg_class | ||
| 56 | #define REG_CLASS_NAMES \ | ||
| 57 | { "NO_REGS", \ | ||
| 58 | "SIB_REGS", \ | ||
| 59 | + "IJMP_REGS", \ | ||
| 60 | "GP_REGS", \ | ||
| 61 | "ALL_REGS" } | ||
| 62 | |||
| 63 | @@ -190,10 +192,11 @@ enum reg_class | ||
| 64 | |||
| 65 | #define REG_CLASS_CONTENTS \ | ||
| 66 | { \ | ||
| 67 | - /* NO_REGS */ { 0, 0}, \ | ||
| 68 | - /* SIB_REGS */ { 0xfe0c, 0}, \ | ||
| 69 | - /* GP_REGS */ {~0, 0}, \ | ||
| 70 | - /* ALL_REGS */ {~0,~0} \ | ||
| 71 | + /* NO_REGS */ { 0, 0}, \ | ||
| 72 | + /* SIB_REGS */ { 0xfe0c, 0}, \ | ||
| 73 | + /* IJMP_REGS */ { 0x7fffffff, 0}, \ | ||
| 74 | + /* GP_REGS */ {~0, 0}, \ | ||
| 75 | + /* ALL_REGS */ {~0,~0} \ | ||
| 76 | } | ||
| 77 | |||
| 78 | |||
| 79 | diff --git a/gcc/config/nios2/nios2.md b/gcc/config/nios2/nios2.md | ||
| 80 | index 7b35d269..36ef101 100644 | ||
| 81 | --- a/gcc/config/nios2/nios2.md | ||
| 82 | +++ b/gcc/config/nios2/nios2.md | ||
| 83 | @@ -697,7 +697,7 @@ | ||
| 84 | ; check or adjust for overflow. | ||
| 85 | |||
| 86 | (define_insn "indirect_jump" | ||
| 87 | - [(set (pc) (match_operand:SI 0 "register_operand" "r"))] | ||
| 88 | + [(set (pc) (match_operand:SI 0 "register_operand" "c"))] | ||
| 89 | "" | ||
| 90 | "jmp\\t%0" | ||
| 91 | [(set_attr "type" "control")]) | ||
| 92 | @@ -811,7 +811,7 @@ | ||
| 93 | |||
| 94 | (define_insn "*tablejump" | ||
| 95 | [(set (pc) | ||
| 96 | - (match_operand:SI 0 "register_operand" "r")) | ||
| 97 | + (match_operand:SI 0 "register_operand" "c")) | ||
| 98 | (use (label_ref (match_operand 1 "" "")))] | ||
| 99 | "" | ||
| 100 | "jmp\\t%0" | ||
| 101 | -- | ||
| 102 | 2.7.0 | ||
| 103 | |||
