From 74f8b302d03c028fcad34dedce747c96476f52ba Mon Sep 17 00:00:00 2001 From: ag-tsotetsi Date: Fri, 20 Feb 2026 12:26:18 +0200 Subject: [PATCH] added coreutils toolchain build --- build.sh | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index f582f67..dd98f73 100755 --- a/build.sh +++ b/build.sh @@ -56,6 +56,9 @@ NCURSES_URL=https://mirror.ufs.ac.za/gnu/ncurses/ncurses-$NCURSES_VERSION.tar.gz BASH_VERSION=5.3 BASH_URL=https://mirror.ufs.ac.za/gnu/bash/bash-$BASH_VERSION.tar.gz +COREUTILS_VERSION=9.9 +COREUTILS_URL=https://mirror.ufs.ac.za/gnu/coreutils/coreutils-$COREUTILS_VERSION.tar.xz + if [ ! -d "$SYSROOT" ]; then mkdir -p "$SYSROOT"/{etc,cross,sources,usr,dev,proc,sys,run} mkdir -p "$SYSROOT"/usr/{bin,sbin,lib,include} @@ -277,6 +280,27 @@ toolchain_bash() { cd "$SOURCES" && rm -rf bash-$BASH_VERSION } +toolchain_coreutils() { + fetch $COREUTILS_URL + + cd "$SOURCES" && tar xf coreutils-$COREUTILS_VERSION.tar.xz && cd coreutils-$COREUTILS_VERSION + + sed -r '/_GL_EXTERN_C/s/w?memchr|bsearch/(&)/' -i $(find -name \*.in.h) + + ./configure \ + --prefix=/usr \ + --host=$TARGET \ + --build=$(build-aux/config.guess) \ + --enable-install-program=hostname \ + --enable-no-install-program=kill,uptime + + make && make DESTDIR="$SYSROOT" install + + mv "$SYSROOT"/usr/bin/chroot "$SYSROOT"/usr/sbin + + cd "$SOURCES" && rm -rf coreutils-$COREUTILS_VERSION +} + #bootstrap_binutils #bootstap_gcc #bootstap_linux @@ -284,4 +308,5 @@ toolchain_bash() { #bootstap_libstdcpp #toolchain_m4 #toolchain_ncurses -toolchain_bash \ No newline at end of file +#toolchain_bash +toolchain_coreutils \ No newline at end of file