Setting up the SDK
About the SDK
Section titled “About the SDK”You can find the source at the following page :
Building the Compiler
Section titled “Building the Compiler”Setup env vars
export PREFIX="$HOME/opt/cross"export TARGET=sh4eb-elfexport PATH="$PREFIX/bin:$PATH"
Install and build BinUtils
Install-binutils.sh
version=2.37
prefix=$PREFIX/sh4eb-nofpu-elf
jobs=`nproc 2> /dev/null || echo 1`
tar=binutils-${version}.tar.gzurl=ftp://ftp.gnu.org/gnu/binutils/$tartest -f $tar || curl -L $url -o $tartar -zxf $tar
mkdir binutils-${version}-buildcd binutils-${version}-build../binutils-${version}/configure --target=sh4eb-nofpu-elf --prefix=$prefix \ --disable-nls --disable-shared --disable-multilibmake -j $jobsmake installcd ..
And GCC
Install-gcc.sh
version=11.2.0
prefix=$PREFIX/sh4eb-nofpu-elf
jobs=`nproc 2> /dev/null || echo 1`
tar=gcc-${version}.tar.gzurl=ftp://ftp.gnu.org/gnu/gcc/gcc-${version}/$tartest -f $tar || curl -L $url -o $tartar -zxf $tar
cd gcc-${version}./contrib/download_prerequisitescd ..
mkdir gcc-${version}-buildcd gcc-${version}-build../gcc-${version}/configure --target=sh4eb-nofpu-elf --prefix=$prefix \ --enable-languages=c,c++ \ --with-newlib --without-headers --disable-hosted-libstdcxx \ --disable-nls --disable-shared --enable-libssp --enable-lto --with-multilib-list=m4-nofpumake -j $jobs all-gcc all-target-libgccmake install-gcc install-target-libgcccd ..
Now NewLib
Install-newlib.sh
version=1.14.0
prefix=$PREFIX/../src/hollyhock-2/sdk/newlib
jobs=`nproc 2> /dev/null || echo 1`
wget ftp://sourceware.org/pub/newlib/newlib-${version}.tar.gz
tar xzfv newlib-${version}.tar.gz
mkdir newlib-${version}-buildcd newlib-${version}-build
export TARGET_BINS="sh4eb-nofpu-elf"
../newlib-${version}/configure --target="sh-elf" --prefix=$PREFIX
# Fix CCgrep -rli 'sh-elf-' * | xargs -i@ sed -i 's/sh-elf-/sh4eb-nofpu-elf-/g' @grep -rli 'sh4eb-nofpu-elf-cc' * | xargs -i@ sed -i 's/sh4eb-nofpu-elf-cc/sh4eb-nofpu-elf-gcc/g' @
make -j $jobsmake installcd ..
Rebuild Full GCC
Full-gcc.sh
version=11.2.0prefix=$PREFIX/sh4eb-nofpu-elf-full
mkdir gcc-${version}-build-fullcd gcc-${version}-build-full
../gcc-${version}/configure --target=sh4eb-nofpu-elf --prefix=$prefix \ --enable-languages=c,c++ \ --with-newlib --without-headers --disable-hosted-libstdcxx \ --disable-nls --disable-shared --enable-libssp --enable-lto --with-multilib-list=m4-nofpu