diff options
Diffstat (limited to 'toolchain/gcc/patches/6.2.0')
-rw-r--r-- | toolchain/gcc/patches/6.2.0/add-crtreloc.frv | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.2.0/bfin-workaround.patch | 15 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.2.0/fix-dwarf-fdpic.patch | 37 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.2.0/fix-m86k-libgcc.patch | 11 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.2.0/frv-remove-write-macro.patch | 52 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.2.0/libgcc_linker-script.patch | 16 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.2.0/uclinux-threads.patch | 13 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.2.0/xtensa-musl.patch | 27 |
8 files changed, 183 insertions, 0 deletions
diff --git a/toolchain/gcc/patches/6.2.0/add-crtreloc.frv b/toolchain/gcc/patches/6.2.0/add-crtreloc.frv new file mode 100644 index 000000000..1fa7024b6 --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/add-crtreloc.frv @@ -0,0 +1,12 @@ +diff -Nur gcc-6.1.0.orig/gcc/config/frv/linux.h gcc-6.1.0/gcc/config/frv/linux.h +--- gcc-6.1.0.orig/gcc/config/frv/linux.h 2016-01-04 15:30:50.000000000 +0100 ++++ gcc-6.1.0/gcc/config/frv/linux.h 2016-07-24 21:22:08.566253376 +0200 +@@ -27,7 +27,7 @@ + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ +- "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \ ++ "%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} crtreloc.o%s \ + crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}" + + #undef ENDFILE_SPEC diff --git a/toolchain/gcc/patches/6.2.0/bfin-workaround.patch b/toolchain/gcc/patches/6.2.0/bfin-workaround.patch new file mode 100644 index 000000000..7b57a285b --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/bfin-workaround.patch @@ -0,0 +1,15 @@ +diff -Nur gcc-6.1.0.orig/libgcc/Makefile.in gcc-6.1.0/libgcc/Makefile.in +--- gcc-6.1.0.orig/libgcc/Makefile.in 2016-02-25 13:23:52.000000000 +0100 ++++ gcc-6.1.0/libgcc/Makefile.in 2016-08-11 21:15:13.841764686 +0200 +@@ -932,7 +932,11 @@ + { $(NM) $(SHLIB_NM_FLAGS) $(libgcc-s-objects); echo %%; \ + cat libgcc.map.in; \ + } | $(AWK) -f $(SHLIB_MKMAP) $(SHLIB_MKMAP_OPTS) > tmp-$@ ++ifeq ($(cpu_type),bfin) ++ sed -e 's/__/_/' tmp-$@ > $@ ++else + mv tmp-$@ $@ ++endif + libgcc_s$(SHLIB_EXT): libgcc.map + mapfile = libgcc.map + endif diff --git a/toolchain/gcc/patches/6.2.0/fix-dwarf-fdpic.patch b/toolchain/gcc/patches/6.2.0/fix-dwarf-fdpic.patch new file mode 100644 index 000000000..315b40668 --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/fix-dwarf-fdpic.patch @@ -0,0 +1,37 @@ +Fix DWARF compilation for FDPIC targets + +Signed-off-by: Waldemar Brodkorb <wbx@openadk.org> + +diff -Nur gcc-6.1.0.orig/libgcc/unwind-dw2-fde-dip.c gcc-6.1.0/libgcc/unwind-dw2-fde-dip.c +--- gcc-6.1.0.orig/libgcc/unwind-dw2-fde-dip.c 2016-01-04 15:30:50.000000000 +0100 ++++ gcc-6.1.0/libgcc/unwind-dw2-fde-dip.c 2016-08-05 02:17:40.424195128 +0200 +@@ -124,7 +124,11 @@ + { + _Unwind_Ptr pc_low; + _Unwind_Ptr pc_high; ++#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__ ++ struct elf32_fdpic_loadaddr load_base; ++#else + _Unwind_Ptr load_base; ++#endif + const ElfW(Phdr) *p_eh_frame_hdr; + const ElfW(Phdr) *p_dynamic; + struct frame_hdr_cache_element *link; +@@ -163,7 +167,7 @@ + struct unw_eh_callback_data *data = (struct unw_eh_callback_data *) ptr; + const ElfW(Phdr) *phdr, *p_eh_frame_hdr, *p_dynamic; + long n, match; +-#ifdef __FRV_FDPIC__ ++#if defined __FRV_FDPIC__ || defined __BFIN_FDPIC__ + struct elf32_fdpic_loadaddr load_base; + #else + _Unwind_Ptr load_base; +@@ -347,7 +351,7 @@ + break; + } + } +-# elif defined __FRV_FDPIC__ && defined __linux__ ++# elif (defined __FRV_FDPIC__ || defined __BFIN_FDPIC__) && defined __linux__ + data->dbase = load_base.got_value; + # else + # error What is DW_EH_PE_datarel base on this platform? diff --git a/toolchain/gcc/patches/6.2.0/fix-m86k-libgcc.patch b/toolchain/gcc/patches/6.2.0/fix-m86k-libgcc.patch new file mode 100644 index 000000000..e8481d549 --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/fix-m86k-libgcc.patch @@ -0,0 +1,11 @@ +diff -Nur gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c gcc-4.9.3/libgcc/config/m68k/linux-atomic.c +--- gcc-4.9.3.orig/libgcc/config/m68k/linux-atomic.c 2014-01-02 23:25:22.000000000 +0100 ++++ gcc-4.9.3/libgcc/config/m68k/linux-atomic.c 2015-11-29 14:42:10.566143595 +0100 +@@ -33,7 +33,6 @@ + using the kernel helper defined below. There is no support for + 64-bit operations yet. */ + +-#include <asm/unistd.h> + #include <stdbool.h> + + #ifndef __NR_atomic_cmpxchg_32 diff --git a/toolchain/gcc/patches/6.2.0/frv-remove-write-macro.patch b/toolchain/gcc/patches/6.2.0/frv-remove-write-macro.patch new file mode 100644 index 000000000..db20d37d7 --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/frv-remove-write-macro.patch @@ -0,0 +1,52 @@ +diff -Nur gcc-6.1.0.orig/gcc/config/frv/frv.h gcc-6.1.0/gcc/config/frv/frv.h +--- gcc-6.1.0.orig/gcc/config/frv/frv.h 2016-01-04 15:30:50.000000000 +0100 ++++ gcc-6.1.0/gcc/config/frv/frv.h 2016-08-16 13:31:32.652520944 +0200 +@@ -1350,11 +1350,8 @@ + #define TRAMPOLINE_TEMPLATE_NAME "__trampoline_template" + #endif + +-#define Twrite _write +- + #if ! __FRV_FDPIC__ + #define TRANSFER_FROM_TRAMPOLINE \ +-extern int Twrite (int, const void *, unsigned); \ + \ + void \ + __trampoline_setup (short * addr, int size, int fnaddr, int sc) \ +@@ -1366,8 +1363,6 @@ + \ + if (size < 20) \ + { \ +- Twrite (2, "__trampoline_setup bad size\n", \ +- sizeof ("__trampoline_setup bad size\n") - 1); \ + exit (-1); \ + } \ + \ +@@ -1397,7 +1392,6 @@ + "\tjmpl @(gr0,gr6)\n"); + #else + #define TRANSFER_FROM_TRAMPOLINE \ +-extern int Twrite (int, const void *, unsigned); \ + \ + void \ + __trampoline_setup (addr, size, fnaddr, sc) \ +@@ -1414,8 +1408,6 @@ + \ + if (size != 32) \ + { \ +- Twrite (2, "__trampoline_setup bad size\n", \ +- sizeof ("__trampoline_setup bad size\n") - 1); \ + exit (-1); \ + } \ + \ +diff -Nur gcc-6.1.0.orig/gcc/config/frv/linux.h gcc-6.1.0/gcc/config/frv/linux.h +--- gcc-6.1.0.orig/gcc/config/frv/linux.h 2016-01-04 15:30:50.000000000 +0100 ++++ gcc-6.1.0/gcc/config/frv/linux.h 2016-08-16 13:31:06.763517719 +0200 +@@ -68,7 +68,4 @@ + + #undef INVOKE__main + +-#undef Twrite +-#define Twrite __write +- + #endif /* __FRV_LINUX_H__ */ diff --git a/toolchain/gcc/patches/6.2.0/libgcc_linker-script.patch b/toolchain/gcc/patches/6.2.0/libgcc_linker-script.patch new file mode 100644 index 000000000..783d15d0a --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/libgcc_linker-script.patch @@ -0,0 +1,16 @@ +Solves following linking error: +# bfin-openadk-linux-uclibc-g++ -o foo t.c +bfin-openadk-linux-uclibc/bin/ld: foo: hidden symbol `___udivsi3' in libgcc.a(_udivsi3.o) is referenced by DSO + +diff -Nur gcc-6.1.0.orig/libgcc/config.host gcc-6.1.0/libgcc/config.host +--- gcc-6.1.0.orig/libgcc/config.host 2016-02-26 21:02:28.000000000 +0100 ++++ gcc-6.1.0/libgcc/config.host 2016-07-25 02:47:05.818797217 +0200 +@@ -444,7 +444,7 @@ + md_unwind_header=bfin/linux-unwind.h + ;; + bfin*-linux-uclibc*) +- tmake_file="$tmake_file bfin/t-bfin bfin/t-crtstuff t-libgcc-pic t-fdpbit bfin/t-linux" ++ tmake_file="$tmake_file bfin/t-bfin bfin/t-crtstuff t-libgcc-pic t-slibgcc-libgcc t-fdpbit bfin/t-linux" + # No need to build crtbeginT.o on uClibc systems. Should probably + # be moved to the OS specific section above. + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" diff --git a/toolchain/gcc/patches/6.2.0/uclinux-threads.patch b/toolchain/gcc/patches/6.2.0/uclinux-threads.patch new file mode 100644 index 000000000..faf94248a --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/uclinux-threads.patch @@ -0,0 +1,13 @@ +diff -Nur gcc-6.1.0.orig/gcc/config.gcc gcc-6.1.0/gcc/config.gcc +--- gcc-6.1.0.orig/gcc/config.gcc 2016-04-11 12:14:59.000000000 +0200 ++++ gcc-6.1.0/gcc/config.gcc 2016-06-18 13:36:12.196329752 +0200 +@@ -833,6 +833,9 @@ + *-*-uclinux*) + extra_options="$extra_options gnu-user.opt" + use_gcc_stdint=wrap ++ case ${enable_threads} in ++ "" | yes | posix) thread_file='posix' ;; ++ esac + tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC SINGLE_LIBC" + ;; + *-*-rdos*) diff --git a/toolchain/gcc/patches/6.2.0/xtensa-musl.patch b/toolchain/gcc/patches/6.2.0/xtensa-musl.patch new file mode 100644 index 000000000..fa00abbfa --- /dev/null +++ b/toolchain/gcc/patches/6.2.0/xtensa-musl.patch @@ -0,0 +1,27 @@ +From 8f018dd26d3d9992fc32f6ce04492572312d2790 Mon Sep 17 00:00:00 2001 +From: Max Filippov <jcmvbkbc@gmail.com> +Date: Tue, 22 Mar 2016 16:07:24 +0300 +Subject: [PATCH] xtensa: support musl + +Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> +--- + gcc/config/xtensa/linux.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h +index 6ecb153..a41ef96 100644 +--- a/gcc/config/xtensa/linux.h ++++ b/gcc/config/xtensa/linux.h +@@ -48,6 +48,9 @@ along with GCC; see the file COPYING3. If not see + + #define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1" + ++#undef MUSL_DYNAMIC_LINKER ++#define MUSL_DYNAMIC_LINKER "/lib/ld-musl-xtensa.so.1" ++ + #undef LINK_SPEC + #define LINK_SPEC \ + "%{shared:-shared} \ +-- +2.1.4 + |