summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-03-27 15:31:30 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-13 16:27:07 +0000
commitb4865b05b0a3cc45f2873599c6411bef92f40b1c (patch)
treef9deee24e506d50e1f1ecaf954e9ae10799980ad
parente91f89a410dc4639dbe78f392c11b2a44ff9036a (diff)
downloadrockbox-b4865b05b0a3cc45f2873599c6411bef92f40b1c.tar.gz
rockbox-b4865b05b0a3cc45f2873599c6411bef92f40b1c.zip
Build: Bump all toolchains to GCC 4.9.4 + Binutils 2.26.1
GCC 4.9.4 was already used for MIPS and all hosted targets; this enables it across the board for everything (ie m68k and arm native) Other changes: * Use '-Os' as the default optiomization for all targets (was only disabled for arm native) * Enable -funit-at-a-time and -Wextra * Drop all obsolete toolchain patches * Update ARM multilib/exception patch * Bump toolchain libs (gmp, mpfr, mpc) to recommended versions, and add 'isl' to enable better optimization & vectorization opportunities. (Will revisit optimization for the codecs and plugins at a later date) Confirmed working: * armv4t (ipodmini2g and many other PP502x targets) * arm >= v5 (sansaclipplus, ipod6g, ipodnano2g, sansafuzeplus) * m68k (ihp100) Change-Id: If9ed405ae0f289d9adea46d4cf46bfefc2f4250d
-rw-r--r--lib/rbcodec/codecs/codecs.make1
-rwxr-xr-xtools/configure20
-rwxr-xr-xtools/rockboxdev.sh53
-rw-r--r--tools/toolchain-patches/binutils-2.16.1-texinfo-fix.diff30
-rw-r--r--tools/toolchain-patches/binutils-2.20.1-ld-thumb-interwork-long-call.diff569
-rw-r--r--tools/toolchain-patches/binutils-2.20.1-texinfo-fix.diff21
-rw-r--r--tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.4.2_1.diff64
-rw-r--r--tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff56
8 files changed, 92 insertions, 722 deletions
diff --git a/lib/rbcodec/codecs/codecs.make b/lib/rbcodec/codecs/codecs.make
index d9554a9802..187987ca3c 100644
--- a/lib/rbcodec/codecs/codecs.make
+++ b/lib/rbcodec/codecs/codecs.make
@@ -124,6 +124,7 @@ else ifeq ($(ARCH),arch_m68k)
124 $(ATRACLIB) : CODECFLAGS += -O2 124 $(ATRACLIB) : CODECFLAGS += -O2
125 $(COOKLIB): CODECFLAGS += -O2 125 $(COOKLIB): CODECFLAGS += -O2
126 $(DEMACLIB) : CODECFLAGS += -O2 126 $(DEMACLIB) : CODECFLAGS += -O2
127 $(FFMPEGFLACLIB) : CODECFLAGS += -Os
127 $(SPCLIB) : CODECFLAGS += -O3 128 $(SPCLIB) : CODECFLAGS += -O3
128 $(WMAPROLIB) : CODECFLAGS += -O3 129 $(WMAPROLIB) : CODECFLAGS += -O3
129 $(WMAVOICELIB) : CODECFLAGS += -O2 130 $(WMAVOICELIB) : CODECFLAGS += -O2
diff --git a/tools/configure b/tools/configure
index 2b34ed4cff..11c8513c92 100755
--- a/tools/configure
+++ b/tools/configure
@@ -8,7 +8,7 @@
8# 8#
9 9
10# global CC options for all platforms 10# global CC options for all platforms
11CCOPTS="-W -Wall -Wundef -O -nostdlib -ffreestanding -Wstrict-prototypes -pipe -std=gnu99" 11CCOPTS="-W -Wall -Wextra -Wundef -Os -nostdlib -ffreestanding -Wstrict-prototypes -pipe -std=gnu99 -funit-at-a-time"
12 12
13# LD options for the core 13# LD options for the core
14LDOPTS="" 14LDOPTS=""
@@ -136,7 +136,7 @@ app_set_lcd_size () {
136 136
137findarmgcc() { 137findarmgcc() {
138 prefixtools arm-elf-eabi- 138 prefixtools arm-elf-eabi-
139 gccchoice="4.4.4" 139 gccchoice="4.9.4"
140} 140}
141 141
142# scan the $PATH for the given command 142# scan the $PATH for the given command
@@ -502,6 +502,7 @@ calmrisccc () {
502 GCCOPTS="-Wl\,--no-check-sections $CCOPTS" 502 GCCOPTS="-Wl\,--no-check-sections $CCOPTS"
503 GCCOPTIMIZE="-fomit-frame-pointer" 503 GCCOPTIMIZE="-fomit-frame-pointer"
504 endian="big" 504 endian="big"
505 gccchoice="4.9.4"
505} 506}
506 507
507coldfirecc () { 508coldfirecc () {
@@ -509,7 +510,7 @@ coldfirecc () {
509 GCCOPTS="$CCOPTS -mcpu=5249 -malign-int -mstrict-align" 510 GCCOPTS="$CCOPTS -mcpu=5249 -malign-int -mstrict-align"
510 GCCOPTIMIZE="-fomit-frame-pointer" 511 GCCOPTIMIZE="-fomit-frame-pointer"
511 endian="big" 512 endian="big"
512 gccchoice="4.5.2" 513 gccchoice="4.9.4"
513} 514}
514 515
515arm7tdmicc () { 516arm7tdmicc () {
@@ -2588,7 +2589,6 @@ fi
2588 sysfont="08-Rockfont" 2589 sysfont="08-Rockfont"
2589 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi 2590 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
2590 arm9tdmicc 2591 arm9tdmicc
2591 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2592 ;; 2592 ;;
2593 2593
2594 2594
@@ -2631,7 +2631,6 @@ fi
2631 sysfont="08-Rockfont" 2631 sysfont="08-Rockfont"
2632 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi 2632 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
2633 arm9tdmicc 2633 arm9tdmicc
2634 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2635 ;; 2634 ;;
2636 2635
2637 2636
@@ -2676,7 +2675,6 @@ fi
2676 t_model="sansa-c200v2" 2675 t_model="sansa-c200v2"
2677 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi 2676 if [ "$ARG_ARM_THUMB" != 0 ]; then ARG_ARM_THUMB=1; fi
2678 arm9tdmicc 2677 arm9tdmicc
2679 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
2680 ;; 2678 ;;
2681 2679
2682 60|sansaclipv2) 2680 60|sansaclipv2)
@@ -4519,16 +4517,6 @@ echo "Using $LD $ldver"
4519makever=`make --version | head -1` 4517makever=`make --version | head -1`
4520echo "Detected make $makever" 4518echo "Detected make $makever"
4521 4519
4522if test "$CC" = "m68k-elf-gcc"; then
4523 # convert -O to -Os to get smaller binaries!
4524 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
4525fi
4526if test "$CC" = "mipsel-elf-gcc"; then
4527 # convert -O to -Os to get smaller binaries!
4528 GCCOPTS=`echo $GCCOPTS | sed 's/ -O / -Os /'`
4529fi
4530
4531
4532if [ "$ARG_CCACHE" = "1" ]; then 4520if [ "$ARG_CCACHE" = "1" ]; then
4533 echo "Enable ccache for building" 4521 echo "Enable ccache for building"
4534 ccache="ccache" 4522 ccache="ccache"
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh
index 6009a0c3af..61cefe55e7 100755
--- a/tools/rockboxdev.sh
+++ b/tools/rockboxdev.sh
@@ -391,9 +391,9 @@ build() {
391 fi 391 fi
392 done 392 done
393 393
394 # kludge to avoid having to install GMP, MPFR and MPC, for new gcc 394 # kludge to avoid having to install GMP, MPFR, MPC and ISL
395 if test -n "$needs_libs"; then 395 if test -n "$needs_libs"; then
396 cd "gcc-$version" 396 cd "$toolname-$version"
397 if (echo $needs_libs | grep -q gmp && test ! -d gmp); then 397 if (echo $needs_libs | grep -q gmp && test ! -d gmp); then
398 echo "ROCKBOXDEV: Getting GMP" 398 echo "ROCKBOXDEV: Getting GMP"
399 getfile "gmp-4.3.2.tar.bz2" "$GNU_MIRROR/gmp" 399 getfile "gmp-4.3.2.tar.bz2" "$GNU_MIRROR/gmp"
@@ -403,16 +403,23 @@ build() {
403 403
404 if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then 404 if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then
405 echo "ROCKBOXDEV: Getting MPFR" 405 echo "ROCKBOXDEV: Getting MPFR"
406 getfile "mpfr-2.4.2.tar.bz2" "$GNU_MIRROR/mpfr" 406 getfile "mpfr-3.1.0.tar.bz2" "$GNU_MIRROR/mpfr"
407 tar xjf $dlwhere/mpfr-2.4.2.tar.bz2 407 tar xjf $dlwhere/mpfr-3.1.0.tar.bz2
408 ln -s mpfr-2.4.2 mpfr 408 ln -s mpfr-3.1.0 mpfr
409 fi 409 fi
410 410
411 if (echo $needs_libs | grep -q mpc && test ! -d mpc); then 411 if (echo $needs_libs | grep -q mpc && test ! -d mpc); then
412 echo "ROCKBOXDEV: Getting MPC" 412 echo "ROCKBOXDEV: Getting MPC"
413 getfile "mpc-0.8.1.tar.gz" "http://www.multiprecision.org/downloads" 413 getfile "mpc-1.0.1.tar.gz" "http://www.multiprecision.org/downloads"
414 tar xzf $dlwhere/mpc-0.8.1.tar.gz 414 tar xzf $dlwhere/mpc-1.0.1.tar.gz
415 ln -s mpc-0.8.1 mpc 415 ln -s mpc-1.0.1 mpc
416 fi
417
418 if (echo $needs_libs | grep -q isl && test ! -d isl); then
419 echo "ROCKBOXDEV: Getting ISL"
420 getfile "isl-0.15.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure"
421 tar xjf $dlwhere/isl-0.15.tar.bz2
422 ln -s isl-0.15 isl
416 fi 423 fi
417 cd $builddir 424 cd $builddir
418 fi 425 fi
@@ -708,11 +715,10 @@ if [ -z "$RBDEV_TARGET" ]; then
708 echo "m - m68k (iriver h1x0/h3x0, iaudio m3/m5/x5 and mpio hd200)" 715 echo "m - m68k (iriver h1x0/h3x0, iaudio m3/m5/x5 and mpio hd200)"
709 echo "a - arm (ipods, iriver H10, Sansa, D2, Gigabeat, etc)" 716 echo "a - arm (ipods, iriver H10, Sansa, D2, Gigabeat, etc)"
710 echo "i - mips (Jz47xx and ATJ-based players)" 717 echo "i - mips (Jz47xx and ATJ-based players)"
711# echo "r - arm-app (Samsung ypr0)"
712 echo "x - arm-linux (Generic Linux ARM: Samsung ypr0, Linux-based Sony NWZ)" 718 echo "x - arm-linux (Generic Linux ARM: Samsung ypr0, Linux-based Sony NWZ)"
713 echo "y - mips-linux (Generic Linux MIPS: AGPTek Rocker)" 719 echo "y - mips-linux (Generic Linux MIPS: AGPTek Rocker)"
714 echo "separate multiple targets with spaces" 720 echo "separate multiple targets with spaces"
715 echo "(Example: \"s m a\" will build sh, m68k and arm)" 721 echo "(Example: \"m a i\" will build m68k, arm, and mips)"
716 echo "" 722 echo ""
717 selarch=`input` 723 selarch=`input`
718else 724else
@@ -729,13 +735,13 @@ do
729 echo "" 735 echo ""
730 case $arch in 736 case $arch in
731 [Ii]) 737 [Ii])
732 build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror" 738 build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror" "isl"
733 build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc" 739 build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc isl"
734 ;; 740 ;;
735 741
736 [Mm]) 742 [Mm])
737 build "binutils" "m68k-elf" "2.20.1" "binutils-2.20.1-texinfo-fix.diff" "--disable-werror" 743 build "binutils" "m68k-elf" "2.26.1" "" "--disable-werror" "isl"
738 build "gcc" "m68k-elf" "4.5.2" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc" 744 build "gcc" "m68k-elf" "4.9.4" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl"
739 ;; 745 ;;
740 746
741 [Aa]) 747 [Aa])
@@ -747,12 +753,9 @@ do
747 gccopts="--disable-nls" 753 gccopts="--disable-nls"
748 ;; 754 ;;
749 esac 755 esac
750 build "binutils" "arm-elf-eabi" "2.20.1" "binutils-2.20.1-ld-thumb-interwork-long-call.diff binutils-2.20.1-texinfo-fix.diff" "$binopts --disable-werror" 756 build "binutils" "arm-elf-eabi" "2.26.1" "" "$binopts --disable-werror" "isl"
751 build "gcc" "arm-elf-eabi" "4.4.4" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.4.2_1.diff" "$gccopts MAKEINFO=missing" "gmp mpfr" 757 build "gcc" "arm-elf-eabi" "4.9.4" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff" "$gccopts MAKEINFO=missing" "gmp mpfr mpc isl"
752 ;; 758 ;;
753# [Rr])
754# build_ctng "ypr0" "alsalib.tar.gz" "arm" "linux-gnueabi"
755# ;;
756 [Xx]) 759 [Xx])
757 # IMPORTANT NOTE 760 # IMPORTANT NOTE
758 # This toolchain must support several targets and thus must support 761 # This toolchain must support several targets and thus must support
@@ -804,20 +807,26 @@ do
804 # compiles with GCC >6 807 # compiles with GCC >6
805 # kernel: 3.10.14 808 # kernel: 3.10.14
806 # glibc: 2.16 809 # glibc: 2.16
810 # alsa: 1.0.29
811 #
812 # FiiO M3K:
813 # kernel: 3.10.14
814 # glibc: 2.16
815 # alsa: 1.0.26
807 # 816 #
808 # To maximize compatibility, we use kernel 3.2.85 which is the lastest 817 # To maximize compatibility, we use kernel 3.2.85 which is the lastest
809 # longterm 3.2 kernel and is supported by the latest glibc, and we 818 # longterm 3.2 kernel and is supported by the latest glibc, and we
810 # require support for up to glibc 2.4 819 # require support for up to glibc 2.16
811 # We use a recent 2.26.1 binutils to avoid any build problems and 820 # We use a recent 2.26.1 binutils to avoid any build problems and
812 # avoid patches/bugs. 821 # avoid patches/bugs.
813 glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.4" 822 glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16"
814 # FIXME: maybe add -mhard-float 823 # FIXME: maybe add -mhard-float
815 build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.26.1" "" "4.9.4" \ 824 build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.26.1" "" "4.9.4" \
816 "$gccopts" "3.2.85" "2.25" "$glibcopts" 825 "$gccopts" "3.2.85" "2.25" "$glibcopts"
817 # build alsa-lib 826 # build alsa-lib
818 # we need to set the prefix to how it is on device (/usr) and then 827 # we need to set the prefix to how it is on device (/usr) and then
819 # tweak install dir at make install step 828 # tweak install dir at make install step
820 alsalib_ver="1.0.19" 829 alsalib_ver="1.0.26"
821 gettool "alsa-lib" "$alsalib_ver" 830 gettool "alsa-lib" "$alsalib_ver"
822 extract "alsa-lib-$alsalib_ver" 831 extract "alsa-lib-$alsalib_ver"
823 prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \ 832 prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \
diff --git a/tools/toolchain-patches/binutils-2.16.1-texinfo-fix.diff b/tools/toolchain-patches/binutils-2.16.1-texinfo-fix.diff
deleted file mode 100644
index ae0a79399b..0000000000
--- a/tools/toolchain-patches/binutils-2.16.1-texinfo-fix.diff
+++ /dev/null
@@ -1,30 +0,0 @@
1diff -ru binutils-2.16.1-orig/ld/ld.texinfo binutils-2.16.1/ld/ld.texinfo
2--- binutils-2.16.1-orig/ld/ld.texinfo 2005-06-12 20:35:45.000000000 +0200
3+++ binutils-2.16.1/ld/ld.texinfo 2013-06-04 22:31:37.833372351 +0200
4@@ -1589,7 +1589,7 @@
5
6 @kindex --version-script=@var{version-scriptfile}
7 @cindex version script, symbol versions
8-@itemx --version-script=@var{version-scriptfile}
9+@item --version-script=@var{version-scriptfile}
10 Specify the name of a version script to the linker. This is typically
11 used when creating shared libraries to specify additional information
12 about the version hierarchy for the library being created. This option
13@@ -6256,7 +6256,7 @@
14 @printindex cp
15
16 @tex
17-% I think something like @colophon should be in texinfo. In the
18+% I think something like @@colophon should be in texinfo. In the
19 % meantime:
20 \long\def\colophon{\hbox to0pt{}\vfill
21 \centerline{The body of this manual is set in}
22@@ -6267,7 +6267,7 @@
23 \centerline{{\sl\fontname\tensl\/}}
24 \centerline{are used for emphasis.}\vfill}
25 \page\colophon
26-% Blame: doc@cygnus.com, 28mar91.
27+% Blame: doc@@cygnus.com, 28mar91.
28 @end tex
29
30
diff --git a/tools/toolchain-patches/binutils-2.20.1-ld-thumb-interwork-long-call.diff b/tools/toolchain-patches/binutils-2.20.1-ld-thumb-interwork-long-call.diff
deleted file mode 100644
index 5eb5debfbf..0000000000
--- a/tools/toolchain-patches/binutils-2.20.1-ld-thumb-interwork-long-call.diff
+++ /dev/null
@@ -1,569 +0,0 @@
1http://sourceware.org/ml/binutils/2010-02/msg00460.html
2
3Drop this patch when binutils 2.21 is out
4diff -ur binutils-2.20.1.orig/bfd/elf32-arm.c binutils-2.20.1/bfd/elf32-arm.c
5--- binutils-2.20.1.orig/bfd/elf32-arm.c 2010-06-11 18:48:06.000000000 +0200
6+++ binutils-2.20.1/bfd/elf32-arm.c 2010-06-11 18:51:00.000000000 +0200
7@@ -2401,6 +2401,7 @@
8 unsigned long orig_insn;
9 char *stub_name;
10 enum elf32_arm_stub_type stub_type;
11+ int st_type;
12 };
13
14 /* A table of relocs applied to branches which might trigger Cortex-A8
15@@ -2647,6 +2648,9 @@
16 asection *stub_sec;
17 } *stub_group;
18
19+ /* Number of elements in stub_group. */
20+ int top_id;
21+
22 /* Assorted information used by elf32_arm_size_stubs. */
23 unsigned int bfd_count;
24 int top_index;
25@@ -2933,6 +2937,7 @@
26 ret->add_stub_section = NULL;
27 ret->layout_sections_again = NULL;
28 ret->stub_group = NULL;
29+ ret->top_id = 0;
30 ret->bfd_count = 0;
31 ret->top_index = 0;
32 ret->input_list = NULL;
33@@ -3033,7 +3038,7 @@
34 arm_type_of_stub (struct bfd_link_info *info,
35 asection *input_sec,
36 const Elf_Internal_Rela *rel,
37- unsigned char st_type,
38+ int *actual_st_type,
39 struct elf32_arm_link_hash_entry *hash,
40 bfd_vma destination,
41 asection *sym_sec,
42@@ -3048,6 +3053,7 @@
43 int thumb_only;
44 enum elf32_arm_stub_type stub_type = arm_stub_none;
45 int use_plt = 0;
46+ int st_type = *actual_st_type;
47
48 /* We don't know the actual type of destination in case it is of
49 type STT_SECTION: give up. */
50@@ -3065,14 +3071,15 @@
51 + input_sec->output_section->vma
52 + rel->r_offset);
53
54- branch_offset = (bfd_signed_vma)(destination - location);
55-
56 r_type = ELF32_R_TYPE (rel->r_info);
57
58 /* Keep a simpler condition, for the sake of clarity. */
59- if (globals->splt != NULL && hash != NULL && hash->root.plt.offset != (bfd_vma) -1)
60+ if (globals->splt != NULL
61+ && hash != NULL
62+ && hash->root.plt.offset != (bfd_vma) -1)
63 {
64 use_plt = 1;
65+
66 /* Note when dealing with PLT entries: the main PLT stub is in
67 ARM mode, so if the branch is in Thumb mode, another
68 Thumb->ARM stub will be inserted later just before the ARM
69@@ -3081,8 +3088,15 @@
70 Thumb->Arm one and branch directly to the ARM PLT entry
71 because it avoids spreading offset corrections in several
72 places. */
73+
74+ destination = (globals->splt->output_section->vma
75+ + globals->splt->output_offset
76+ + hash->root.plt.offset);
77+ st_type = STT_FUNC;
78 }
79
80+ branch_offset = (bfd_signed_vma)(destination - location);
81+
82 if (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24)
83 {
84 /* Handle cases where:
85@@ -3176,7 +3190,9 @@
86 }
87 }
88 }
89- else if (r_type == R_ARM_CALL || r_type == R_ARM_JUMP24 || r_type == R_ARM_PLT32)
90+ else if (r_type == R_ARM_CALL
91+ || r_type == R_ARM_JUMP24
92+ || r_type == R_ARM_PLT32)
93 {
94 if (st_type == STT_ARM_TFUNC)
95 {
96@@ -3231,6 +3247,12 @@
97 }
98 }
99
100+ /* If a stub is needed, record the actual destination type. */
101+ if (stub_type != arm_stub_none)
102+ {
103+ *actual_st_type = st_type;
104+ }
105+
106 return stub_type;
107 }
108
109@@ -3240,31 +3262,35 @@
110 elf32_arm_stub_name (const asection *input_section,
111 const asection *sym_sec,
112 const struct elf32_arm_link_hash_entry *hash,
113- const Elf_Internal_Rela *rel)
114+ const Elf_Internal_Rela *rel,
115+ enum elf32_arm_stub_type stub_type)
116+
117 {
118 char *stub_name;
119 bfd_size_type len;
120
121 if (hash)
122 {
123- len = 8 + 1 + strlen (hash->root.root.root.string) + 1 + 8 + 1;
124+ len = 8 + 1 + strlen (hash->root.root.root.string) + 1 + 8 + 1 + 2 + 1;
125 stub_name = bfd_malloc (len);
126 if (stub_name != NULL)
127- sprintf (stub_name, "%08x_%s+%x",
128+ sprintf (stub_name, "%08x_%s+%x_%d",
129 input_section->id & 0xffffffff,
130 hash->root.root.root.string,
131- (int) rel->r_addend & 0xffffffff);
132+ (int) rel->r_addend & 0xffffffff,
133+ (int) stub_type);
134 }
135 else
136 {
137- len = 8 + 1 + 8 + 1 + 8 + 1 + 8 + 1;
138+ len = 8 + 1 + 8 + 1 + 8 + 1 + 8 + 1 + 2 + 1;
139 stub_name = bfd_malloc (len);
140 if (stub_name != NULL)
141- sprintf (stub_name, "%08x_%x:%x+%x",
142+ sprintf (stub_name, "%08x_%x:%x+%x_%d",
143 input_section->id & 0xffffffff,
144 sym_sec->id & 0xffffffff,
145 (int) ELF32_R_SYM (rel->r_info) & 0xffffffff,
146- (int) rel->r_addend & 0xffffffff);
147+ (int) rel->r_addend & 0xffffffff,
148+ (int) stub_type);
149 }
150
151 return stub_name;
152@@ -3278,7 +3304,8 @@
153 const asection *sym_sec,
154 struct elf_link_hash_entry *hash,
155 const Elf_Internal_Rela *rel,
156- struct elf32_arm_link_hash_table *htab)
157+ struct elf32_arm_link_hash_table *htab,
158+ enum elf32_arm_stub_type stub_type)
159 {
160 struct elf32_arm_stub_hash_entry *stub_entry;
161 struct elf32_arm_link_hash_entry *h = (struct elf32_arm_link_hash_entry *) hash;
162@@ -3296,7 +3323,8 @@
163
164 if (h != NULL && h->stub_cache != NULL
165 && h->stub_cache->h == h
166- && h->stub_cache->id_sec == id_sec)
167+ && h->stub_cache->id_sec == id_sec
168+ && h->stub_cache->stub_type == stub_type)
169 {
170 stub_entry = h->stub_cache;
171 }
172@@ -3304,7 +3332,7 @@
173 {
174 char *stub_name;
175
176- stub_name = elf32_arm_stub_name (id_sec, sym_sec, h, rel);
177+ stub_name = elf32_arm_stub_name (id_sec, sym_sec, h, rel, stub_type);
178 if (stub_name == NULL)
179 return NULL;
180
181@@ -3464,7 +3492,7 @@
182 /* We have to do the a8 fixes last, as they are less aligned than
183 the other veneers. */
184 return TRUE;
185-
186+
187 /* Make a note of the offset within the stubs for this entry. */
188 stub_entry->stub_offset = stub_sec->size;
189 loc = stub_sec->contents + stub_entry->stub_offset;
190@@ -3499,17 +3527,17 @@
191 BFD_ASSERT ((data & 0xff00) == 0xd000);
192 data |= ((stub_entry->orig_insn >> 22) & 0xf) << 8;
193 }
194- put_thumb_insn (globals, stub_bfd, data, loc + size);
195+ bfd_put_16 (stub_bfd, data, loc + size);
196 size += 2;
197 }
198 break;
199
200 case THUMB32_TYPE:
201- put_thumb_insn (globals, stub_bfd,
202- (template_sequence[i].data >> 16) & 0xffff,
203- loc + size);
204- put_thumb_insn (globals, stub_bfd, template_sequence[i].data & 0xffff,
205- loc + size + 2);
206+ bfd_put_16 (stub_bfd,
207+ (template_sequence[i].data >> 16) & 0xffff,
208+ loc + size);
209+ bfd_put_16 (stub_bfd, template_sequence[i].data & 0xffff,
210+ loc + size + 2);
211 if (template_sequence[i].r_type != R_ARM_NONE)
212 {
213 stub_reloc_idx[nrelocs] = i;
214@@ -3519,8 +3547,8 @@
215 break;
216
217 case ARM_TYPE:
218- put_arm_insn (globals, stub_bfd, template_sequence[i].data,
219- loc + size);
220+ bfd_put_32 (stub_bfd, template_sequence[i].data,
221+ loc + size);
222 /* Handle cases where the target is encoded within the
223 instruction. */
224 if (template_sequence[i].r_type == R_ARM_JUMP24)
225@@ -3599,11 +3627,23 @@
226 }
227 else
228 {
229- _bfd_final_link_relocate (elf32_arm_howto_from_type
230- (template_sequence[stub_reloc_idx[i]].r_type), stub_bfd, stub_sec,
231- stub_sec->contents, stub_entry->stub_offset + stub_reloc_offset[i],
232- sym_value + stub_entry->target_addend,
233- template_sequence[stub_reloc_idx[i]].reloc_addend);
234+ Elf_Internal_Rela rel;
235+ bfd_boolean unresolved_reloc;
236+ char *error_message;
237+ bfd_vma points_to = sym_value + stub_entry->target_addend
238+ + template_sequence[stub_reloc_idx[i]].reloc_addend;
239+
240+ rel.r_offset = stub_entry->stub_offset + stub_reloc_offset[i];
241+ rel.r_info = ELF32_R_INFO (0,
242+ template_sequence[stub_reloc_idx[i]].r_type);
243+ rel.r_addend = 0;
244+
245+ elf32_arm_final_link_relocate (elf32_arm_howto_from_type
246+ (template_sequence[stub_reloc_idx[i]].r_type),
247+ stub_bfd, info->output_bfd, stub_sec, stub_sec->contents, &rel,
248+ points_to, info, stub_entry->target_section, "", stub_entry->st_type,
249+ (struct elf_link_hash_entry *) stub_entry->h, &unresolved_reloc,
250+ &error_message);
251 }
252
253 return TRUE;
254@@ -3728,6 +3768,7 @@
255 htab->stub_group = bfd_zmalloc (amt);
256 if (htab->stub_group == NULL)
257 return -1;
258+ htab->top_id = top_id;
259
260 /* We can't use output_bfd->section_count here to find the top output
261 section index as some sections may have been removed, and
262@@ -4009,7 +4050,7 @@
263 }
264
265 is_32bit_branch = is_b || is_bl || is_blx || is_bcc;
266-
267+
268 if (((base_vma + i) & 0xfff) == 0xffe
269 && insn_32bit
270 && is_32bit_branch
271@@ -4178,6 +4219,8 @@
272 a8_fixes[num_a8_fixes].orig_insn = insn;
273 a8_fixes[num_a8_fixes].stub_name = stub_name;
274 a8_fixes[num_a8_fixes].stub_type = stub_type;
275+ a8_fixes[num_a8_fixes].st_type =
276+ is_blx ? STT_FUNC : STT_ARM_TFUNC;
277
278 num_a8_fixes++;
279 }
280@@ -4193,11 +4236,11 @@
281 if (elf_section_data (section)->this_hdr.contents == NULL)
282 free (contents);
283 }
284-
285+
286 *a8_fixes_p = a8_fixes;
287 *num_a8_fixes_p = num_a8_fixes;
288 *a8_fix_table_size_p = a8_fix_table_size;
289-
290+
291 return FALSE;
292 }
293
294@@ -4345,7 +4388,7 @@
295 const char *sym_name;
296 char *stub_name;
297 const asection *id_sec;
298- unsigned char st_type;
299+ int st_type;
300 bfd_boolean created_stub = FALSE;
301
302 r_type = ELF32_R_TYPE (irela->r_info);
303@@ -4403,7 +4446,7 @@
304 /* This is an undefined symbol. It can never
305 be resolved. */
306 continue;
307-
308+
309 if (ELF_ST_TYPE (sym->st_info) != STT_SECTION)
310 sym_value = sym->st_value;
311 destination = (sym_value + irela->r_addend
312@@ -4493,7 +4536,7 @@
313 {
314 /* Determine what (if any) linker stub is needed. */
315 stub_type = arm_type_of_stub (info, section, irela,
316- st_type, hash,
317+ &st_type, hash,
318 destination, sym_sec,
319 input_bfd, sym_name);
320 if (stub_type == arm_stub_none)
321@@ -4504,7 +4547,7 @@
322
323 /* Get the name of this stub. */
324 stub_name = elf32_arm_stub_name (id_sec, sym_sec, hash,
325- irela);
326+ irela, stub_type);
327 if (!stub_name)
328 goto error_ret_free_internal;
329
330@@ -4703,7 +4746,7 @@
331 stub_entry->target_value = a8_fixes[i].offset;
332 stub_entry->target_addend = a8_fixes[i].addend;
333 stub_entry->orig_insn = a8_fixes[i].orig_insn;
334- stub_entry->st_type = STT_ARM_TFUNC;
335+ stub_entry->st_type = a8_fixes[i].st_type;
336
337 size = find_stub_size_and_template (a8_fixes[i].stub_type,
338 &template_sequence,
339@@ -6866,6 +6909,7 @@
340 ".tls_vars") == 0)
341 && ((r_type != R_ARM_REL32 && r_type != R_ARM_REL32_NOI)
342 || !SYMBOL_CALLS_LOCAL (info, h))
343+ && (!strstr (input_section->name, STUB_SUFFIX))
344 && (h == NULL
345 || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
346 || h->root.type != bfd_link_hash_undefweak)
347@@ -6990,7 +7034,6 @@
348 case R_ARM_PC24: /* Arm B/BL instruction. */
349 case R_ARM_PLT32:
350 {
351- bfd_signed_vma branch_offset;
352 struct elf32_arm_stub_hash_entry *stub_entry = NULL;
353
354 if (r_type == R_ARM_XPC25)
355@@ -7026,45 +7069,46 @@
356 || r_type == R_ARM_JUMP24
357 || r_type == R_ARM_PLT32)
358 {
359- bfd_vma from;
360-
361- /* If the call goes through a PLT entry, make sure to
362- check distance to the right destination address. */
363- if (h != NULL && splt != NULL && h->plt.offset != (bfd_vma) -1)
364- {
365- value = (splt->output_section->vma
366- + splt->output_offset
367- + h->plt.offset);
368- *unresolved_reloc_p = FALSE;
369- /* The PLT entry is in ARM mode, regardless of the
370- target function. */
371- sym_flags = STT_FUNC;
372- }
373+ enum elf32_arm_stub_type stub_type = arm_stub_none;
374+ struct elf32_arm_link_hash_entry *hash;
375
376- from = (input_section->output_section->vma
377- + input_section->output_offset
378- + rel->r_offset);
379- branch_offset = (bfd_signed_vma)(value - from);
380-
381- if (branch_offset > ARM_MAX_FWD_BRANCH_OFFSET
382- || branch_offset < ARM_MAX_BWD_BRANCH_OFFSET
383- || ((sym_flags == STT_ARM_TFUNC)
384- && (((r_type == R_ARM_CALL) && !globals->use_blx)
385- || (r_type == R_ARM_JUMP24)
386- || (r_type == R_ARM_PLT32) ))
387- )
388+ hash = (struct elf32_arm_link_hash_entry *) h;
389+ stub_type = arm_type_of_stub (info, input_section, rel,
390+ &sym_flags, hash,
391+ value, sym_sec,
392+ input_bfd, sym_name);
393+
394+ if (stub_type != arm_stub_none)
395 {
396 /* The target is out of reach, so redirect the
397 branch to the local stub for this function. */
398
399 stub_entry = elf32_arm_get_stub_entry (input_section,
400 sym_sec, h,
401- rel, globals);
402+ rel, globals,
403+ stub_type);
404 if (stub_entry != NULL)
405 value = (stub_entry->stub_offset
406 + stub_entry->stub_sec->output_offset
407 + stub_entry->stub_sec->output_section->vma);
408 }
409+ else
410+ {
411+ /* If the call goes through a PLT entry, make sure to
412+ check distance to the right destination address. */
413+ if (h != NULL
414+ && splt != NULL
415+ && h->plt.offset != (bfd_vma) -1)
416+ {
417+ value = (splt->output_section->vma
418+ + splt->output_offset
419+ + h->plt.offset);
420+ *unresolved_reloc_p = FALSE;
421+ /* The PLT entry is in ARM mode, regardless of the
422+ target function. */
423+ sym_flags = STT_FUNC;
424+ }
425+ }
426 }
427
428 /* The ARM ELF ABI says that this reloc is computed as: S - P + A
429@@ -7444,58 +7488,29 @@
430 }
431 }
432
433- /* Handle calls via the PLT. */
434- if (h != NULL && splt != NULL && h->plt.offset != (bfd_vma) -1)
435- {
436- value = (splt->output_section->vma
437- + splt->output_offset
438- + h->plt.offset);
439- if (globals->use_blx && r_type == R_ARM_THM_CALL)
440- {
441- /* If the Thumb BLX instruction is available, convert the
442- BL to a BLX instruction to call the ARM-mode PLT entry. */
443- lower_insn = (lower_insn & ~0x1000) | 0x0800;
444- sym_flags = STT_FUNC;
445- }
446- else
447- {
448- /* Target the Thumb stub before the ARM PLT entry. */
449- value -= PLT_THUMB_STUB_SIZE;
450- sym_flags = STT_ARM_TFUNC;
451- }
452- *unresolved_reloc_p = FALSE;
453- }
454-
455+ enum elf32_arm_stub_type stub_type = arm_stub_none;
456 if (r_type == R_ARM_THM_CALL || r_type == R_ARM_THM_JUMP24)
457 {
458 /* Check if a stub has to be inserted because the destination
459 is too far. */
460- bfd_vma from;
461- bfd_signed_vma branch_offset;
462- struct elf32_arm_stub_hash_entry *stub_entry = NULL;
463-
464- from = (input_section->output_section->vma
465- + input_section->output_offset
466- + rel->r_offset);
467- branch_offset = (bfd_signed_vma)(value - from);
468-
469- if ((!thumb2
470- && (branch_offset > THM_MAX_FWD_BRANCH_OFFSET
471- || (branch_offset < THM_MAX_BWD_BRANCH_OFFSET)))
472- ||
473- (thumb2
474- && (branch_offset > THM2_MAX_FWD_BRANCH_OFFSET
475- || (branch_offset < THM2_MAX_BWD_BRANCH_OFFSET)))
476- || ((sym_flags != STT_ARM_TFUNC)
477- && (((r_type == R_ARM_THM_CALL) && !globals->use_blx)
478- || r_type == R_ARM_THM_JUMP24)))
479+ struct elf32_arm_stub_hash_entry *stub_entry;
480+ struct elf32_arm_link_hash_entry *hash;
481+
482+ hash = (struct elf32_arm_link_hash_entry *) h;
483+
484+ stub_type = arm_type_of_stub (info, input_section, rel,
485+ &sym_flags, hash, value, sym_sec,
486+ input_bfd, sym_name);
487+
488+ if (stub_type != arm_stub_none)
489 {
490 /* The target is out of reach or we are changing modes, so
491 redirect the branch to the local stub for this
492 function. */
493 stub_entry = elf32_arm_get_stub_entry (input_section,
494 sym_sec, h,
495- rel, globals);
496+ rel, globals,
497+ stub_type);
498 if (stub_entry != NULL)
499 value = (stub_entry->stub_offset
500 + stub_entry->stub_sec->output_offset
501@@ -7512,6 +7527,33 @@
502 }
503 }
504
505+ /* Handle calls via the PLT. */
506+ if (stub_type == arm_stub_none
507+ && h != NULL
508+ && splt != NULL
509+ && h->plt.offset != (bfd_vma) -1)
510+ {
511+ value = (splt->output_section->vma
512+ + splt->output_offset
513+ + h->plt.offset);
514+
515+ if (globals->use_blx && r_type == R_ARM_THM_CALL)
516+ {
517+ /* If the Thumb BLX instruction is available, convert
518+ the BL to a BLX instruction to call the ARM-mode
519+ PLT entry. */
520+ lower_insn = (lower_insn & ~0x1000) | 0x0800;
521+ sym_flags = STT_FUNC;
522+ }
523+ else
524+ {
525+ /* Target the Thumb stub before the ARM PLT entry. */
526+ value -= PLT_THUMB_STUB_SIZE;
527+ sym_flags = STT_ARM_TFUNC;
528+ }
529+ *unresolved_reloc_p = FALSE;
530+ }
531+
532 relocation = value + signed_addend;
533
534 relocation -= (input_section->output_section->vma
535@@ -9298,11 +9340,26 @@
536 elf32_arm_final_link (bfd *abfd, struct bfd_link_info *info)
537 {
538 struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (info);
539+ asection *sec, *osec;
540
541 /* Invoke the regular ELF backend linker to do all the work. */
542 if (!bfd_elf_final_link (abfd, info))
543 return FALSE;
544
545+ /* Process stub sections (eg BE8 encoding, ...). */
546+ struct elf32_arm_link_hash_table *htab = elf32_arm_hash_table (info);
547+ int i;
548+ for(i=0; i<htab->top_id; i++) {
549+ sec = htab->stub_group[i].stub_sec;
550+ if (sec) {
551+ osec = sec->output_section;
552+ elf32_arm_write_section (abfd, info, sec, sec->contents);
553+ if (! bfd_set_section_contents (abfd, osec, sec->contents,
554+ sec->output_offset, sec->size))
555+ return FALSE;
556+ }
557+ }
558+
559 /* Write out any glue sections now that we have created all the
560 stubs. */
561 if (globals->bfd_of_glue_owner != NULL)
562@@ -12875,6 +12932,7 @@
563 sym.st_other = 0;
564 sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_NOTYPE);
565 sym.st_shndx = osi->sec_shndx;
566+ elf32_arm_section_map_add (osi->sec, names[type][1], offset);
567 return osi->func (osi->finfo, names[type], &sym, osi->sec, NULL) == 1;
568 }
569
diff --git a/tools/toolchain-patches/binutils-2.20.1-texinfo-fix.diff b/tools/toolchain-patches/binutils-2.20.1-texinfo-fix.diff
deleted file mode 100644
index cca0861eef..0000000000
--- a/tools/toolchain-patches/binutils-2.20.1-texinfo-fix.diff
+++ /dev/null
@@ -1,21 +0,0 @@
1diff -ru binutils-2.20.1-orig/bfd/doc/bfd.texinfo binutils-2.20.1/bfd/doc/bfd.texinfo
2--- binutils-2.20.1-orig/bfd/doc/bfd.texinfo 2013-05-12 17:28:30.461074959 +0200
3+++ binutils-2.20.1/bfd/doc/bfd.texinfo 2013-05-12 17:26:54.175902524 +0200
4@@ -323,7 +323,7 @@
5 @printindex cp
6
7 @tex
8-% I think something like @colophon should be in texinfo. In the
9+% I think something like @@colophon should be in texinfo. In the
10 % meantime:
11 \long\def\colophon{\hbox to0pt{}\vfill
12 \centerline{The body of this manual is set in}
13@@ -334,7 +334,7 @@
14 \centerline{{\sl\fontname\tensl\/}}
15 \centerline{are used for emphasis.}\vfill}
16 \page\colophon
17-% Blame: doc@cygnus.com, 28mar91.
18+% Blame: doc@@cygnus.com, 28mar91.
19 @end tex
20
21 @bye
diff --git a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.4.2_1.diff b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.4.2_1.diff
deleted file mode 100644
index 3397153495..0000000000
--- a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.4.2_1.diff
+++ /dev/null
@@ -1,64 +0,0 @@
1diff -ur gcc-4.4.2-orig/gcc/config/arm/t-arm-elf gcc-4.4.2/gcc/config/arm/t-arm-elf
2--- gcc-4.4.2-orig/gcc/config/arm/t-arm-elf 2008-06-12 13:29:47.000000000 -0400
3+++ gcc-4.4.2/gcc/config/arm/t-arm-elf 2009-11-05 20:14:57.000000000 -0500
4@@ -28,6 +28,11 @@
5 #MULTILIB_MATCHES += march?armv7=mcpu?cortex-r4
6 #MULTILIB_MATCHES += march?armv7=mcpu?cortex-m3
7
8+# We build a lib for each specific CPU Rockbox targets. If anyone knows a better
9+# way to do this, please let us know.
10+MULTILIB_OPTIONS += mcpu=arm7tdmi/mcpu=arm9tdmi/mcpu=arm9e/mcpu=arm926ej-s/mcpu=arm1136jf-s
11+MULTILIB_DIRNAMES += arm7tdmi arm9tdmi arm9e arm926ej-s arm1136jf-s
12+
13 # MULTILIB_OPTIONS += mcpu=ep9312
14 # MULTILIB_DIRNAMES += ep9312
15 # MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*
16@@ -40,8 +50,8 @@
17 # MULTILIB_DIRNAMES += fpu soft
18 # MULTILIB_EXCEPTIONS += *mthumb/*mhard-float*
19 #
20-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
21-# MULTILIB_DIRNAMES += normal interwork
22+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
23+MULTILIB_DIRNAMES += normal interwork
24 #
25 # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
26 # MULTILIB_DIRNAMES += elf under
27diff -ur gcc-4.4.2-orig/libgcc/Makefile.in gcc-4.4.2/libgcc/Makefile.in
28--- gcc-4.4.2-orig/libgcc/Makefile.in 2009-04-09 19:23:07.000000000 -0400
29+++ gcc-4.4.2/libgcc/Makefile.in 2009-11-05 03:59:37.000000000 -0500
30@@ -393,14 +393,14 @@
31 lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
32 $(lib2-divmod-o): %$(objext): $(gcc_srcdir)/libgcc2.c
33 $(gcc_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
34- -fexceptions -fnon-call-exceptions $(vis_hide)
35+ -fno-exceptions -fno-non-call-exceptions $(vis_hide)
36 libgcc-objects += $(lib2-divmod-o)
37
38 ifeq ($(enable_shared),yes)
39 lib2-divmod-s-o = $(patsubst %,%_s$(objext),$(LIB2_DIVMOD_FUNCS))
40 $(lib2-divmod-s-o): %_s$(objext): $(gcc_srcdir)/libgcc2.c
41 $(gcc_s_compile) -DL$* -c $(gcc_srcdir)/libgcc2.c \
42- -fexceptions -fnon-call-exceptions
43+ -fno-exceptions -fno-non-call-exceptions
44 libgcc-s-objects += $(lib2-divmod-s-o)
45 endif
46
47@@ -688,7 +688,7 @@
48 # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
49 # LIB2ADDEHSHARED matter. (Usually all three are identical.)
50
51-c_flags := -fexceptions
52+c_flags := -fno-exceptions
53
54 ifeq ($(enable_shared),yes)
55
56@@ -710,7 +710,7 @@
57
58 # Build LIBUNWIND.
59
60-c_flags := -fexceptions
61+c_flags := -fno-exceptions
62
63 libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND))))
64
diff --git a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff
new file mode 100644
index 0000000000..cd98d3751c
--- /dev/null
+++ b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff
@@ -0,0 +1,56 @@
1diff -Naur gcc-4.9.4/gcc/config/arm/t-arm-elf gcc-4.9.4-fixed/gcc/config/arm/t-arm-elf
2--- gcc-4.9.4/gcc/config/arm/t-arm-elf 2014-01-02 17:23:26.000000000 -0500
3+++ gcc-4.9.4-fixed/gcc/config/arm/t-arm-elf 2020-07-01 22:11:01.198403110 -0400
4@@ -44,6 +44,11 @@
5 #MULTILIB_EXCEPTIONS += *mcpu=fa526/*mfloat-abi=hard*
6 #MULTILIB_EXCEPTIONS += *mcpu=fa626/*mfloat-abi=hard*
7
8+# We build a lib for each specific CPU Rockbox targets. If anyone knows a better
9+# way to do this, please let us know.
10+MULTILIB_OPTIONS += mcpu=arm7tdmi/mcpu=arm9tdmi/mcpu=arm9e/mcpu=arm926ej-s/mcpu=arm1136jf-s
11+MULTILIB_DIRNAMES += arm7tdmi arm9tdmi arm9e arm926ej-s arm1136jf-s
12+
13 # MULTILIB_OPTIONS += mcpu=ep9312
14 # MULTILIB_DIRNAMES += ep9312
15 # MULTILIB_EXCEPTIONS += *mthumb/*mcpu=ep9312*
16@@ -56,8 +61,8 @@
17 # MULTILIB_DIRNAMES += fpu soft
18 # MULTILIB_EXCEPTIONS += *mthumb/*mfloat-abi=hard*
19 #
20-# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
21-# MULTILIB_DIRNAMES += normal interwork
22+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
23+MULTILIB_DIRNAMES += normal interwork
24 #
25 # MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
26 # MULTILIB_DIRNAMES += elf under
27diff -Naur gcc-4.9.4/libgcc/config/arm/t-bpabi gcc-4.9.4-fixed/libgcc/config/arm/t-bpabi
28--- gcc-4.9.4/libgcc/config/arm/t-bpabi 2012-08-17 11:06:06.000000000 -0400
29+++ gcc-4.9.4-fixed/libgcc/config/arm/t-bpabi 2020-07-01 22:13:39.103762818 -0400
30@@ -17,4 +17,4 @@
31 # On ARM, specifying -fnon-call-exceptions will needlessly pull in
32 # the unwinder in simple programs which use 64-bit division. Omitting
33 # the option is safe.
34-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
35+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
36diff -Naur gcc-4.9.4/libgcc/Makefile.in gcc-4.9.4-fixed/libgcc/Makefile.in
37--- gcc-4.9.4/libgcc/Makefile.in 2014-01-08 11:37:08.000000000 -0500
38+++ gcc-4.9.4-fixed/libgcc/Makefile.in 2020-07-01 22:11:01.199403087 -0400
39@@ -495,7 +495,7 @@
40 ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
41 # Provide default flags for compiling divmod functions, if they haven't been
42 # set already by a target-specific Makefile fragment.
43-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
44+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
45 endif
46
47 # Build LIB2_DIVMOD_FUNCS.
48@@ -816,7 +816,7 @@
49 # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
50 # LIB2ADDEHSHARED matter. (Usually all three are identical.)
51
52-c_flags := -fexceptions
53+c_flags := -fno-exceptions
54
55 ifeq ($(enable_shared),yes)
56