summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2022-10-09 19:17:41 -0400
committerSolomon Peachy <pizza@shaftnet.org>2024-06-30 15:05:08 -0400
commit67dc833e46679c13f4b8d82cbb52d2393fef8fd8 (patch)
tree0eb34457d89beb5f612ec272d3e7d2d5596bd2b3
parent36fdd3dfed29cf6e325c12b7b21cab66dc278529 (diff)
downloadrockbox-67dc833e46679c13f4b8d82cbb52d2393fef8fd8.tar.gz
rockbox-67dc833e46679c13f4b8d82cbb52d2393fef8fd8.zip
Toolchains: Update to GCC 8.5.0
All toolchain dependencies are circa the GCC 8.5.0 release: GCC 8.5.0, binutils 2.37, gmp 6.2.1, mpfr 4.1.0, mpc 1.2.1, isl 0.18 Native: * arm (smoke tested on ipodvideo+mini2g) * mips (seems to be stable on xDuoo X3) * m68k (binaries untested) Hosted: * arm (binaries untested) * mips (smoke tested on xDuoo X3ii) Unchanged: * Android NDK (unchanged at GCC 4.9.4) Change-Id: I1c2fca5d87d4a11e50aa495fad75f4f9c938c766
-rwxr-xr-xtools/configure12
-rwxr-xr-xtools/rockboxdev.sh103
-rw-r--r--tools/toolchain-patches/glibc-227-make44.patch (renamed from tools/toolchain-patches/glibc-225-make44.patch)102
-rw-r--r--tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff56
-rw-r--r--tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff77
5 files changed, 172 insertions, 178 deletions
diff --git a/tools/configure b/tools/configure
index 35f4b6d107..d632da75ca 100755
--- a/tools/configure
+++ b/tools/configure
@@ -137,7 +137,7 @@ app_set_lcd_size () {
137 137
138findarmgcc() { 138findarmgcc() {
139 prefixtools arm-elf-eabi- 139 prefixtools arm-elf-eabi-
140 gccchoice="4.9.4" 140 gccchoice="8.5.0"
141} 141}
142 142
143# scan the $PATH for the given command 143# scan the $PATH for the given command
@@ -531,7 +531,7 @@ coldfirecc () {
531 GCCOPTS="$CCOPTS -mcpu=5249 -malign-int -mstrict-align" 531 GCCOPTS="$CCOPTS -mcpu=5249 -malign-int -mstrict-align"
532 GCCOPTIMIZE="-fomit-frame-pointer" 532 GCCOPTIMIZE="-fomit-frame-pointer"
533 endian="big" 533 endian="big"
534 gccchoice="4.9.4" 534 gccchoice="8.5.0"
535} 535}
536 536
537arm7tdmicc () { 537arm7tdmicc () {
@@ -604,7 +604,7 @@ mipselcc () {
604 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses" 604 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
605 GCCOPTIMIZE="-fomit-frame-pointer" 605 GCCOPTIMIZE="-fomit-frame-pointer"
606 endian="little" 606 endian="little"
607 gccchoice="4.9.4" 607 gccchoice="8.5.0"
608} 608}
609 609
610mipsr2elcc () { 610mipsr2elcc () {
@@ -614,7 +614,7 @@ mipsr2elcc () {
614 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses" 614 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
615 GCCOPTIMIZE="-fomit-frame-pointer" 615 GCCOPTIMIZE="-fomit-frame-pointer"
616 endian="little" 616 endian="little"
617 gccchoice="4.9.4" 617 gccchoice="8.5.0"
618} 618}
619 619
620maemocc () { 620maemocc () {
@@ -761,7 +761,7 @@ arm1176jzlinuxcc () {
761 GCCOPTS="$GCCOPTS -D_GNU_SOURCE=1 -U_FORTIFY_SOURCE -D_REENTRANT" 761 GCCOPTS="$GCCOPTS -D_GNU_SOURCE=1 -U_FORTIFY_SOURCE -D_REENTRANT"
762 762
763 # Set up compiler 763 # Set up compiler
764 gccchoice="4.9.4" 764 gccchoice="8.5.0"
765 prefixtools "arm-rockbox-linux-gnueabi-" 765 prefixtools "arm-rockbox-linux-gnueabi-"
766} 766}
767 767
@@ -935,7 +935,7 @@ mipsellinuxcc () {
935 GCCOPTS="$GCCOPTS -D_GNU_SOURCE=1 -U_FORTIFY_SOURCE -D_REENTRANT" 935 GCCOPTS="$GCCOPTS -D_GNU_SOURCE=1 -U_FORTIFY_SOURCE -D_REENTRANT"
936 936
937 # Set up compiler 937 # Set up compiler
938 gccchoice="4.9.4" 938 gccchoice="8.5.0"
939 prefixtools "mipsel-rockbox-linux-gnu-" 939 prefixtools "mipsel-rockbox-linux-gnu-"
940} 940}
941 941
diff --git a/tools/rockboxdev.sh b/tools/rockboxdev.sh
index 63b1a1f5a1..540ede75e2 100755
--- a/tools/rockboxdev.sh
+++ b/tools/rockboxdev.sh
@@ -458,30 +458,30 @@ build() {
458 cd "$toolname-$version" 458 cd "$toolname-$version"
459 if (echo $needs_libs | grep -q gmp && test ! -d gmp); then 459 if (echo $needs_libs | grep -q gmp && test ! -d gmp); then
460 echo "ROCKBOXDEV: Getting GMP" 460 echo "ROCKBOXDEV: Getting GMP"
461 getfile "gmp-4.3.2.tar.bz2" "$GNU_MIRROR/gmp" 461 getfile "gmp-6.2.1.tar.bz2" "$GNU_MIRROR/gmp"
462 tar xjf $dlwhere/gmp-4.3.2.tar.bz2 462 tar xjf $dlwhere/gmp-6.2.1.tar.bz2
463 ln -s gmp-4.3.2 gmp 463 ln -s gmp-6.2.1 gmp
464 fi 464 fi
465 465
466 if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then 466 if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then
467 echo "ROCKBOXDEV: Getting MPFR" 467 echo "ROCKBOXDEV: Getting MPFR"
468 getfile "mpfr-3.1.0.tar.bz2" "$GNU_MIRROR/mpfr" 468 getfile "mpfr-4.1.0.tar.bz2" "$GNU_MIRROR/mpfr"
469 tar xjf $dlwhere/mpfr-3.1.0.tar.bz2 469 tar xjf $dlwhere/mpfr-4.1.0.tar.bz2
470 ln -s mpfr-3.1.0 mpfr 470 ln -s mpfr-4.1.0 mpfr
471 fi 471 fi
472 472
473 if (echo $needs_libs | grep -q mpc && test ! -d mpc); then 473 if (echo $needs_libs | grep -q mpc && test ! -d mpc); then
474 echo "ROCKBOXDEV: Getting MPC" 474 echo "ROCKBOXDEV: Getting MPC"
475 getfile "mpc-1.0.1.tar.gz" "http://www.multiprecision.org/downloads" 475 getfile "mpc-1.2.1.tar.gz" "http://www.multiprecision.org/downloads"
476 tar xzf $dlwhere/mpc-1.0.1.tar.gz 476 tar xzf $dlwhere/mpc-1.2.1.tar.gz
477 ln -s mpc-1.0.1 mpc 477 ln -s mpc-1.2.1 mpc
478 fi 478 fi
479 479
480 if (echo $needs_libs | grep -q isl && test ! -d isl); then 480 if (echo $needs_libs | grep -q isl && test ! -d isl); then
481 echo "ROCKBOXDEV: Getting ISL" 481 echo "ROCKBOXDEV: Getting ISL"
482 getfile "isl-0.15.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure" 482 getfile "isl-0.18.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure"
483 tar xjf $dlwhere/isl-0.15.tar.bz2 483 tar xjf $dlwhere/isl-0.18.tar.bz2
484 ln -s isl-0.15 isl 484 ln -s isl-0.18 isl
485 fi 485 fi
486 cd $builddir 486 cd $builddir
487 fi 487 fi
@@ -541,9 +541,9 @@ build_linux_toolchain () {
541 541
542 # check libraries: 542 # check libraries:
543 # contrary to other toolchains that rely on a hack to avoid installing 543 # contrary to other toolchains that rely on a hack to avoid installing
544 # gmp, mpc and mpfr, we simply require that they are installed on the system 544 # gmp, mpc, and mpfr, we simply require that they are installed on
545 # this is not a huge requirement since virtually all systems these days 545 # the system this is not a huge requirement since virtually all systems
546 # provide dev packages for them 546 # these days provide dev packages for them
547 # FIXME: maybe add an option to download and install them automatically 547 # FIXME: maybe add an option to download and install them automatically
548 checklib "mpc" "gmp" "mpfr" 548 checklib "mpc" "gmp" "mpfr"
549 549
@@ -764,26 +764,26 @@ do
764 echo "" 764 echo ""
765 case $arch in 765 case $arch in
766 [Ii]) 766 [Ii])
767 build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror" "isl" 767 build "binutils" "mipsel-elf" "2.37" "" "--disable-werror" "gmp isl"
768 build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc isl" 768 build "gcc" "mipsel-elf" "8.5.0" "" "" "gmp mpfr mpc isl"
769 ;; 769 ;;
770 770
771 [Mm]) 771 [Mm])
772 build "binutils" "m68k-elf" "2.26.1" "" "--disable-werror" "isl" 772 build "binutils" "m68k-elf" "2.37" "" "--disable-werror" "gmp isl"
773 build "gcc" "m68k-elf" "4.9.4" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl" 773 build "gcc" "m68k-elf" "8.5.0" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl"
774 ;; 774 ;;
775 775
776 [Aa]) 776 [Aa])
777 binopts="" 777 binopts=""
778 gccopts="" 778 gccopts="--with-multilib-list=rmprofile"
779 case $system in 779 case $system in
780 Darwin) 780 Darwin)
781 binopts="--disable-nls" 781 binopts="--disable-nls"
782 gccopts="--disable-nls" 782 gccopts="--disable-nls"
783 ;; 783 ;;
784 esac 784 esac
785 build "binutils" "arm-elf-eabi" "2.26.1" "" "$binopts --disable-werror" "isl" 785 build "binutils" "arm-elf-eabi" "2.37" "" "$binopts --disable-werror" "gmp isl"
786 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" 786 build "gcc" "arm-elf-eabi" "8.5.0" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff" "$gccopts MAKEINFO=missing" "gmp mpfr mpc isl"
787 ;; 787 ;;
788 [Xx]) 788 [Xx])
789 # IMPORTANT NOTE 789 # IMPORTANT NOTE
@@ -792,30 +792,19 @@ do
792 # 792 #
793 # Samsung YP-R0/R1: 793 # Samsung YP-R0/R1:
794 # ARM1176JZF-S, softfp EABI 794 # ARM1176JZF-S, softfp EABI
795 # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that 795 # kernel: device runs 2.6.24, but oem toolchain is built against 2.6.27.59
796 # compiles with GCC >6 796 # glibc: device runs 2.4.2
797 # kernel: 2.6.27.59 is the same 2.6.x stable kernel as used by the 797 #
798 # original ct-ng toolchain, the device runs kernel 2.6.24
799 # glibc: 2.19 is the latest version that supports kernel 2.6.24 which
800 # is used on the device, but we need to support ABI 2.4 because
801 # the device uses glibc 2.4.2
802 #
803 # Sony NWZ: 798 # Sony NWZ:
804 # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that 799 # kernel: Varies from device to device; 2.6.23, 2.6.35, and 3.x seen.
805 # compiles with GCC >6 800 # glibc: device runs 2.7
806 # kernel: 2.6.32.68 is the latest 2.6.x stable kernel, the device
807 # runs kernel 2.6.23 or 2.6.35 or 3.x for the most recent
808 # glibc: 2.19 is the latest version that supports kernel 2.6.23 which
809 # is used on many Sony players, but we need to support ABI 2.7
810 # because the device uses glibc 2.7
811 # 801 #
812 # Thus the lowest common denominator is to use the latest 2.6.x stable 802 # Thus the lowest common denominator is to target 2.6.23 and glibc 2.4
813 # kernel but compile glibc to support kernel 2.6.23 and glibc 2.4. 803 # Use a recent 2.6.32 LTS kernel, but glibc 2.20 targeting 2.6.23 and API 2.4
814 # We use a recent 2.26.1 binutils to avoid any build problems and 804 #
815 # avoid patches/bugs.
816 glibcopts="--enable-kernel=2.6.23 --enable-oldest-abi=2.4" 805 glibcopts="--enable-kernel=2.6.23 --enable-oldest-abi=2.4"
817 build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.26.1" "" "4.9.4" \ 806 build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.37" "" "8.5.0" \
818 "$gccopts" "2.6.32.68" "2.19" "$glibcopts" "glibc-220-make44.patch" 807 "$gccopts" "2.6.32.71" "2.20" "$glibcopts" "glibc-220-make44.patch"
819 # build alsa-lib 808 # build alsa-lib
820 # we need to set the prefix to how it is on device (/usr) and then 809 # we need to set the prefix to how it is on device (/usr) and then
821 # tweak install dir at make install step 810 # tweak install dir at make install step
@@ -830,28 +819,22 @@ do
830 # This toolchain must support several targets and thus must support 819 # This toolchain must support several targets and thus must support
831 # the oldest possible configuration. 820 # the oldest possible configuration.
832 # 821 #
833 # AGPTek Rocker: 822 # AGPTek Rocker (and other HibyOS players):
834 # XBurst release 1 (something inbetween mips32r1 and mips32r2)
835 # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that
836 # compiles with GCC >6
837 # kernel: 3.10.14 823 # kernel: 3.10.14
838 # glibc: 2.16 824 # glibc: 2.16
839 # alsa: 1.0.29 825 # alsa: 1.0.29
840 # 826 #
841 # FiiO M3K Linux: 827 # FiiO M3K Linux (Based on Ingenic SDK):
842 # kernel: 3.10.14 828 # kernel: 3.10.14
843 # glibc: 2.16 829 # glibc: 2.16
844 # alsa: 1.0.26 830 # alsa: 1.0.26
845 # 831 #
846 # To maximize compatibility, we use kernel 3.2.85 which is the lastest 832 # Use a recent 3.10 LTS kernel, but glibc 2.27 targeting 3.2.x and API 2.16
847 # longterm 3.2 kernel and is supported by the latest glibc, and we 833 #
848 # require support for up to glibc 2.16
849 # We use a recent 2.26.1 binutils to avoid any build problems and
850 # avoid patches/bugs.
851 glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16" 834 glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16"
852 # FIXME: maybe add -mhard-float 835 # FIXME: maybe add -mhard-float?
853 build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.26.1" "" "4.9.4" \ 836 build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.37" "" "8.5.0" \
854 "$gccopts" "3.2.85" "2.25" "$glibcopts" "glibc-225-make44.patch" 837 "$gccopts" "3.10.108" "2.27" "$glibcopts" "glibc-227-make44.patch"
855 # build alsa-lib 838 # build alsa-lib
856 # we need to set the prefix to how it is on device (/usr) and then 839 # we need to set the prefix to how it is on device (/usr) and then
857 # tweak install dir at make install step 840 # tweak install dir at make install step
@@ -859,7 +842,10 @@ do
859 gettool "alsa-lib" "$alsalib_ver" 842 gettool "alsa-lib" "$alsalib_ver"
860 extract "alsa-lib-$alsalib_ver" 843 extract "alsa-lib-$alsalib_ver"
861 prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \ 844 prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \
862 "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot" 845 "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot"
846
847 ### Everything below here is needed only for bluetooth support
848
863 # build libffi 849 # build libffi
864 libffi_ver="3.2.1" 850 libffi_ver="3.2.1"
865 gettool "libffi" "$libffi_ver" 851 gettool "libffi" "$libffi_ver"
@@ -880,7 +866,7 @@ do
880 gettool "glib" "$glib_ver" 866 gettool "glib" "$glib_ver"
881 extract "glib-$glib_ver" 867 extract "glib-$glib_ver"
882 prefix="/usr" buildtool "glib" "$glib_ver" \ 868 prefix="/usr" buildtool "glib" "$glib_ver" \
883 "--host=$target --with-sysroot=$prefix/$target/sysroot --disable-libelf glib_cv_stack_grows=no glib_cv_uscore=no ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes" "" "install DESTDIR=$prefix/$target/sysroot" 869 "--host=$target --with-sysroot=$prefix/$target/sysroot --disable-libelf glib_cv_stack_grows=no glib_cv_uscore=no ac_cv_func_posix_getpwuid_r=yes ac_cv_func_posix_getgrgid_r=yes CFLAGS=-Wno-error=format-nonliteral" "" "install DESTDIR=$prefix/$target/sysroot"
884 870
885 # build expat 871 # build expat
886 expat_ver="2.1.0" 872 expat_ver="2.1.0"
@@ -896,7 +882,6 @@ do
896 prefix="/usr" buildtool "dbus" "$dbus_ver" \ 882 prefix="/usr" buildtool "dbus" "$dbus_ver" \
897 "--host=$target --with-sysroot=$prefix/$target/sysroot --includedir=/usr/include --enable-abstract-sockets ac_cv_lib_expat_XML_ParserCreate_MM=yes --disable-systemd --disable-launchd --enable-x11-autolaunch=no --with-x=no -disable-selinux --disable-apparmor --disable-doxygen-docs " "" "install DESTDIR=$prefix/$target/sysroot " 883 "--host=$target --with-sysroot=$prefix/$target/sysroot --includedir=/usr/include --enable-abstract-sockets ac_cv_lib_expat_XML_ParserCreate_MM=yes --disable-systemd --disable-launchd --enable-x11-autolaunch=no --with-x=no -disable-selinux --disable-apparmor --disable-doxygen-docs " "" "install DESTDIR=$prefix/$target/sysroot "
898 884
899
900 ;; 885 ;;
901 *) 886 *)
902 echo "ROCKBOXDEV: Unsupported architecture option: $arch" 887 echo "ROCKBOXDEV: Unsupported architecture option: $arch"
diff --git a/tools/toolchain-patches/glibc-225-make44.patch b/tools/toolchain-patches/glibc-227-make44.patch
index 45d4e9c621..3de5cb0fdd 100644
--- a/tools/toolchain-patches/glibc-225-make44.patch
+++ b/tools/toolchain-patches/glibc-227-make44.patch
@@ -1,7 +1,7 @@
1diff -Naur glibc-2.25/libio/stdio.h glibc-2.25-patched/libio/stdio.h 1diff -Naur glibc-2.27/libio/stdio.h glibc-2.27-patched/libio/stdio.h
2--- glibc-2.25/libio/stdio.h 2017-02-05 10:28:43.000000000 -0500 2--- glibc-2.27/libio/stdio.h 2018-02-01 11:17:18.000000000 -0500
3+++ glibc-2.25-patched/libio/stdio.h 2023-05-23 15:22:27.482980335 -0400 3+++ glibc-2.27-patched/libio/stdio.h 2023-05-23 14:10:06.618633203 -0400
4@@ -154,18 +154,23 @@ 4@@ -118,18 +118,23 @@
5 # define P_tmpdir "/tmp" 5 # define P_tmpdir "/tmp"
6 #endif 6 #endif
7 7
@@ -32,20 +32,19 @@ diff -Naur glibc-2.25/libio/stdio.h glibc-2.25-patched/libio/stdio.h
32 32
33 /* Standard streams. */ 33 /* Standard streams. */
34 extern struct _IO_FILE *stdin; /* Standard input stream. */ 34 extern struct _IO_FILE *stdin; /* Standard input stream. */
35diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules 35diff -Naur glibc-2.27/Makerules glibc-2.27-patched/Makerules
36--- glibc-2.25/Makerules 2017-02-05 10:28:43.000000000 -0500 36--- glibc-2.27/Makerules 2018-02-01 11:17:18.000000000 -0500
37+++ glibc-2.25-patched/Makerules 2023-05-23 15:22:05.594967548 -0400 37+++ glibc-2.27-patched/Makerules 2023-05-23 14:10:06.617633203 -0400
38@@ -1474,55 +1474,7 @@ 38@@ -1522,46 +1522,6 @@
39 endif
40 39
41 endif 40 endif
42- 41
43-# These will have been set by sysdeps/posix/Makefile. 42-# These will have been set by sysdeps/posix/Makefile.
44-L_tmpnam ?= 1 43-L_tmpnam ?= 1
45-TMP_MAX ?= 0 44-TMP_MAX ?= 0
46-L_ctermid ?= 1 45-L_ctermid ?= 1
47-L_cuserid ?= 1 46-L_cuserid ?= 1
48 47-
49-stdio_lim = $(common-objpfx)bits/stdio_lim.h 48-stdio_lim = $(common-objpfx)bits/stdio_lim.h
50- 49-
51-$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @: 50-$(stdio_lim:lim.h=%.h) $(stdio_lim:lim.h=%.d): $(stdio_lim:lim.h=%.st); @:
@@ -53,8 +52,7 @@ diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules
53- $(common-objpfx)config.make 52- $(common-objpfx)config.make
54- $(make-target-directory) 53- $(make-target-directory)
55- { echo '#include "$(..)posix/bits/posix1_lim.h"'; \ 54- { echo '#include "$(..)posix/bits/posix1_lim.h"'; \
56- echo '#define _LIBC 1'; \ 55- } | \
57- echo '#include "$(..)misc/sys/uio.h"'; } | \
58- $(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' \ 56- $(CC) -E -dM -MD -MP -MF $(@:st=dT) -MT '$(@:st=h) $(@:st=d)' \
59- $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT) 57- $(CPPUNDEFS) $(+includes) -xc - -o $(@:st=hT)
60- sed $(sed-remove-objpfx) $(sed-remove-dotdot) \ 58- sed $(sed-remove-objpfx) $(sed-remove-dotdot) \
@@ -62,21 +60,14 @@ diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules
62- mv -f $(@:st=dt) $(@:st=d) 60- mv -f $(@:st=dt) $(@:st=d)
63- fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; \ 61- fopen_max=`sed -n 's/^#define OPEN_MAX //1p' $(@:st=hT)`; \
64- filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`; \ 62- filename_max=`sed -n 's/^#define PATH_MAX //1p' $(@:st=hT)`; \
65- iov_max=`sed -n 's/^#define UIO_MAXIOV //p' $(@:st=hT)`; \
66- fopen_max=$${fopen_max:-16}; \ 63- fopen_max=$${fopen_max:-16}; \
67- filename_max=$${filename_max:-1024}; \ 64- filename_max=$${filename_max:-1024}; \
68- if [ -z "$$iov_max" ]; then \
69- define_iov_max="# undef IOV_MAX"; \
70- else \
71- define_iov_max="# define IOV_MAX $$iov_max"; \
72- fi; \
73- sed -e "s/@FOPEN_MAX@/$$fopen_max/" \ 65- sed -e "s/@FOPEN_MAX@/$$fopen_max/" \
74- -e "s/@FILENAME_MAX@/$$filename_max/" \ 66- -e "s/@FILENAME_MAX@/$$filename_max/" \
75- -e "s/@L_tmpnam@/$(L_tmpnam)/" \ 67- -e "s/@L_tmpnam@/$(L_tmpnam)/" \
76- -e "s/@TMP_MAX@/$(TMP_MAX)/" \ 68- -e "s/@TMP_MAX@/$(TMP_MAX)/" \
77- -e "s/@L_ctermid@/$(L_ctermid)/" \ 69- -e "s/@L_ctermid@/$(L_ctermid)/" \
78- -e "s/@L_cuserid@/$(L_cuserid)/" \ 70- -e "s/@L_cuserid@/$(L_cuserid)/" \
79- -e "s/@define_IOV_MAX@/$$define_iov_max/" \
80- $< > $(@:st=h.new) 71- $< > $(@:st=h.new)
81- $(move-if-change) $(@:st=h.new) $(@:st=h) 72- $(move-if-change) $(@:st=h.new) $(@:st=h)
82-# Remove these last so that they can be examined if something went wrong. 73-# Remove these last so that they can be examined if something went wrong.
@@ -91,9 +82,9 @@ diff -Naur glibc-2.25/Makerules glibc-2.25-patched/Makerules
91 FORCE: 82 FORCE:
92 83
93 .PHONY: echo-headers 84 .PHONY: echo-headers
94diff -Naur glibc-2.25/Rules glibc-2.25-patched/Rules 85diff -Naur glibc-2.27/Rules glibc-2.27-patched/Rules
95--- glibc-2.25/Rules 2017-02-05 10:28:43.000000000 -0500 86--- glibc-2.27/Rules 2018-02-01 11:17:18.000000000 -0500
96+++ glibc-2.25-patched/Rules 2023-05-23 15:22:27.482980335 -0400 87+++ glibc-2.27-patched/Rules 2023-05-23 14:10:06.617633203 -0400
97@@ -60,9 +60,6 @@ 88@@ -60,9 +60,6 @@
98 common-generated := 89 common-generated :=
99 endif 90 endif
@@ -104,11 +95,11 @@ diff -Naur glibc-2.25/Rules glibc-2.25-patched/Rules
104 include $(..)Makerules 95 include $(..)Makerules
105 96
106 .PHONY: subdir_lib 97 .PHONY: subdir_lib
107diff -Naur glibc-2.25/stdio-common/stdio_lim.h.in glibc-2.25-patched/stdio-common/stdio_lim.h.in 98diff -Naur glibc-2.27/stdio-common/stdio_lim.h.in glibc-2.27-patched/stdio-common/stdio_lim.h.in
108--- glibc-2.25/stdio-common/stdio_lim.h.in 2017-02-05 10:28:43.000000000 -0500 99--- glibc-2.27/stdio-common/stdio_lim.h.in 2018-02-01 11:17:18.000000000 -0500
109+++ glibc-2.25-patched/stdio-common/stdio_lim.h.in 1969-12-31 19:00:00.000000000 -0500 100+++ glibc-2.27-patched/stdio-common/stdio_lim.h.in 1969-12-31 19:00:00.000000000 -0500
110@@ -1,42 +0,0 @@ 101@@ -1,39 +0,0 @@
111-/* Copyright (C) 1994-2017 Free Software Foundation, Inc. 102-/* Copyright (C) 1994-2018 Free Software Foundation, Inc.
112- This file is part of the GNU C Library. 103- This file is part of the GNU C Library.
113- 104-
114- The GNU C Library is free software; you can redistribute it and/or 105- The GNU C Library is free software; you can redistribute it and/or
@@ -125,34 +116,31 @@ diff -Naur glibc-2.25/stdio-common/stdio_lim.h.in glibc-2.25-patched/stdio-commo
125- License along with the GNU C Library; if not, see 116- License along with the GNU C Library; if not, see
126- <http://www.gnu.org/licenses/>. */ 117- <http://www.gnu.org/licenses/>. */
127- 118-
128-#if !defined _STDIO_H && !defined __need_FOPEN_MAX && !defined __need_IOV_MAX 119-#ifndef _BITS_STDIO_LIM_H
120-#define _BITS_STDIO_LIM_H 1
121-
122-#ifndef _STDIO_H
129-# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead." 123-# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
130-#endif 124-#endif
131- 125-
132-#ifdef _STDIO_H 126-#define L_tmpnam @L_tmpnam@
133-# define L_tmpnam @L_tmpnam@ 127-#define TMP_MAX @TMP_MAX@
134-# define TMP_MAX @TMP_MAX@ 128-#define FILENAME_MAX @FILENAME_MAX@
135-# define FILENAME_MAX @FILENAME_MAX@
136- 129-
137-# ifdef __USE_POSIX 130-#ifdef __USE_POSIX
138-# define L_ctermid @L_ctermid@ 131-# define L_ctermid @L_ctermid@
139-# if !defined __USE_XOPEN2K || defined __USE_GNU 132-# if !defined __USE_XOPEN2K || defined __USE_GNU
140-# define L_cuserid @L_cuserid@ 133-# define L_cuserid @L_cuserid@
141-# endif
142-# endif 134-# endif
143-#endif 135-#endif
144- 136-
145-#if defined __need_FOPEN_MAX || defined _STDIO_H 137-#undef FOPEN_MAX
146-# undef FOPEN_MAX 138-#define FOPEN_MAX @FOPEN_MAX@
147-# define FOPEN_MAX @FOPEN_MAX@
148-#endif
149- 139-
150-#if defined __need_IOV_MAX && !defined IOV_MAX 140-#endif /* bits/stdio_lim.h */
151-@define_IOV_MAX@ 141diff -Naur glibc-2.27/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.27-patched/sysdeps/mach/hurd/bits/stdio_lim.h
152-#endif 142--- glibc-2.27/sysdeps/mach/hurd/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
153diff -Naur glibc-2.25/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.25-patched/sysdeps/mach/hurd/bits/stdio_lim.h 143+++ glibc-2.27-patched/sysdeps/mach/hurd/bits/stdio_lim.h 2023-05-23 14:10:06.618633203 -0400
154--- glibc-2.25/sysdeps/mach/hurd/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
155+++ glibc-2.25-patched/sysdeps/mach/hurd/bits/stdio_lim.h 2023-05-23 15:22:27.483980336 -0400
156@@ -0,0 +1,28 @@ 144@@ -0,0 +1,28 @@
157+/* System specific stdio.h definitions. Hurd version. 145+/* System specific stdio.h definitions. Hurd version.
158+ Copyright (C) 2023 Free Software Foundation, Inc. 146+ Copyright (C) 2023 Free Software Foundation, Inc.
@@ -182,9 +170,9 @@ diff -Naur glibc-2.25/sysdeps/mach/hurd/bits/stdio_lim.h glibc-2.25-patched/sysd
182+#define FILENAME_MAX 1024 170+#define FILENAME_MAX 1024
183+ 171+
184+#endif /* bits/stdio_lim.h */ 172+#endif /* bits/stdio_lim.h */
185diff -Naur glibc-2.25/sysdeps/posix/Makefile glibc-2.25-patched/sysdeps/posix/Makefile 173diff -Naur glibc-2.27/sysdeps/posix/Makefile glibc-2.27-patched/sysdeps/posix/Makefile
186--- glibc-2.25/sysdeps/posix/Makefile 2017-02-05 10:28:43.000000000 -0500 174--- glibc-2.27/sysdeps/posix/Makefile 2018-02-01 11:17:18.000000000 -0500
187+++ glibc-2.25-patched/sysdeps/posix/Makefile 2023-05-23 15:22:27.483980336 -0400 175+++ glibc-2.27-patched/sysdeps/posix/Makefile 2023-05-23 14:10:06.618633203 -0400
188@@ -1,8 +1,3 @@ 176@@ -1,8 +1,3 @@
189-# These affect the generated bits/stdio_lim.h file. 177-# These affect the generated bits/stdio_lim.h file.
190-L_tmpnam = 20 178-L_tmpnam = 20
@@ -194,9 +182,9 @@ diff -Naur glibc-2.25/sysdeps/posix/Makefile glibc-2.25-patched/sysdeps/posix/Ma
194 182
195 ifeq ($(subdir)|$(have-thread-library),rt|no) 183 ifeq ($(subdir)|$(have-thread-library),rt|no)
196 # With NPTL, this lives in libpthread so it can be used for sem_open too. 184 # With NPTL, this lives in libpthread so it can be used for sem_open too.
197diff -Naur glibc-2.25/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.25-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h 185diff -Naur glibc-2.27/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.27-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h
198--- glibc-2.25/sysdeps/unix/sysv/linux/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500 186--- glibc-2.27/sysdeps/unix/sysv/linux/bits/stdio_lim.h 1969-12-31 19:00:00.000000000 -0500
199+++ glibc-2.25-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h 2023-05-23 15:22:27.483980336 -0400 187+++ glibc-2.27-patched/sysdeps/unix/sysv/linux/bits/stdio_lim.h 2023-05-23 14:10:06.618633203 -0400
200@@ -0,0 +1,28 @@ 188@@ -0,0 +1,28 @@
201+/* System specific stdio.h definitions. Linux version. 189+/* System specific stdio.h definitions. Linux version.
202+ Copyright (C) 2023 Free Software Foundation, Inc. 190+ Copyright (C) 2023 Free Software Foundation, Inc.
@@ -219,9 +207,9 @@ diff -Naur glibc-2.25/sysdeps/unix/sysv/linux/bits/stdio_lim.h glibc-2.25-patche
219+#ifndef _BITS_STDIO_LIM_H 207+#ifndef _BITS_STDIO_LIM_H
220+#define _BITS_STDIO_LIM_H 1 208+#define _BITS_STDIO_LIM_H 1
221+ 209+
222+//#ifndef _STDIO_H 210+#ifndef _STDIO_H
223+//# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead." 211+# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
224+//#endif 212+#endif
225+ 213+
226+#define FILENAME_MAX 4096 214+#define FILENAME_MAX 4096
227+ 215+
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
deleted file mode 100644
index cd98d3751c..0000000000
--- a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-4.9.4.diff
+++ /dev/null
@@ -1,56 +0,0 @@
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
diff --git a/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff
new file mode 100644
index 0000000000..b320b969a5
--- /dev/null
+++ b/tools/toolchain-patches/rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-8.5.0.diff
@@ -0,0 +1,77 @@
1diff -Naur gcc-8.5.0/gcc/config/arm/arm_cmse.h gcc-8.5.0-patched/gcc/config/arm/ar
2m_cmse.h
3--- gcc-8.5.0/gcc/config/arm/arm_cmse.h 2021-05-14 04:42:08.000000000 -0400
4+++ gcc-8.5.0-patched/gcc/config/arm/arm_cmse.h 2023-04-17 14:32:56.547477547 -0400
5@@ -35,7 +35,7 @@
6 #if __ARM_FEATURE_CMSE & 1
7
8 #include <stddef.h>
9-#include <stdint.h>
10+//#include <stdint.h>
11
12 #ifdef __ARM_BIG_ENDIAN
13
14diff -aur gcc-8.5.0/gcc/config/arm/t-arm-elf gcc-8.5.0-patched/gcc/config/arm/t-arm-elf
15--- gcc-8.5.0/gcc/config/arm/t-arm-elf 2021-05-14 04:42:08.000000000 -0400
16+++ gcc-8.5.0-patched/gcc/config/arm/t-arm-elf 2022-11-26 23:16:30.714433566 -0500
17@@ -80,6 +80,10 @@
18 MULTILIB_REQUIRED += marm/mfpu=auto/march=armv5te+fp/mfloat-abi=hard
19 MULTILIB_REQUIRED += mthumb/mfpu=auto/march=armv7+fp/mfloat-abi=hard
20
21+# And we want to be able to disable interworking
22+MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
23+MULTILIB_DIRNAMES += normal interwork
24+
25 # PART 3 - Match rules
26
27 # Map all supported FPUs onto mfpu=auto
28diff -aur gcc-8.5.0/libgcc/config/arm/t-bpabi gcc-8.5.0-patched/libgcc/config/arm/t-bpabi
29--- gcc-8.5.0/libgcc/config/arm/t-bpabi 2021-05-14 04:42:10.000000000 -0400
30+++ gcc-8.5.0-patched/libgcc/config/arm/t-bpabi 2022-11-26 23:14:40.938038440 -0500
31@@ -17,4 +17,4 @@
32 # On ARM, specifying -fnon-call-exceptions will needlessly pull in
33 # the unwinder in simple programs which use 64-bit division. Omitting
34 # the option is safe.
35-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions
36+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
37diff -aur gcc-8.5.0/libgcc/config/arm/cmse.c gcc-8.5.0-patch/libgcc/config/arm/cmse.c
38--- gcc-8.5.0/libgcc/config/arm/cmse.c 2021-05-14 04:42:10.000000000 -0400
39+++ gcc-8.5.0-patched/libgcc/config/arm/cmse.c 2023-04-17 15:12:11.865456701 -0400
40@@ -36,7 +36,7 @@
41 char *pb = (char *) p, *pe;
42
43 /* Check if the range wraps around. */
44- if (UINTPTR_MAX - (uintptr_t) p < size)
45+ if (__UINTPTR_MAX__ - (__UINTPTR_TYPE__) p < size)
46 return NULL;
47
48 /* Check if an unknown flag is present. */
49@@ -51,7 +51,7 @@
50
51 /* Execute the right variant of the TT instructions. */
52 pe = pb + size - 1;
53- const int singleCheck = (((uintptr_t) pb ^ (uintptr_t) pe) < 32);
54+ const int singleCheck = (((__UINTPTR_TYPE__) pb ^ (__UINTPTR_TYPE__) pe) < 32);
55 switch (flags & known_secure_level)
56 {
57 case 0:
58diff -aur gcc-8.5.0/libgcc/Makefile.in gcc-8.5.0-patched/libgcc/Makefile.in
59--- gcc-8.5.0/libgcc/Makefile.in 2021-05-14 04:42:10.000000000 -0400
60+++ gcc-8.5.0-patched/libgcc/Makefile.in 2022-11-26 23:13:56.781304250 -0500
61@@ -526,7 +526,7 @@
62 ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
63 # Provide default flags for compiling divmod functions, if they haven't been
64 # set already by a target-specific Makefile fragment.
65-LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
66+LIB2_DIVMOD_EXCEPTION_FLAGS := -fno-exceptions -fno-non-call-exceptions
67 endif
68
69 # Build LIB2_DIVMOD_FUNCS.
70@@ -847,7 +847,7 @@
71 # libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
72 # LIB2ADDEHSHARED matter. (Usually all three are identical.)
73
74-c_flags := -fexceptions
75+c_flags := -fno-exceptions
76
77 ifeq ($(enable_shared),yes)