This commit is contained in:
ag-tsotetsi
2026-03-22 21:30:15 +02:00
parent 1b605aaef1
commit 409517b49f
10 changed files with 733 additions and 179 deletions

View File

@@ -0,0 +1,22 @@
fetch $BINUTILS_URL
cd "$SOURCES" && tar xf binutils-$BINUTILS_VERSION.tar.xz && cd binutils-$BINUTILS_VERSION
mkdir -p build && cd build
../configure \
--prefix="$CROSS" \
--with-sysroot="$SYSROOT" \
--target=$TARGET \
--disable-nls \
--enable-gprofng=no \
--disable-werror \
--enable-new-dtags \
--enable-default-hash-style=gnu \
--silent \
--quiet
make && make install
cd "$SOURCES" && rm -rf binutils-$BINUTILS_VERSION

46
stage/bootstrap/gcc.bash Normal file
View File

@@ -0,0 +1,46 @@
fetch $GCC_URL
fetch $GMP_URL
fetch $ISL_URL
fetch $MPC_URL
fetch $MPFR_URL
cd "$SOURCES" && tar xf gcc-$GCC_VERSION.tar.xz && cd gcc-$GCC_VERSION
tar xf ../gmp-$GMP_VERSION.tar.xz && mv gmp-$GMP_VERSION gmp
tar xf ../isl-$ISL_VERSION.tar.xz && mv isl-$ISL_VERSION isl
tar xf ../mpc-$MPC_VERSION.tar.gz && mv mpc-$MPC_VERSION mpc
tar xf ../mpfr-$MPFR_VERSION.tar.xz && mv mpfr-$MPFR_VERSION mpfr
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
mkdir -p build && cd build
../configure \
--target=$TARGET \
--prefix="$CROSS" \
--with-glibc-version=$GLIBC_VERSION \
--with-sysroot="$SYSROOT" \
--with-newlib \
--without-headers \
--enable-default-pie \
--enable-default-ssp \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++ \
--silent \
--quiet
make && make install
cd .. && cat gcc/limitx.h gcc/glimits.h gcc/limity.h > "`dirname $($TARGET-gcc -print-libgcc-file-name)`/include/limits.h"
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION

View File

@@ -0,0 +1,31 @@
fetch $GLIBC_URL
fetch $GLIBC_PATCH_URL
cd "$SOURCES" && tar xf glibc-$GLIBC_VERSION.tar.xz && cd glibc-$GLIBC_VERSION
ln -fs ld-linux-x86-64.so.2 "$SYSROOT"/lib/ld-lsb-x86-64.so.3
patch -sNp1 -i "$SOURCES"/glibc-fhs-1.patch
mkdir -p build && cd build
echo "rootsbindir=/usr/sbin" > configparms
../configure \
--prefix=/usr \
--host=$TARGET \
--build=$(../scripts/config.guess) \
--disable-nscd \
--disable-nls \
libc_cv_slibdir=/usr/lib \
--enable-kernel=$LINUX_VERSION \
--silent \
--quiet
make && make DESTDIR="$SYSROOT" install
sed '/RTLDLIST=/s@/usr@@g' -i "$SYSROOT"/usr/bin/ldd
cd "$SOURCES" && rm -rf glibc-$GLIBC_VERSION

View File

@@ -0,0 +1,22 @@
cd "$SOURCES" && tar xf gcc-$GCC_VERSION.tar.xz && cd gcc-$GCC_VERSION
mkdir -p build && cd build
../libstdc++-v3/configure \
--host=$TARGET \
--build=$(../config.guess) \
--prefix=/usr \
--disable-multilib \
--disable-nls \
--disable-libstdcxx-pch \
--with-gxx-include-dir=/cross/$TARGET/include/c++/$GCC_VERSION \
--silent \
--quiet
make && make DESTDIR="$SYSROOT" install
rm -rf "$SYSROOT"/usr/lib/lib{stdc++{,exp,fs},supc++}.la
cd "$SOURCES" && rm -rf gcc-$GCC_VERSION

View File

@@ -0,0 +1,12 @@
fetch $LINUX_URL
cd "$SOURCES" && tar xf linux-$LINUX_VERSION.tar.xz && cd linux-$LINUX_VERSION
make mrproper && make headers
find usr/include -type f ! -name '*.h' -delete
cp -r usr/include "$SYSROOT"/usr
cd "$SOURCES" && rm -rf linux-$LINUX_VERSION

17
stage/toolchain/m4.bash Normal file
View File

@@ -0,0 +1,17 @@
fetch $M4_URL
cd "$SOURCES" && tar xf m4-$M4_VERSION.tar.xz && cd m4-$M4_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) \
--silent \
--quiet
make && make DESTDIR="$SYSROOT" install
cd "$SOURCES" && rm -rf m4-$M4_VERSION