From 9d92ca9e8a18d471b1d6ec9d206a2fbce057f46a Mon Sep 17 00:00:00 2001 From: Xi Ruoyao Date: Wed, 3 Jan 2024 13:44:02 +0800 Subject: [PATCH] mips64el: glibc: adapt symlink for ELF loader --- chapter05/glibc.xml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index b8b8171da..cf4e209ac 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -43,17 +43,14 @@ Installation of Glibc - First, create a symbolic link for LSB compliance. Additionally, - for x86_64, create a compatibility symbolic link required for proper + Create a compatibility symbolic link required for proper operation of the dynamic library loader: -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 +if $LFS_TGT-gcc -v 2>&1 | grep nan=2008 &>/dev/null; then + ln -sfv ../lib/ld-linux-mipsn8.so.1 $LFS/lib64 +else + ln -sfv ../lib/ld.so.1 $LFS/lib64 +fi @@ -206,15 +203,16 @@ cd build expected. To perform a sanity check, run the following commands: echo 'int main(){}' | $LFS_TGT-gcc -xc - -readelf -l a.out | grep ld-linux +readelf -l a.out | grep /ld If everything is working correctly, there should be no errors, and the output of the last command will be of the form: -[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] +[Requesting program interpreter: /lib64/ld.so.1 - Note that for 32-bit machines, the interpreter name will be - /lib/ld-linux.so.2. + Note that if --with-nan=2008 is used for + GCC, the interpreter name will be + /lib64/ld-linux-mipsn8.so.1. If the output is not as shown above, or there is no output at all, then something is wrong. Investigate and retrace the steps to find out