| Newsgroups |
gmane.linux.lfs.book |
| Message-ID |
<[email protected]> |
This is an automated email from the git hooks/post-receive script.
git pushed a commit to branch xry111/loongarch
in repository lfs.
commit 314880b4a421ced8d6f06c69a83fbeaa15995cfa
Merge: 2a0ab6f6b abd4750c8
Author: Xi Ruoyao <[email protected]>
AuthorDate: Tue Apr 15 19:22:07 2025 +0800
Merge remote-tracking branch 'origin/trunk' into xry111/loongarch
appendices/dependencies.xml | 85 ++---
chapter01/changelog.xml | 584 +++++------------------------
chapter01/whatsnew.xml | 140 ++++---
chapter03/packages.xml | 18 +-
chapter05/glibc.xml | 117 ++++--
chapter06/diffutils.xml | 28 ++
chapter06/make.xml | 14 -
chapter08/chapter08.xml | 2 +-
chapter08/check.xml | 113 ------
chapter08/gcc.xml | 5 +-
chapter08/glibc.xml | 10 -
chapter08/kmod.xml | 1 -
chapter08/libffi.xml | 7 +-
chapter08/packaging.xml | 76 ++++
chapter08/pkgmgt.xml | 33 +-
chapter10/fstab.xml | 4 +-
general.ent | 8 +-
lfs-latest-git.php | 1 -
packages.ent | 226 +++++------
part3intro/toolchaintechnotes.xml | 194 ++++++----
patches.ent | 4 +-
stylesheets/lfs-xsl/chunk-master.xsl | 8 +-
stylesheets/lfs-xsl/pdf/lfs-mixed.xsl | 10 +
stylesheets/lfs-xsl/xhtml/lfs-mixed.xsl | 10 +
stylesheets/lfs-xsl/xhtml/lfs-sections.xsl | 2 +-
25 files changed, 711 insertions(+), 989 deletions(-)
diff --cc chapter05/glibc.xml
index 03530cf61,11d4cfce4..e1f8ee6a1
--- a/chapter05/glibc.xml
+++ b/chapter05/glibc.xml
@@@ -193,32 -189,98 +182,98 @@@ cd build</userinput></screen
<screen><userinput remap="install">sed '/RTLDLIST=/s@/usr@@g' -i $LFS/usr/bin/ldd</userinput></screen>
- <caution>
- <para>At this point, it is imperative to stop and ensure that the basic
- functions (compiling and linking) of the new toolchain are working as
- expected. To perform a sanity check, run the following commands:</para>
+ <para>Now that our cross toolchain is in place, it is important to ensure
+ that compiling and linking will work as expected. We do this by performing
+ some sanity checks:</para>
- <screen><userinput>echo 'int main(){}' | $LFS_TGT-gcc -xc -
- readelf -l a.out | grep ld-linux</userinput></screen>
+ <screen><userinput>echo 'int main(){}' | $LFS_TGT-gcc -x c - -v -Wl,--verbose &> dummy.log
+ readelf -l a.out | grep ': /lib'</userinput></screen>
- <para>If everything is working correctly, there should be no errors,
- and the output of the last command will be of the form:</para>
+ <para>There should be no errors,
+ and the output of the last command will be (allowing for
+ platform-specific differences in the dynamic linker name):</para>
-<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]</computeroutput></screen>
+<screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-loongarch-lp64d.so.1]</computeroutput></screen>
- <!--
- <para>Note that for 32-bit machines, the interpreter name will be
- <filename>/lib/ld-linux.so.2</filename>.</para>
- -->
- <para>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
- where the problem is and correct it. This issue must be resolved before
- continuing.</para>
- <para>Once all is well, clean up the test file:</para>
+ <para>Note that this path should not contain
+ <filename class='directory'>/mnt/lfs</filename> (or the value of
+ the <envar>LFS</envar> variable if you used a different one). The path is
+ resolved when the compiled program is executed, and that should only happen
+ after we enter the chroot environment where the kernel would consider
+ <filename class='directory'>$LFS</filename> as the root directory
+ (<filename class='directory'>/</filename>).</para>
+
+ <para>Now make sure that we're set up to use the correct start files:</para>
+
+ <screen><userinput>grep -E -o "$LFS/lib.*/S?crt[1in].*succeeded" dummy.log</userinput></screen>
+
+ <para>The output of the last command should be:</para>
+
+ <screen><computeroutput>/mnt/lfs/lib/../lib/Scrt1.o succeeded
+ /mnt/lfs/lib/../lib/crti.o succeeded
+ /mnt/lfs/lib/../lib/crtn.o succeeded</computeroutput></screen>
+
+ <para>Verify that the compiler is searching for the correct header
+ files:</para>
+
+ <screen><userinput>grep -B3 "^ $LFS/usr/include" dummy.log</userinput></screen>
+
+ <para>This command should return the following output:</para>
+
+ <screen><computeroutput>#include <...> search starts here:
+ /mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/&gcc-version;/include
+ /mnt/lfs/tools/lib/gcc/x86_64-lfs-linux-gnu/&gcc-version;/include-fixed
+ /mnt/lfs/usr/include</computeroutput></screen>
+
+ <para>Again, the directory named after your target triplet may be
+ different than the above, depending on your system architecture.</para>
+
+ <para>Next, verify that the new linker is being used with the correct search paths:</para>
+
+ <screen><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen>
+
+ <para>References to paths that have components with '-linux-gnu' should
+ be ignored, but otherwise the output of the last command should be:</para>
+
+ <screen><computeroutput>SEARCH_DIR("=/mnt/lfs/tools/x86_64-lfs-linux-gnu/lib64")
+ SEARCH_DIR("=/usr/local/lib64")
+ SEARCH_DIR("=/lib64")
+ SEARCH_DIR("=/usr/lib64")
+ SEARCH_DIR("=/mnt/lfs/tools/x86_64-lfs-linux-gnu/lib")
+ SEARCH_DIR("=/usr/local/lib")
+ SEARCH_DIR("=/lib")
+ SEARCH_DIR("=/usr/lib");</computeroutput></screen>
+
+ <para>A 32-bit system may use a few other directories, but anyway
+ the important facet here is all the paths should begin with an equal sign
+ (<literal>=</literal>), which would be replaced with the sysroot
+ directory that we've configured for the linker.</para>
+
+ <para>Next make sure that we're using the correct libc:</para>
+
+ <screen><userinput>grep "/lib.*/libc.so.6 " dummy.log</userinput></screen>
+
+ <para>The output of the last command should be:</para>
+
+ <screen><computeroutput>attempt to open /mnt/lfs/usr/lib/libc.so.6 succeeded</computeroutput></screen>
+
+ <para>Make sure GCC is using the correct dynamic linker:</para>
+
+ <screen><userinput>grep found dummy.log</userinput></screen>
+
+ <para>The output of the last command should be (allowing for
+ platform-specific differences in dynamic linker name):</para>
+
+ <screen><computeroutput>found ld-linux-x86-64.so.2 at /mnt/lfs/usr/lib/ld-linux-x86-64.so.2</computeroutput></screen>
+
+ <para>If the output does not appear as shown above or is not received
+ at all, then something is seriously wrong. Investigate and retrace the
+ steps to find out where the problem is and correct it. Any
+ issues should be resolved before continuing with the process.</para>
- <screen><userinput>rm -v a.out</userinput></screen>
+ <para>Once everything is working correctly, clean up the test files:</para>
- </caution>
+ <screen><userinput>rm -v a.out dummy.log</userinput></screen>
<note><para>Building the packages in the next chapter will serve as an
additional check that the toolchain has been built properly. If some
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
--
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page