···138138139139findarmgcc() {
140140 prefixtools arm-elf-eabi-
141141- gccchoice="10.5.0"
141141+ gccchoice="4.9.4"
142142}
143143144144# scan the $PATH for the given command
···548548 GCCOPTS="$CCOPTS -mcpu=5249 -malign-int -mstrict-align"
549549 GCCOPTIMIZE="-fomit-frame-pointer"
550550 endian="big"
551551- gccchoice="10.5.0"
551551+ gccchoice="4.9.4"
552552}
553553554554arm7tdmicc () {
···628628 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
629629 GCCOPTIMIZE="-fomit-frame-pointer"
630630 endian="little"
631631- gccchoice="10.5.0"
631631+ gccchoice="4.9.4"
632632}
633633634634mipsr2elcc () {
···638638 GCCOPTS="$GCCOPTS -ffunction-sections -msoft-float -G 0 -Wno-parentheses"
639639 GCCOPTIMIZE="-fomit-frame-pointer"
640640 endian="little"
641641- gccchoice="10.5.0"
641641+ gccchoice="4.9.4"
642642}
643643644644maemocc () {
···776776 GCCOPTIMIZE=''
777777 LDOPTS="-lasound -lpthread -lm -ldl -lrt $LDOPTS"
778778 GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs" # warn about undefined symbols in shared libraries
779779- GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,-z,defs -Wl,-z,noexecstack" # Stack is not executable
780779 SHARED_LDFLAGS="-shared"
781780 SHARED_CFLAGS=''
782781 endian="little"
···786785 GCCOPTS="$GCCOPTS -D_GNU_SOURCE=1 -U_FORTIFY_SOURCE -D_REENTRANT"
787786788787 # Set up compiler
789789- gccchoice="10.5.0"
788788+ gccchoice="4.9.4"
790789 prefixtools "arm-rockbox-linux-gnueabi-"
791790}
792791···966965 GCCOPTS="$GCCOPTS -D_GNU_SOURCE=1 -U_FORTIFY_SOURCE -D_REENTRANT"
967966968967 # Set up compiler
969969- gccchoice="10.5.0"
968968+ gccchoice="4.9.4"
970969 prefixtools "mipsel-rockbox-linux-gnu-"
971970}
972971···46954694 ldnum=0
46964695else
46974696 ldnum=`$LD --version | sed -n '1p' | sed -e 's/.* \([0-9]*\)\.\([0-9]*\).*/\1\2/'`
46984698-fi
46994699-47004700-if test "$ldnum" -ge "239"; then
47014701- GLOBAL_LDOPTS="$GLOBAL_LDOPTS -Wl,--no-warn-rwx-segments"
47024697fi
4703469847044699if test "$ldnum" -ge "227"; then
+63-51
tools/rockboxdev.sh
···333333# $5=make install options (will be replaced by "install" if left empty)
334334# By default, the restary step is the toolname, but it can be changed by setting
335335# RESTART_STEP
336336-buildtool () {
336336+buildtool() {
337337 tool="$1"
338338 version="$2"
339339 toolname="$tool-$version"
···389389 elif [ "$config_opt" != "NO_CONFIGURE" ]; then
390390 echo "ROCKBOXDEV: $toolname/configure"
391391 cflags='-U_FORTIFY_SOURCE -fgnu89-inline -O2'
392392- if [ "$tool" == "glibc" ]; then
393393- cflags="$cflags -fcommon" # glibc < 2.30 needs -fcommon for gcc10+
394394- elif [ "$tool" == "glib" ]; then
392392+ if [ "$tool" == "glib" ]; then
395393 run_cmd "$logfile" $SED -i -e 's/m4_copy/m4_copy_force/g' "$cfg_dir/m4macros/glib-gettext.m4"
396394 run_cmd "$logfile" autoreconf -fiv "$cfg_dir"
397395 cflags="$cflags -Wno-format-nonliteral -Wno-format-overflow"
···445443446444 # For Apple targets only
447445 if [ "$system" == "Darwin" ] ; then
448448- # gcc-libcpp17: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111632
449449- patch="$patch apple_silicon.patch apple_silicon-zlib.patch gcc-libcpp17.patch"
446446+ patch="$patch apple_silicon.patch apple_silicon-zlib.patch"
450447 EXTRA_CXXFLAGS="-fbracket-depth=512"
451448 fi
452449 fi
···492489 cd "$toolname-$version"
493490 if (echo $needs_libs | grep -q gmp && test ! -d gmp); then
494491 echo "ROCKBOXDEV: Getting GMP"
495495- getfile "gmp-6.2.1.tar.bz2" "$GNU_MIRROR/gmp"
496496- tar xjf $dlwhere/gmp-6.2.1.tar.bz2
497497- ln -s gmp-6.2.1 gmp
492492+ getfile "gmp-6.1.2.tar.xz" "$GNU_MIRROR/gmp"
493493+ tar xJf $dlwhere/gmp-6.1.2.tar.xz
494494+ ln -s gmp-6.1.2 gmp
498495 fi
499496500497 if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then
501498 echo "ROCKBOXDEV: Getting MPFR"
502502- getfile "mpfr-4.1.1.tar.xz" "$GNU_MIRROR/mpfr"
503503- tar xJf $dlwhere/mpfr-4.1.1.tar.xz
504504- ln -s mpfr-4.1.1 mpfr
499499+ getfile "mpfr-3.1.6.tar.xz" "$GNU_MIRROR/mpfr"
500500+ tar xJf $dlwhere/mpfr-3.1.6.tar.xz
501501+ ln -s mpfr-3.1.6 mpfr
505502 fi
506503507504 if (echo $needs_libs | grep -q mpc && test ! -d mpc); then
508505 echo "ROCKBOXDEV: Getting MPC"
509509- getfile "mpc-1.3.1.tar.gz" "http://www.multiprecision.org/downloads"
510510- tar xzf $dlwhere/mpc-1.3.1.tar.gz
511511- ln -s mpc-1.3.1 mpc
506506+ getfile "mpc-1.0.1.tar.gz" "http://www.multiprecision.org/downloads"
507507+ tar xzf $dlwhere/mpc-1.0.1.tar.gz
508508+ ln -s mpc-1.0.1 mpc
512509 fi
513510514511 if (echo $needs_libs | grep -q isl && test ! -d isl); then
515512 echo "ROCKBOXDEV: Getting ISL"
516516- getfile "isl-0.24.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure"
517517- tar xjf $dlwhere/isl-0.24.tar.bz2
518518- ln -s isl-0.24 isl
513513+ getfile "isl-0.15.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure"
514514+ tar xjf $dlwhere/isl-0.15.tar.bz2
515515+ ln -s isl-0.15 isl
519516 fi
520517 cd $builddir
521518 fi
···564561565562 # check libraries:
566563 # contrary to other toolchains that rely on a hack to avoid installing
567567- # gmp, mpc, and mpfr, we simply require that they are installed on
568568- # the system this is not a huge requirement since virtually all systems
569569- # these days provide dev packages for them
564564+ # gmp, mpc and mpfr, we simply require that they are installed on the system
565565+ # this is not a huge requirement since virtually all systems these days
566566+ # provide dev packages for them
570567 # FIXME: maybe add an option to download and install them automatically
571568 checklib "mpc" "gmp" "mpfr"
572569···805802 echo ""
806803 case $arch in
807804 [Ii])
808808- build "binutils" "mipsel-elf" "2.40" "binutils-c23.patch" "--disable-werror" "gmp isl"
809809- build "gcc" "mipsel-elf" "10.5.0" "" "" "gmp mpfr mpc isl"
805805+ build "binutils" "mipsel-elf" "2.26.1" "binutils-c23.patch" "--disable-werror" "gmp isl"
806806+ build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc isl"
810807 ;;
811808812809 [Mm])
813813- build "binutils" "m68k-elf" "2.40" "" "--disable-werror" "gmp isl"
814814- build "gcc" "m68k-elf" "10.5.0" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl"
810810+ build "binutils" "m68k-elf" "2.26.1" "" "--disable-werror" "gmp isl"
811811+ build "gcc" "m68k-elf" "4.9.4" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl"
815812 ;;
816813817814 [Aa])
818815 binopts=""
819819- gccopts="--with-multilib-list=rmprofile"
816816+ gccopts=""
820817 case $system in
821818 Darwin)
822819 binopts="--disable-nls"
823820 gccopts="--disable-nls"
824821 ;;
825822 esac
826826- build "binutils" "arm-elf-eabi" "2.40" "" "$binopts --disable-werror" "gmp isl"
827827- build "gcc" "arm-elf-eabi" "10.5.0" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-9.5.0.diff" "$gccopts MAKEINFO=missing" "gmp mpfr mpc isl"
823823+ build "binutils" "arm-elf-eabi" "2.26.1" "" "$binopts --disable-werror" "gmp isl"
824824+ 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"
828825 ;;
829826 [Xx])
830827 # IMPORTANT NOTE
···833830 #
834831 # Samsung YP-R0/R1:
835832 # ARM1176JZF-S, softfp EABI
836836- # kernel: device runs 2.6.24, but oem toolchain is built against 2.6.27.59
837837- # glibc: device runs 2.4.2
838838- #
833833+ # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that
834834+ # compiles with GCC >6
835835+ # kernel: 2.6.27.59 is the same 2.6.x stable kernel as used by the
836836+ # original ct-ng toolchain, the device runs kernel 2.6.24
837837+ # glibc: 2.19 is the latest version that supports kernel 2.6.24 which
838838+ # is used on the device, but we need to support ABI 2.4 because
839839+ # the device uses glibc 2.4.2
840840+ #
839841 # Sony NWZ:
840840- # kernel: Varies from device to device; 2.6.23, 2.6.35, and 3.x seen.
841841- # glibc: device runs 2.7
842842+ # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that
843843+ # compiles with GCC >6
844844+ # kernel: 2.6.32.71 is the latest 2.6.x stable kernel, the device
845845+ # runs kernel 2.6.23 or 2.6.35 or 3.x for the most recent
846846+ # glibc: 2.19 is the latest version that supports kernel 2.6.23 which
847847+ # is used on many Sony players, but we need to support ABI 2.7
848848+ # because the device uses glibc 2.7
842849 #
843843- # Thus the lowest common denominator is to target 2.6.23 and glibc 2.4
844844- # Use a recent 2.6.32 LTS kernel, but glibc 2.20 targeting 2.6.23 and API 2.4
845845- #
850850+ # Thus the lowest common denominator is to use the latest 2.6.x stable
851851+ # kernel but compile glibc to support kernel 2.6.23 and glibc 2.4.
852852+ # We use a recent 2.26.1 binutils to avoid any build problems and
853853+ # avoid patches/bugs.
846854 glibcopts="--enable-kernel=2.6.23 --enable-oldest-abi=2.4"
847847- build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.40" "" "" "10.5.0" \
848848- "$gccopts" "2.6.32.71" "" "2.20" "$glibcopts" "glibc-220-make44.patch glibc-2.20-gcc10.patch"
855855+ build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.26.1" "" "" "4.9.4" \
856856+ "$gccopts" "2.6.32.71" "" "2.19" "$glibcopts" "glibc-220-make44.patch"
849857 # build alsa-lib
850858 # we need to set the prefix to how it is on device (/usr) and then
851859 # tweak install dir at make install step
···860868 # This toolchain must support several targets and thus must support
861869 # the oldest possible configuration.
862870 #
863863- # AGPTek Rocker (and other HibyOS players):
871871+ # AGPTek Rocker:
872872+ # XBurst release 1 (something inbetween mips32r1 and mips32r2)
873873+ # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that
874874+ # compiles with GCC >6
864875 # kernel: 3.10.14
865876 # glibc: 2.16
866877 # alsa: 1.0.29
867878 #
868868- # FiiO M3K Linux (Based on Ingenic SDK):
879879+ # FiiO M3K Linux:
869880 # kernel: 3.10.14
870881 # glibc: 2.16
871882 # alsa: 1.0.26
872883 #
873873- # Use a recent 3.10 LTS kernel, but glibc 2.27 targeting 3.2.x and API 2.16
874874- #
875875- glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16 --disable-werror"
876876- # FIXME: maybe add -mhard-float?
877877- build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.40" "" "binutils-c23.patch" "10.5.0" \
878878- "$gccopts" "3.10.108" "linux-c23.patch" "2.27" "$glibcopts" "glibc-227-make44.patch"
884884+ # To maximize compatibility, we use kernel 3.2.89 which is the latest
885885+ # longterm 3.2 kernel and is supported by the latest glibc, and we
886886+ # require support for up to glibc 2.16
887887+ # We use a recent 2.26.1 binutils to avoid any build problems and
888888+ # avoid patches/bugs.
889889+ glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16"
890890+ # FIXME: maybe add -mhard-float
891891+ build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.26.1" "" "binutils-c23.patch" "4.9.4" \
892892+ "$gccopts" "3.2.89" "linux-c23.patch" "2.25" "$glibcopts" "glibc-225-make44.patch"
879893 # build alsa-lib
880894 # we need to set the prefix to how it is on device (/usr) and then
881895 # tweak install dir at make install step
···883897 gettool "alsa-lib" "$alsalib_ver"
884898 extract "alsa-lib-$alsalib_ver"
885899 prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \
886886- "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot"
887887-888888- ### Everything below here is needed only for bluetooth support
889889-900900+ "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot"
890901 # build libffi
891902 libffi_ver="3.2.1"
892903 gettool "libffi" "$libffi_ver"
···907918 gettool "glib" "$glib_ver"
908919 extract "glib-$glib_ver"
909920 prefix="/usr" buildtool "glib" "$glib_ver" \
910910- "--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"
921921+ "--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"
911922912923 # build expat
913924 expat_ver="2.1.0"
···922933 extract "dbus-$dbus_ver"
923934 prefix="/usr" buildtool "dbus" "$dbus_ver" \
924935 "--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 "
936936+925937926938 ;;
927939 *)
···11-diff --git a/gcc/system.h b/gcc/system.h
22-index d04f8fd33..636084682 100644
33---- a/gcc/system.h
44-+++ b/gcc/system.h
55-@@ -197,25 +197,6 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
66- /* Include <string> before "safe-ctype.h" to avoid GCC poisoning
77- the ctype macros through safe-ctype.h */
88-99--#ifdef __cplusplus
1010--#ifdef INCLUDE_STRING
1111--# include <string>
1212--#endif
1313--#endif
1414--
1515--/* There are an extraordinary number of issues with <ctype.h>.
1616-- The last straw is that it varies with the locale. Use libiberty's
1717-- replacement instead. */
1818--#include "safe-ctype.h"
1919--
2020--#include <sys/types.h>
2121--
2222--#include <errno.h>
2323--
2424--#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
2525--extern int errno;
2626--#endif
2727--
2828- #ifdef __cplusplus
2929- #if defined (INCLUDE_ALGORITHM) || !defined (HAVE_SWAP_IN_UTILITY)
3030- # include <algorithm>
3131-@@ -229,6 +210,9 @@ extern int errno;
3232- #ifdef INCLUDE_SET
3333- # include <set>
3434- #endif
3535-+#ifdef INCLUDE_STRING
3636-+# include <string>
3737-+#endif
3838- #ifdef INCLUDE_VECTOR
3939- # include <vector>
4040- #endif
4141-@@ -237,6 +221,25 @@ extern int errno;
4242- # include <utility>
4343- #endif
4444-4545-+#ifdef __cplusplus
4646-+#ifdef INCLUDE_STRING
4747-+# include <string>
4848-+#endif
4949-+#endif
5050-+
5151-+/* There are an extraordinary number of issues with <ctype.h>.
5252-+ The last straw is that it varies with the locale. Use libiberty's
5353-+ replacement instead. */
5454-+#include "safe-ctype.h"
5555-+
5656-+#include <sys/types.h>
5757-+
5858-+#include <errno.h>
5959-+
6060-+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
6161-+extern int errno;
6262-+#endif
6363-+
6464- /* Some of glibc's string inlines cause warnings. Plus we'd rather
6565- rely on (and therefore test) GCC's string builtins. */
6666- #define __NO_STRING_INLINES