Updating to LFS 11.2

This commit is contained in:
Luís Mendes 2022-09-07 12:55:14 -03:00
parent b5c078a5c9
commit 893567d6e5
7 changed files with 364 additions and 385 deletions

View file

@ -1,8 +1,8 @@
#!/bin/bash
# LFS 11.0 Build Script
# LFS 11.2 Build Script
# Builds the cross-toolchain and cross compiling temporary tools from chapters 5 and 6
# by Luís Mendes :)
# 08/Sep/2021
# 06/Sep/2022
package_name=""
package_ext=""
@ -11,14 +11,14 @@ begin() {
package_name=$1
package_ext=$2
echo "[lfs-scripts] Starting build of $package_name at $(date)"
echo "[lfs-cross] Starting build of $package_name at $(date)"
tar xf $package_name.$package_ext
cd $package_name
}
finish() {
echo "[lfs-scripts] Finishing build of $package_name at $(date)"
echo "[lfs-cross] Finishing build of $package_name at $(date)"
cd $LFS/sources
rm -rf $package_name
@ -26,21 +26,22 @@ finish() {
cd $LFS/sources
# 5.2. Binutils-2.37 - Pass 1
begin binutils-2.37 tar.xz
# 5.2. Binutils-2.39 - Pass 1
begin binutils-2.39 tar.xz
mkdir -v build
cd build
../configure --prefix=$LFS/tools \
--with-sysroot=$LFS \
--target=$LFS_TGT \
--disable-nls \
--enable-gprofng=no \
--disable-werror
make
make install -j1
make install
finish
# 5.3. GCC-11.2.0 - Pass 1
begin gcc-11.2.0 tar.xz
# 5.3. GCC-12.2.0 - Pass 1
begin gcc-12.2.0 tar.xz
tar -xf ../mpfr-4.1.0.tar.xz
mv -v mpfr-4.1.0 mpfr
tar -xf ../gmp-6.2.1.tar.xz
@ -55,25 +56,24 @@ case $(uname -m) in
esac
mkdir -v build
cd build
../configure \
--target=$LFS_TGT \
--prefix=$LFS/tools \
--with-glibc-version=2.11 \
--with-sysroot=$LFS \
--with-newlib \
--without-headers \
--enable-initfini-array \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-decimal-float \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
../configure \
--target=$LFS_TGT \
--prefix=$LFS/tools \
--with-glibc-version=2.36 \
--with-sysroot=$LFS \
--with-newlib \
--without-headers \
--disable-nls \
--disable-shared \
--disable-multilib \
--disable-decimal-float \
--disable-threads \
--disable-libatomic \
--disable-libgomp \
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++
make
make install
@ -82,17 +82,16 @@ cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \
`dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h
finish
# 5.4. Linux-5.13.12 API Headers
begin linux-5.13.12 tar.xz
# 5.4. Linux-5.19.2 API Headers
begin linux-5.19.2 tar.xz
make mrproper
make headers
find usr/include -name '.*' -delete
rm usr/include/Makefile
find usr/include -type f ! -name '*.h' -delete
cp -rv usr/include $LFS/usr
finish
# 5.5. Glibc-2.34
begin glibc-2.34 tar.xz
# 5.5. Glibc-2.36
begin glibc-2.36 tar.xz
case $(uname -m) in
i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3
;;
@ -100,7 +99,7 @@ case $(uname -m) in
ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3
;;
esac
patch -Np1 -i ../glibc-2.34-fhs-1.patch
patch -Np1 -i ../glibc-2.36-fhs-1.patch
mkdir -v build
cd build
echo "rootsbindir=/usr/sbin" > configparms
@ -114,15 +113,14 @@ echo "rootsbindir=/usr/sbin" > configparms
make
make DESTDIR=$LFS install
sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd
echo 'int main(){}' > dummy.c
$LFS_TGT-gcc dummy.c
readelf -l a.out | grep '/ld-linux'
rm -v dummy.c a.out
$LFS/tools/libexec/gcc/$LFS_TGT/11.2.0/install-tools/mkheaders
echo 'int main(){}' | gcc -xc -
readelf -l a.out | grep ld-linux
rm -v a.out
$LFS/tools/libexec/gcc/$LFS_TGT/12.2.0/install-tools/mkheaders
finish
# 5.6. Libstdc++ from GCC-11.2.0, Pass 1
begin gcc-11.2.0 tar.xz
# 5.6. Libstdc++ from GCC-12.2.0
begin gcc-12.2.0 tar.xz
mkdir -v build
cd build
../libstdc++-v3/configure \
@ -132,9 +130,10 @@ cd build
--disable-multilib \
--disable-nls \
--disable-libstdcxx-pch \
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/11.2.0
--with-gxx-include-dir=/tools/$LFS_TGT/include/c++/12.2.0
make
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/lib{stdc++,stdc++fs,supc++}.la
finish
# 6.2. M4-1.4.19
@ -146,8 +145,8 @@ make
make DESTDIR=$LFS install
finish
# 6.3. Ncurses-6.2
begin ncurses-6.2 tar.gz
# 6.3. Ncurses-6.3
begin ncurses-6.3 tar.gz
sed -i s/mawk// configure
mkdir build
pushd build
@ -161,17 +160,19 @@ popd
--mandir=/usr/share/man \
--with-manpage-format=normal \
--with-shared \
--without-normal \
--with-cxx-shared \
--without-debug \
--without-ada \
--without-normal \
--disable-stripping \
--enable-widec
make
make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so
finish
# 6.4. Bash-5.1.8
begin bash-5.1.8 tar.gz
# 6.4. Bash-5.1.16
begin bash-5.1.16 tar.gz
./configure --prefix=/usr \
--build=$(support/config.guess) \
--host=$LFS_TGT \
@ -181,8 +182,8 @@ make DESTDIR=$LFS install
ln -sv bash $LFS/bin/sh
finish
# 6.5. Coreutils-8.32
begin coreutils-8.32 tar.xz
# 6.5. Coreutils-9.1
begin coreutils-9.1 tar.xz
./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess) \
@ -190,10 +191,10 @@ begin coreutils-8.32 tar.xz
--enable-no-install-program=kill,uptime
make
make DESTDIR=$LFS install
mv -v $LFS/usr/bin/chroot $LFS/usr/sbin
mv -v $LFS/usr/bin/chroot $LFS/usr/sbin
mkdir -pv $LFS/usr/share/man/man8
mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8
mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8
sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8
finish
# 6.6. Diffutils-3.8
@ -203,8 +204,8 @@ make
make DESTDIR=$LFS install
finish
# 6.7. File-5.40
begin file-5.40 tar.gz
# 6.7. File-5.42
begin file-5.42 tar.gz
mkdir build
pushd build
../configure --disable-bzlib \
@ -216,10 +217,11 @@ popd
./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess)
make FILE_COMPILE=$(pwd)/build/src/file
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/libmagic.la
finish
# 6.8. Findutils-4.8.0
begin findutils-4.8.0 tar.xz
# 6.8. Findutils-4.9.0
begin findutils-4.9.0 tar.xz
./configure --prefix=/usr \
--localstatedir=/var/lib/locate \
--host=$LFS_TGT \
@ -228,12 +230,12 @@ make
make DESTDIR=$LFS install
finish
# 6.9. Gawk-5.1.0
begin gawk-5.1.0 tar.xz
# 6.9. Gawk-5.1.1
begin gawk-5.1.1 tar.xz
sed -i 's/extras//' Makefile.in
./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(./config.guess)
--build=$(build-aux/config.guess)
make
make DESTDIR=$LFS install
finish
@ -246,8 +248,8 @@ make
make DESTDIR=$LFS install
finish
# 6.11. Gzip-1.10
begin gzip-1.10 tar.xz
# 6.11. Gzip-1.12
begin gzip-1.12 tar.xz
./configure --prefix=/usr --host=$LFS_TGT
make
make DESTDIR=$LFS install
@ -289,19 +291,21 @@ make
make DESTDIR=$LFS install
finish
# 6.16. Xz-5.2.5
begin xz-5.2.5 tar.xz
# 6.16. Xz-5.2.6
begin xz-5.2.6 tar.xz
./configure --prefix=/usr \
--host=$LFS_TGT \
--build=$(build-aux/config.guess) \
--disable-static \
--docdir=/usr/share/doc/xz-5.2.5
--docdir=/usr/share/doc/xz-5.2.6
make
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/liblzma.la
finish
# 6.17. Binutils-2.37 - Pass 2
begin binutils-2.37 tar.xz
# 6.17. Binutils-2.39 - Pass 2
begin binutils-2.39 tar.xz
sed '6009s/$add_dir//' -i ltmain.sh
mkdir -v build
cd build
../configure \
@ -310,15 +314,16 @@ cd build
--host=$LFS_TGT \
--disable-nls \
--enable-shared \
--enable-gprofng=no \
--disable-werror \
--enable-64-bit-bfd
make
make DESTDIR=$LFS install -j1
install -vm755 libctf/.libs/libctf.so.0.0.0 $LFS/usr/lib
make DESTDIR=$LFS install
rm -v $LFS/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.{a,la}
finish
# 6.18. GCC-11.2.0 - Pass 2
begin gcc-11.2.0 tar.xz
# 6.18. GCC-12.2.0 - Pass 2
begin gcc-12.2.0 tar.xz
tar -xf ../mpfr-4.1.0.tar.xz
mv -v mpfr-4.1.0 mpfr
tar -xf ../gmp-6.2.1.tar.xz
@ -330,15 +335,16 @@ case $(uname -m) in
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
;;
esac
sed '/thread_header =/s/@.*@/gthr-posix.h/' \
-i libgcc/Makefile.in libstdc++-v3/include/Makefile.in
mkdir -v build
cd build
mkdir -pv $LFS_TGT/libgcc
ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h
../configure \
--build=$(../config.guess) \
--host=$LFS_TGT \
--target=$LFS_TGT \
LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \
--prefix=/usr \
CC_FOR_TARGET=$LFS_TGT-gcc \
--with-build-sysroot=$LFS \
--enable-initfini-array \
--disable-nls \
@ -349,7 +355,6 @@ ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h
--disable-libquadmath \
--disable-libssp \
--disable-libvtv \
--disable-libstdcxx \
--enable-languages=c,c++
make
make DESTDIR=$LFS install