Add 5.5 - Build glibc

This commit is contained in:
Aditya 2023-01-08 15:37:41 +05:30
parent 24776e48c3
commit 254b0813d1
2 changed files with 59 additions and 0 deletions

View file

@ -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

View file

@ -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