From 254b0813d1a6d46bbebab940b1d9ee06916e7c2b Mon Sep 17 00:00:00 2001 From: Aditya Date: Sun, 8 Jan 2023 15:37:41 +0530 Subject: [PATCH] Add 5.5 - Build glibc --- scripts/chapter5/5.5-glibc.sh | 45 +++++++++++++++++++++++++++++++++++ scripts/main.sh | 14 +++++++++++ 2 files changed, 59 insertions(+) create mode 100644 scripts/chapter5/5.5-glibc.sh diff --git a/scripts/chapter5/5.5-glibc.sh b/scripts/chapter5/5.5-glibc.sh new file mode 100644 index 0000000..47a1526 --- /dev/null +++ b/scripts/chapter5/5.5-glibc.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +cd $LFS/sources +tar xf glibc-2.36.tar.xz +cd glibc-2.36 + +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-2.36-fhs-1.patch + +mkdir -v build +cd build + +echo "rootsbindir=/usr/sbin" > configparms + +../configure \ + --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(../scripts/config.guess) \ + --enable-kernel=3.2 \ + --with-headers=$LFS/usr/include \ + libc_cv_slibdir=/usr/lib + +if [ $? -ne 0] +then + exit 1 +fi + +make -j5 + +if [ $? -ne 0] +then + exit 1 +fi + +sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd + +$LFS/tools/libexec/gcc/$LFS_TGT/12.2.0/install-tools/mkheaders + diff --git a/scripts/main.sh b/scripts/main.sh index c981494..d0f1b83 100644 --- a/scripts/main.sh +++ b/scripts/main.sh @@ -163,3 +163,17 @@ if [ $exit_status -ne 0 ] then stop_script "chapter5/5.4-linux-headers.sh" fi + +# Chapter 5.5 +# =========== +echo "Building glibc" +su - lfs -c "$PWD/chapter5/5.5-glibc.sh" + +# Exit on error +check_exit_code +if [ $exit_status -ne 0 ] +then + stop_script "chapter5/5.5-glibc.sh" +fi + +