···484484 cd "$toolname-$version"
485485 if (echo $needs_libs | grep -q gmp && test ! -d gmp); then
486486 echo "ROCKBOXDEV: Getting GMP"
487487- getfile "gmp-6.2.1.tar.bz2" "$GNU_MIRROR/gmp"
488488- tar xjf $dlwhere/gmp-6.2.1.tar.bz2
489489- ln -s gmp-6.2.1 gmp
487487+ getfile "gmp-6.1.2.tar.xz" "$GNU_MIRROR/gmp"
488488+ tar xJf $dlwhere/gmp-6.1.2.tar.xz
489489+ ln -s gmp-6.1.2 gmp
490490 fi
491491492492 if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then
493493 echo "ROCKBOXDEV: Getting MPFR"
494494- getfile "mpfr-4.1.1.tar.xz" "$GNU_MIRROR/mpfr"
495495- tar xJf $dlwhere/mpfr-4.1.1.tar.xz
496496- ln -s mpfr-4.1.1 mpfr
494494+ getfile "mpfr-3.1.6.tar.xz" "$GNU_MIRROR/mpfr"
495495+ tar xJf $dlwhere/mpfr-3.1.6.tar.xz
496496+ ln -s mpfr-3.1.6 mpfr
497497 fi
498498499499 if (echo $needs_libs | grep -q mpc && test ! -d mpc); then
500500 echo "ROCKBOXDEV: Getting MPC"
501501- getfile "mpc-1.2.1.tar.gz" "http://www.multiprecision.org/downloads"
502502- tar xzf $dlwhere/mpc-1.2.1.tar.gz
503503- ln -s mpc-1.2.1 mpc
501501+ getfile "mpc-1.0.1.tar.gz" "http://www.multiprecision.org/downloads"
502502+ tar xzf $dlwhere/mpc-1.0.1.tar.gz
503503+ ln -s mpc-1.0.1 mpc
504504 fi
505505506506 if (echo $needs_libs | grep -q isl && test ! -d isl); then
507507 echo "ROCKBOXDEV: Getting ISL"
508508- getfile "isl-0.18.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure"
509509- tar xjf $dlwhere/isl-0.18.tar.bz2
510510- ln -s isl-0.18 isl
508508+ getfile "isl-0.15.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure"
509509+ tar xjf $dlwhere/isl-0.15.tar.bz2
510510+ ln -s isl-0.15 isl
511511 fi
512512 cd $builddir
513513 fi
···562562563563 # check libraries:
564564 # contrary to other toolchains that rely on a hack to avoid installing
565565- # gmp, mpc, and mpfr, we simply require that they are installed on
566566- # the system this is not a huge requirement since virtually all systems
567567- # these days provide dev packages for them
565565+ # gmp, mpc and mpfr, we simply require that they are installed on the system
566566+ # this is not a huge requirement since virtually all systems these days
567567+ # provide dev packages for them
568568 # FIXME: maybe add an option to download and install them automatically
569569 checklib "mpc" "gmp" "mpfr"
570570···596596 extract "linux-$linux_ver"
597597 extract "glibc-$glibc_ver"
598598599599+ # do we have a patch?
600600+ for p in $glibc_patches; do
601601+ echo "ROCKBOXDEV: applying patch $p"
602602+ (cd $builddir/glibc-$glibc_ver ; patch -p1 < "$patch_dir/$p")
603603+604604+ # check if the patch applied cleanly
605605+ if [ $? -gt 0 ]; then
606606+ echo "ROCKBOXDEV: failed to apply patch $p"
607607+ exit
608608+ fi
609609+ done
610610+599611 # we make it possible to restart a build on error by using the RBDEV_RESTART
600612 # variable, the format is RBDEV_RESTART="tool" where tool is the toolname at which
601613 # to restart (binutils, gcc)
···626638 # build glibc using the first stage cross compiler
627639 # we need to set the prefix to /usr because the glibc runs on the actual
628640 # target and is indeed installed in /usr
629629-630630- for p in $glibc_patches; do
631631- echo "ROCKBOXDEV: applying patch $p"
632632- (cd $builddir/glibc-$glibc_ver ; patch -p1 < "$patch_dir/$p")
633633-634634- # check if the patch applied cleanly
635635- if [ $? -gt 0 ]; then
636636- echo "ROCKBOXDEV: failed to apply patch $p"
637637- exit
638638- fi
639639- done
640640-641641 RESTART_STEP="glibc" \
642642 prefix="/usr" \
643643 buildtool "glibc" "$glibc_ver" "--target=$target --host=$target --build=$MACHTYPE \
···784784 echo ""
785785 case $arch in
786786 [Ii])
787787- build "binutils" "mipsel-elf" "2.38" "" "--disable-werror" "gmp isl"
788788- build "gcc" "mipsel-elf" "9.5.0" "" "" "gmp mpfr mpc isl"
787787+ build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror" "gmp isl"
788788+ build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc isl"
789789 ;;
790790791791 [Mm])
792792- build "binutils" "m68k-elf" "2.38" "" "--disable-werror" "gmp isl"
793793- build "gcc" "m68k-elf" "9.5.0" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl"
792792+ build "binutils" "m68k-elf" "2.26.1" "" "--disable-werror" "gmp isl"
793793+ build "gcc" "m68k-elf" "4.9.4" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl"
794794 ;;
795795796796 [Aa])
797797 binopts=""
798798- gccopts="--with-multilib-list=rmprofile"
798798+ gccopts=""
799799 case $system in
800800 Darwin)
801801 binopts="--disable-nls"
802802 gccopts="--disable-nls"
803803 ;;
804804 esac
805805- build "binutils" "arm-elf-eabi" "2.38" "" "$binopts --disable-werror" "gmp isl"
806806- build "gcc" "arm-elf-eabi" "9.5.0" "rockbox-multilibs-noexceptions-arm-elf-eabi-gcc-9.5.0.diff" "$gccopts MAKEINFO=missing" "gmp mpfr mpc isl"
805805+ build "binutils" "arm-elf-eabi" "2.26.1" "" "$binopts --disable-werror" "gmp isl"
806806+ 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"
807807 ;;
808808 [Xx])
809809 # IMPORTANT NOTE
···812812 #
813813 # Samsung YP-R0/R1:
814814 # ARM1176JZF-S, softfp EABI
815815- # kernel: device runs 2.6.24, but oem toolchain is built against 2.6.27.59
816816- # glibc: device runs 2.4.2
817817- #
815815+ # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that
816816+ # compiles with GCC >6
817817+ # kernel: 2.6.27.59 is the same 2.6.x stable kernel as used by the
818818+ # original ct-ng toolchain, the device runs kernel 2.6.24
819819+ # glibc: 2.19 is the latest version that supports kernel 2.6.24 which
820820+ # is used on the device, but we need to support ABI 2.4 because
821821+ # the device uses glibc 2.4.2
822822+ #
818823 # Sony NWZ:
819819- # kernel: Varies from device to device; 2.6.23, 2.6.35, and 3.x seen.
820820- # glibc: device runs 2.7
824824+ # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that
825825+ # compiles with GCC >6
826826+ # kernel: 2.6.32.68 is the latest 2.6.x stable kernel, the device
827827+ # runs kernel 2.6.23 or 2.6.35 or 3.x for the most recent
828828+ # glibc: 2.19 is the latest version that supports kernel 2.6.23 which
829829+ # is used on many Sony players, but we need to support ABI 2.7
830830+ # because the device uses glibc 2.7
821831 #
822822- # Thus the lowest common denominator is to target 2.6.23 and glibc 2.4
823823- # Use a recent 2.6.32 LTS kernel, but glibc 2.20 targeting 2.6.23 and API 2.4
824824- #
832832+ # Thus the lowest common denominator is to use the latest 2.6.x stable
833833+ # kernel but compile glibc to support kernel 2.6.23 and glibc 2.4.
834834+ # We use a recent 2.26.1 binutils to avoid any build problems and
835835+ # avoid patches/bugs.
825836 glibcopts="--enable-kernel=2.6.23 --enable-oldest-abi=2.4"
826826- build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.38" "" "9.5.0" \
827827- "$gccopts" "2.6.32.71" "2.20" "$glibcopts" "glibc-220-make44.patch"
837837+ build_linux_toolchain "arm-rockbox-linux-gnueabi" "2.26.1" "" "4.9.4" \
838838+ "$gccopts" "2.6.32.68" "2.19" "$glibcopts" "glibc-220-make44.patch"
828839 # build alsa-lib
829840 # we need to set the prefix to how it is on device (/usr) and then
830841 # tweak install dir at make install step
···839850 # This toolchain must support several targets and thus must support
840851 # the oldest possible configuration.
841852 #
842842- # AGPTek Rocker (and other HibyOS players):
853853+ # AGPTek Rocker:
854854+ # XBurst release 1 (something inbetween mips32r1 and mips32r2)
855855+ # gcc: 4.9.4 is the latest 4.9.x stable branch, also the only one that
856856+ # compiles with GCC >6
843857 # kernel: 3.10.14
844858 # glibc: 2.16
845859 # alsa: 1.0.29
846860 #
847847- # FiiO M3K Linux (Based on Ingenic SDK):
861861+ # FiiO M3K Linux:
848862 # kernel: 3.10.14
849863 # glibc: 2.16
850864 # alsa: 1.0.26
851865 #
852852- # Use a recent 3.10 LTS kernel, but glibc 2.27 targeting 3.2.x and API 2.16
853853- #
854854- glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16 --disable-werror"
855855- # FIXME: maybe add -mhard-float?
856856- build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.38" "" "9.5.0" \
857857- "$gccopts" "3.10.108" "2.27" "$glibcopts" "glibc-227-make44.patch"
866866+ # To maximize compatibility, we use kernel 3.2.85 which is the lastest
867867+ # longterm 3.2 kernel and is supported by the latest glibc, and we
868868+ # require support for up to glibc 2.16
869869+ # We use a recent 2.26.1 binutils to avoid any build problems and
870870+ # avoid patches/bugs.
871871+ glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16"
872872+ # FIXME: maybe add -mhard-float
873873+ build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.26.1" "" "4.9.4" \
874874+ "$gccopts" "3.2.85" "2.25" "$glibcopts" "glibc-225-make44.patch"
858875 # build alsa-lib
859876 # we need to set the prefix to how it is on device (/usr) and then
860877 # tweak install dir at make install step
···862879 gettool "alsa-lib" "$alsalib_ver"
863880 extract "alsa-lib-$alsalib_ver"
864881 prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \
865865- "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot"
866866-867867- ### Everything below here is needed only for bluetooth support
868868-882882+ "--host=$target --disable-python" "" "install DESTDIR=$prefix/$target/sysroot"
869883 # build libffi
870884 libffi_ver="3.2.1"
871885 gettool "libffi" "$libffi_ver"
···886900 gettool "glib" "$glib_ver"
887901 extract "glib-$glib_ver"
888902 prefix="/usr" buildtool "glib" "$glib_ver" \
889889- "--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"
903903+ "--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"
890904891905 # build expat
892906 expat_ver="2.1.0"
···901915 extract "dbus-$dbus_ver"
902916 prefix="/usr" buildtool "dbus" "$dbus_ver" \
903917 "--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 "
918918+904919905920 ;;
906921 *)