Files
ficus/ficus-toolchain/build-s1.sh
Stepan Usatiuk df13f41be2 CI: build in ci, more streamlined toolchain
Reviewed-on: #2
Co-authored-by: Stepan Usatiuk <stepan@usatiuk.com>
Co-committed-by: Stepan Usatiuk <stepan@usatiuk.com>
2024-04-28 08:36:50 +02:00

49 lines
1021 B
Bash
Executable File

#!/bin/bash
set -euxo pipefail
if [ -z "$FICUS_ROOT" ]; then
echo "$FICUS_ROOT" is blank
exit 1
fi
if [ -z "$PREFIX" ]; then
echo "PREFIX" is blank
exit 1
fi
if [ -z "$SCRIPT_DIR" ]; then
echo "SCRIPT_DIR" is blank
exit 1
fi
cd "$SCRIPT_DIR"
mkdir -p "$FICUS_ROOT/sysroot"
cd binutils-x86_64-ficus
mkdir -p build
cd build
../binutils-2.41/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$PREFIX/../../sysroot" --disable-nls --disable-werror
make -j$(nproc)
make install
cd ../../
cd gcc-x86_64-ficus
rm -rf build
mkdir -p build
cd build
pushd ../gcc-13.2.0/
./contrib/download_prerequisites
popd
../gcc-13.2.0/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot="$PREFIX/../../sysroot" --disable-nls --enable-languages=c,c++ --with-newlib --without-headers --disable-fixincludes --enable-version-specific-runtime-libs
make -j$(nproc) all-gcc
make -j$(nproc) all-target-libgcc
make install-gcc
make install-target-libgcc
find "$PREFIX" -exec strip {} \;
cd ../../