Krosswerkzeugkette kompilieren

binutils

cd $BAU pwd if [ -d binutils-2.46.0 ] then rm --force --recursive binutils-2.46.0 fi tar --extract -f binutils-2.46.0.tar.xz cd binutils-2.46.0 pwd mkdir -v build cd build ../configure --prefix=$LFS/tools \ --with-sysroot=$LFS \ --target=$LFS_TGT \ --disable-nls \ --enable-gprofng=no \ --disable-werror \ --enable-new-dtags \ --enable-default-hash-style=gnu make make install cd .. cd .. pwd

gcc

cd $BAU pwd if [ -d gcc-15.2.0 ] then rm --force --recursive gcc-15.2.0 fi tar --extract -f gcc-15.2.0.tar.xz cd gcc-15.2.0 pwd tar -xf ../mpfr-4.2.2.tar.xz mv -v mpfr-4.2.2 mpfr tar -xf ../gmp-6.3.0.tar.xz mv -v gmp-6.3.0 gmp tar -xf ../mpc-1.3.1.tar.gz mv -v mpc-1.3.1 mpc case $(uname -m) in x86_64) sed -e '/m64=/s/lib64/lib/' \ -i.orig gcc/config/i386/t-linux64 ;; esac mkdir -v build cd build ../configure \ --target=$LFS_TGT \ --prefix=$LFS/tools \ --with-glibc-version=2.43 \ --with-sysroot=$LFS \ --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++ make make install cd .. cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include/limits.h cd .. pwd

linux

cd $BAU pwd if [ -d linux-6.18.10 ] then rm --force --recursive linux-6.18.10 fi tar --extract -f linux-6.18.10.tar.xz cd linux-6.18.10 pwd make mrproper make headers find usr/include -type f ! -name '*.h' -delete cp -rv usr/include $LFS/usr cd .. pwd

glibc

cd $BAU pwd if [ -d glibc-2.43 ] then rm --force --recursive glibc-2.43 fi tar --extract -f glibc-2.43.tar.xz cd glibc-2.43 pwd case $(uname -m) in i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3 ;; x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64 ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3 ;; esac patch -Np1 -i ../glibc-fhs-1.patch mkdir -v build cd build echo "rootsbindir=/usr/sbin" > configparms ../configure \ --prefix=/usr \ --host=$LFS_TGT \ --build=$(../scripts/config.guess) \ --disable-nscd \ libc_cv_slibdir=/usr/lib \ --enable-kernel=5.4 make make DESTDIR=$LFS install sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd cd .. cd .. pwd

gcc

cd $BAU pwd if [ -d gcc-15.2.0 ] then rm --force --recursive gcc-15.2.0 fi tar --extract -f gcc-15.2.0.tar.xz cd gcc-15.2.0 pwd mkdir -v build cd build ../libstdc++-v3/configure \ --host=$LFS_TGT \ --build=$(../config.guess) \ --prefix=/usr \ --disable-multilib \ --disable-nls \ --disable-libstdcxx-pch \ --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/15.2.0 make make DESTDIR=$LFS install rm -v $LFS/usr/lib/lib{stdc++{,exp,fs},supc++}.la cd .. cd .. pwd