diff options
author | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-08-04 22:22:07 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-08-08 21:13:39 +0200 |
commit | daafed04398891141f1096b2bf92a4aeae00b725 (patch) | |
tree | 44eafd84ed4a919932ea396b6d5c47d8ec890ae1 | |
parent | 6b9c0a2b24277fb69f716ce068de817f5e3b01c1 (diff) |
fix FDPIC toolchain building
-rw-r--r-- | toolchain/gcc/patches/6.1.0/disable-dwarf.bfin | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.1.0/disable-dwarf.frv | 12 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.1.0/fix-dwarf-fdpic.patch | 37 | ||||
-rw-r--r-- | toolchain/gcc/patches/6.1.0/libgcc_linker-script.patch | 16 |
4 files changed, 53 insertions, 24 deletions
diff --git a/toolchain/gcc/patches/6.1.0/disable-dwarf.bfin b/toolchain/gcc/patches/6.1.0/disable-dwarf.bfin deleted file mode 100644 index a4b44aff7..000000000 --- a/toolchain/gcc/patches/6.1.0/disable-dwarf.bfin +++ /dev/null @@ -1,12 +0,0 @@ -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-04-30 20:49:06.542101273 +0200 -@@ -231,7 +231,7 @@ - esac - ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) -- tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" - if test x$enable_vtable_verify = xyes; then - extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" diff --git a/toolchain/gcc/patches/6.1.0/disable-dwarf.frv b/toolchain/gcc/patches/6.1.0/disable-dwarf.frv deleted file mode 100644 index c11baec92..000000000 --- a/toolchain/gcc/patches/6.1.0/disable-dwarf.frv +++ /dev/null @@ -1,12 +0,0 @@ -diff -Nur gcc-git.orig/libgcc/config.host gcc-git/libgcc/config.host ---- gcc-git.orig/libgcc/config.host 2015-10-23 21:12:52.000000000 +0200 -+++ gcc-git/libgcc/config.host 2015-11-15 21:17:38.385745887 +0100 -@@ -231,7 +231,7 @@ - esac - ;; - *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu) -- tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" -+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux" - extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" - if test x$enable_vtable_verify = xyes; then - extra_parts="$extra_parts vtv_start.o vtv_end.o vtv_start_preinit.o vtv_end_preinit.o" diff --git a/toolchain/gcc/patches/6.1.0/fix-dwarf-fdpic.patch b/toolchain/gcc/patches/6.1.0/fix-dwarf-fdpic.patch new file mode 100644 index 000000000..315b40668 --- /dev/null +++ b/toolchain/gcc/patches/6.1.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.1.0/libgcc_linker-script.patch b/toolchain/gcc/patches/6.1.0/libgcc_linker-script.patch new file mode 100644 index 000000000..783d15d0a --- /dev/null +++ b/toolchain/gcc/patches/6.1.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" |