You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
#!/usr/bin/env bash |
|
|
|
echo "---- LFS=${LFS}" |
|
echo "---- LFS_TGT=${LFS_TGT}" |
|
|
|
case $(uname --machine) 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-fhs-1.patch |
|
|
|
mkdir --verbose build |
|
|
|
cd build || return 1 |
|
|
|
echo "rootsbindir=/usr/sbin" > configparms |
|
|
|
../configure \ |
|
--prefix=/usr \ |
|
--host=$LFS_TGT \ |
|
--build=$(../scripts/config.guess) \ |
|
--disable-nscd \ |
|
libc_cv_slibdir=/usr/lib \ |
|
--enable-kernel=5.4 |
|
|
|
make |
|
make DESTDIR="${LFS}" install |
|
|
|
sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd |
|
|
|
|
|
echo 'int main(){}' | $LFS_TGT-gcc -x c - -v -Wl,--verbose &> dummy.log |
|
grep -E -o "$LFS/lib.*/S?crt[1in].*succeeded" dummy.log || return 1 |
|
grep -B3 "^ $LFS/usr/include" dummy.log || return 1 |
|
grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' || return 1 |
|
grep "/lib.*/libc.so.6 " dummy.log |grep 'succeeded' || return 1 |
|
|
|
case $(uname -m) in |
|
i?86) |
|
readelf -l a.out | grep ': /lib' | grep '/lib/ld-linux.so.2' || return 1 |
|
grep found dummy.log |grep '/mnt/lfs/usr/lib/ld-linux.so.2' || return 1 |
|
;; |
|
x86_64) |
|
readelf -l a.out | grep ': /lib' | grep '/lib64/ld-linux-x86-64.so.2' || return 1 |
|
grep found dummy.log |grep '/mnt/lfs/usr/lib/ld-linux-x86-64.so.2' || return 1 |
|
;; |
|
esac |
|
|
|
|