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
This commit is contained in:
Solomon Peachy 2020-03-27 15:31:30 -04:00
parent e91f89a410
commit b4865b05b0
8 changed files with 92 additions and 722 deletions

View file

@ -391,9 +391,9 @@ build() {
fi
done
# kludge to avoid having to install GMP, MPFR and MPC, for new gcc
# kludge to avoid having to install GMP, MPFR, MPC and ISL
if test -n "$needs_libs"; then
cd "gcc-$version"
cd "$toolname-$version"
if (echo $needs_libs | grep -q gmp && test ! -d gmp); then
echo "ROCKBOXDEV: Getting GMP"
getfile "gmp-4.3.2.tar.bz2" "$GNU_MIRROR/gmp"
@ -403,16 +403,23 @@ build() {
if (echo $needs_libs | grep -q mpfr && test ! -d mpfr); then
echo "ROCKBOXDEV: Getting MPFR"
getfile "mpfr-2.4.2.tar.bz2" "$GNU_MIRROR/mpfr"
tar xjf $dlwhere/mpfr-2.4.2.tar.bz2
ln -s mpfr-2.4.2 mpfr
getfile "mpfr-3.1.0.tar.bz2" "$GNU_MIRROR/mpfr"
tar xjf $dlwhere/mpfr-3.1.0.tar.bz2
ln -s mpfr-3.1.0 mpfr
fi
if (echo $needs_libs | grep -q mpc && test ! -d mpc); then
echo "ROCKBOXDEV: Getting MPC"
getfile "mpc-0.8.1.tar.gz" "http://www.multiprecision.org/downloads"
tar xzf $dlwhere/mpc-0.8.1.tar.gz
ln -s mpc-0.8.1 mpc
getfile "mpc-1.0.1.tar.gz" "http://www.multiprecision.org/downloads"
tar xzf $dlwhere/mpc-1.0.1.tar.gz
ln -s mpc-1.0.1 mpc
fi
if (echo $needs_libs | grep -q isl && test ! -d isl); then
echo "ROCKBOXDEV: Getting ISL"
getfile "isl-0.15.tar.bz2" "https://gcc.gnu.org/pub/gcc/infrastructure"
tar xjf $dlwhere/isl-0.15.tar.bz2
ln -s isl-0.15 isl
fi
cd $builddir
fi
@ -708,11 +715,10 @@ if [ -z "$RBDEV_TARGET" ]; then
echo "m - m68k (iriver h1x0/h3x0, iaudio m3/m5/x5 and mpio hd200)"
echo "a - arm (ipods, iriver H10, Sansa, D2, Gigabeat, etc)"
echo "i - mips (Jz47xx and ATJ-based players)"
# echo "r - arm-app (Samsung ypr0)"
echo "x - arm-linux (Generic Linux ARM: Samsung ypr0, Linux-based Sony NWZ)"
echo "y - mips-linux (Generic Linux MIPS: AGPTek Rocker)"
echo "separate multiple targets with spaces"
echo "(Example: \"s m a\" will build sh, m68k and arm)"
echo "(Example: \"m a i\" will build m68k, arm, and mips)"
echo ""
selarch=`input`
else
@ -729,13 +735,13 @@ do
echo ""
case $arch in
[Ii])
build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror"
build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc"
build "binutils" "mipsel-elf" "2.26.1" "" "--disable-werror" "isl"
build "gcc" "mipsel-elf" "4.9.4" "" "" "gmp mpfr mpc isl"
;;
[Mm])
build "binutils" "m68k-elf" "2.20.1" "binutils-2.20.1-texinfo-fix.diff" "--disable-werror"
build "gcc" "m68k-elf" "4.5.2" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc"
build "binutils" "m68k-elf" "2.26.1" "" "--disable-werror" "isl"
build "gcc" "m68k-elf" "4.9.4" "" "--with-arch=cf MAKEINFO=missing" "gmp mpfr mpc isl"
;;
[Aa])
@ -747,12 +753,9 @@ do
gccopts="--disable-nls"
;;
esac
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"
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"
build "binutils" "arm-elf-eabi" "2.26.1" "" "$binopts --disable-werror" "isl"
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"
;;
# [Rr])
# build_ctng "ypr0" "alsalib.tar.gz" "arm" "linux-gnueabi"
# ;;
[Xx])
# IMPORTANT NOTE
# This toolchain must support several targets and thus must support
@ -804,20 +807,26 @@ do
# compiles with GCC >6
# kernel: 3.10.14
# glibc: 2.16
# alsa: 1.0.29
#
# FiiO M3K:
# kernel: 3.10.14
# glibc: 2.16
# alsa: 1.0.26
#
# To maximize compatibility, we use kernel 3.2.85 which is the lastest
# longterm 3.2 kernel and is supported by the latest glibc, and we
# require support for up to glibc 2.4
# require support for up to glibc 2.16
# We use a recent 2.26.1 binutils to avoid any build problems and
# avoid patches/bugs.
glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.4"
glibcopts="--enable-kernel=3.2 --enable-oldest-abi=2.16"
# FIXME: maybe add -mhard-float
build_linux_toolchain "mipsel-rockbox-linux-gnu" "2.26.1" "" "4.9.4" \
"$gccopts" "3.2.85" "2.25" "$glibcopts"
# build alsa-lib
# we need to set the prefix to how it is on device (/usr) and then
# tweak install dir at make install step
alsalib_ver="1.0.19"
alsalib_ver="1.0.26"
gettool "alsa-lib" "$alsalib_ver"
extract "alsa-lib-$alsalib_ver"
prefix="/usr" buildtool "alsa-lib" "$alsalib_ver" \