Browse Source

add different patches to gcc/binutils to fix issues with cris/microblaze/ia64/tile

Waldemar Brodkorb 7 years ago
parent
commit
2f5000670a

+ 1 - 0
target/config/Config.in.binutils

@@ -6,6 +6,7 @@ prompt "Binutils version"
 default ADK_TOOLCHAIN_BINUTILS_ARC if ADK_TARGET_ARCH_ARC
 default ADK_TOOLCHAIN_BINUTILS_NDS32 if ADK_TARGET_ARCH_NDS32
 default ADK_TOOLCHAIN_BINUTILS_2_20_1 if ADK_TARGET_ARCH_AVR32
+default ADK_TOOLCHAIN_BINUTILS_2_26_1 if ADK_TARGET_ARCH_MICROBLAZE
 default ADK_TOOLCHAIN_BINUTILS_2_28
 
 config ADK_TOOLCHAIN_BINUTILS_GIT

+ 1 - 0
target/config/Config.in.compiler

@@ -24,6 +24,7 @@ default ADK_TOOLCHAIN_GCC_4_4 if ADK_TARGET_ARCH_AVR32
 default ADK_TOOLCHAIN_GCC_4_9 if ADK_TARGET_ARCH_LM32 && !ADK_TARGET_LIB_NEWLIB
 default ADK_TOOLCHAIN_GCC_4_9 if ADK_TARGET_LIB_GLIBC && ADK_TARGET_ARCH_SH
 default ADK_TOOLCHAIN_GCC_4_9 if ADK_TARGET_SYSTEM_KINETIS_K70
+default ADK_TOOLCHAIN_GCC_5 if ADK_TARGET_ARCH_MICROBLAZE
 default ADK_TOOLCHAIN_GCC_6
 
 config ADK_TOOLCHAIN_GCC_GIT

+ 15 - 0
toolchain/binutils/patches/2.28/crisv10-assertion-remove.patch

@@ -0,0 +1,15 @@
+diff -Nur binutils-2.28.orig/bfd/elf32-cris.c binutils-2.28/bfd/elf32-cris.c
+--- binutils-2.28.orig/bfd/elf32-cris.c	2017-03-02 09:23:53.000000000 +0100
++++ binutils-2.28/bfd/elf32-cris.c	2017-03-05 09:38:18.895667626 +0100
+@@ -2713,11 +2713,6 @@
+ {
+   struct bfd_link_info *info = (struct bfd_link_info *) p;
+ 
+-  /* A GOTPLT reloc, when activated, is supposed to be included into
+-     the PLT refcount.  */
+-  BFD_ASSERT (h->gotplt_refcount == 0
+-	      || h->gotplt_refcount <= h->root.plt.refcount);
+-
+   /* If nobody wanted a GOTPLT with this symbol, we're done.  */
+   if (h->gotplt_refcount <= 0)
+     return TRUE;

+ 11 - 0
toolchain/binutils/patches/2.28/microblaze-pr21017.patch

@@ -0,0 +1,11 @@
+diff -Nur binutils-2.28.orig/bfd/elf32-microblaze.c binutils-2.28/bfd/elf32-microblaze.c
+--- binutils-2.28.orig/bfd/elf32-microblaze.c	2017-03-02 09:23:53.000000000 +0100
++++ binutils-2.28/bfd/elf32-microblaze.c	2017-03-06 02:57:42.760601301 +0100
+@@ -2353,6 +2353,7 @@
+         dogottls:
+           sec->has_tls_reloc = 1;
+ 	  /* Fall through.  */
++	case R_MICROBLAZE_GOTOFF_64:
+         case R_MICROBLAZE_GOT_64:
+           if (htab->elf.sgot == NULL)
+             {

+ 17 - 0
toolchain/gcc/patches/6.3.0/ia64-fix-libgcc.patch

@@ -0,0 +1,17 @@
+diff -Nur gcc-6.3.0.orig/libgcc/config/ia64/fde-glibc.c gcc-6.3.0/libgcc/config/ia64/fde-glibc.c
+--- gcc-6.3.0.orig/libgcc/config/ia64/fde-glibc.c	2016-01-04 15:30:50.000000000 +0100
++++ gcc-6.3.0/libgcc/config/ia64/fde-glibc.c	2017-03-05 13:07:33.316600613 +0100
+@@ -25,6 +25,8 @@
+ /* Locate the FDE entry for a given address, using glibc ld.so routines
+    to avoid register/deregister calls at DSO load/unload.  */
+ 
++#ifndef inhibit_libc
++
+ #ifndef _GNU_SOURCE
+ #define _GNU_SOURCE 1
+ #endif
+@@ -159,3 +161,4 @@
+ 
+   return data.ret;
+ }
++#endif

+ 24 - 0
toolchain/gcc/patches/6.3.0/tilegx-fix.patch

@@ -0,0 +1,24 @@
+diff -Nur gcc-5.3.0.orig/gcc/config/tilegx/linux.h gcc-5.3.0/gcc/config/tilegx/linux.h
+--- gcc-5.3.0.orig/gcc/config/tilegx/linux.h	2015-01-05 13:33:28.000000000 +0100
++++ gcc-5.3.0/gcc/config/tilegx/linux.h	2016-04-29 07:14:10.534973350 +0200
+@@ -55,8 +55,6 @@
+ /* For __clear_cache in libgcc2.c.  */
+ #ifdef IN_LIBGCC2
+ 
+-#include <arch/icache.h>
+-
+ /* Use the minimum page size of 4K.  Alternatively we can call
+    getpagesize() but it introduces a libc dependence.  */
+ #undef CLEAR_INSN_CACHE
+diff -Nur gcc-5.3.0.orig/libgcc/config/tilepro/atomic.h gcc-5.3.0/libgcc/config/tilepro/atomic.h
+--- gcc-5.3.0.orig/libgcc/config/tilepro/atomic.h	2015-01-05 13:33:28.000000000 +0100
++++ gcc-5.3.0/libgcc/config/tilepro/atomic.h	2016-04-29 07:15:11.149301459 +0200
+@@ -93,7 +93,7 @@
+ #endif
+ 
+ #ifdef __tilegx__
+-#include <arch/spr_def.h>
++#define SPR_CMPEXCH_VALUE 0x2780 
+ #else
+ #include <asm/unistd.h>
+ #endif