aboutsummaryrefslogtreecommitdiffstats
path: root/chapter5/glibc.sh
blob: a304af04c834a1ca4f66b22f63c26a86bb8557c4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e

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-"${VERSION}"-fhs-1.patch &&

mkdir -v build
cd build || exit 1

../configure \
      --prefix=/usr \
      --host="${LFS_TGT}" \
      --build="$(../scripts/config.guess)" \
      --enable-kernel=5.10.0 \
      --with-headers="${LFS}"/usr/include \
      libc_cv_slibdir=/lib &&

make PARALLELMFLAGS="${MAKEFLAGS}" &&
make DESTDIR="${LFS}" install &&

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}"/10.3.0/install-tools/mkheaders