cd $LFS/sources tar xvf linux-4.20.12.tar.xz cd linux-4.20.12 make mrproper make INSTALL_HDR_PATH=dest headers_install cp -rv dest/include/* /tools/include/
cd $LFS/sources/ tar xvf gcc-8.2.0.tar.xz cd gcc-8.2.0 mkdir -v build cd build/ ../libstdc++-v3/configure --host=$LFS_TGT --prefix=/tools --disable-multilib --disable-nls --disable-libstdcxx-threads --disable-libstdcxx-pch --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/8.2.0 make make install
cd $LFS/sources/ cd binutils-2.32 mkdir -v build cd build/ CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib ../configure --prefix=/tools --disable-nls --disable-werror --with-lib-path=/tools/lib --with-sysroot make make install
#这个准备用在下一章 make -C ld clean make -C ld LIB_PATH=/usr/lib:/lib cp -v ld/ld-new /tools/bin
cd $LFS/sources/ tar xvf gcc-8.2.0.tar.xz cd gcc-8.2.0 cat gcc/limitx.h gcc/glimits.h gcc/limity.h > `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/include-fixed/limits.h
#脚本 for file in gcc/config/{linux,i386/linux{,64}}.h do cp -uv $file{,.orig} sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \ -e 's@/usr@/tools@g' $file.orig > $file echo ' #undef STANDARD_STARTFILE_PREFIX_1 #undef STANDARD_STARTFILE_PREFIX_2 #define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/" #define STANDARD_STARTFILE_PREFIX_2 ""' >> $file touch $file.orig done
case $(uname -m) in x86_64) sed -e '/m64=/s/lib64/lib/' \ -i.orig gcc/config/i386/t-linux64 ;; esac
tar -xvf ../mpfr-4.0.2.tar.xz mv -v mpfr-4.0.2 mpfr tar -xvf ../gmp-6.1.2.tar.xz mv -v gmp-6.1.2 gmp tar -xvf ../mpc-1.1.0.tar.gz mv -v mpc-1.1.0 mpc
mkdir -v build cd build/
CC=$LFS_TGT-gcc CXX=$LFS_TGT-g++ AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib ../configure --prefix=/tools --with-local-prefix=/tools --with-native-system-header-dir=/tools/include --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp make make install ln -sv gcc /tools/bin/cc
cd $LFS/sources/ tar -zxvf bash-5.0.tar.gz cd bash-5.0 ./configure --prefix=/tools --without-bash-malloc make make tests make install ln -sv bash /tools/bin/sh
cd $LFS/sources tar xvf coreutils-8.30.tar.xz cd coreutils-8.30 ./configure --prefix=/tools --enable-install-program=hostname make make RUN_EXPENSIVE_TESTS=yes check make install
tar -jxvf make-4.2.1.tar.bz2 cd make-4.2.1 sed -i '211,217 d; 219,229 d; 232 d' glob/glob.c ./configure --prefix=/tools --without-guile make make check make install