From e698061ebaf0cf1a10c11c51a6c6cd46a331959c Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Sat, 13 Sep 2025 14:53:43 -0400 Subject: initial commit Signed-off-by: Ian Moffett --- src/tools/build-toolchain.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/tools/build-toolchain.sh (limited to 'src/tools/build-toolchain.sh') diff --git a/src/tools/build-toolchain.sh b/src/tools/build-toolchain.sh new file mode 100644 index 0000000..ca7fd58 --- /dev/null +++ b/src/tools/build-toolchain.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +TARGET=x86_64-pc-ethos +MAKE=make + +# Don't build again if the lock exists +if [[ -f cc/.lock ]] +then + echo "cc/.lock exists, skipping toolchain build" + exit 1 +fi + +# Build binutils and patch gcc +cd cc/toolchain/ +bash build.sh + +# Prep the build directory +cd ../ +mkdir -p gcc +cd gcc/ + +# Configure gcc +../toolchain/gcc-patched/configure --target=$TARGET \ + --prefix=$(pwd) --with-sysroot=$(pwd)/../../root/ \ + --disable-nls --enable-languages=c --disable-multilib + +# Build gcc +$MAKE all-gcc +$MAKE install-gcc + +# Lock the directory +cd ../ +touch .lock -- cgit v1.2.3