Files
ficus/toolchain_scripts/binutils-x86_64-elf.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

36 lines
692 B
Bash
Executable File

#!/bin/bash
set -euxo pipefail
if [ -z "$FICUS_ROOT" ]; then
echo "$FICUS_ROOT" is blank
fi
mkdir -p $FICUS_ROOT/toolchain || exit 1
pushd $FICUS_ROOT/toolchain
mkdir -p binutils-x86_64-elf
pushd binutils-x86_64-elf
if [ ! -d "binutils-2.41" ]; then
wget https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz
tar xf binutils-2.41.tar.xz
rm binutils-2.41.tar.xz
fi
mkdir -p build
pushd build
export PREFIX="$FICUS_ROOT/toolchain/gcc-x86_64-elf-prefix/"
export TARGET=x86_64-elf
export PATH="$PREFIX/bin:$PATH"
../binutils-2.41/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
make -j$(nproc)
make install
touch -m ../done