summaryrefslogtreecommitdiff
path: root/host/toolchain
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-12-21 16:48:51 -0500
committerIan Moffett <ian@osmora.org>2025-12-21 16:48:51 -0500
commit10e9348d798d9a683c966480faca00cabc531dd5 (patch)
tree063ae71517af235d500d52f21ccc620004184104 /host/toolchain
initial commit
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'host/toolchain')
-rwxr-xr-xhost/toolchain33
1 files changed, 33 insertions, 0 deletions
diff --git a/host/toolchain b/host/toolchain
new file mode 100755
index 0000000..23756e6
--- /dev/null
+++ b/host/toolchain
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+TARGET=x86_64-pc-osmora
+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 var/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