[lfs] 04/04: Merge remote-tracking branch 'origin/trunk' into xry111/mips64el

"Git Owner" ([email protected] via lfs-book Mailing List) <[email protected]>
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/mips64el
in repository lfs.

commit d9480ed335cec3776367c653ea994e63bdc14e79
Merge: 92ab1b454 722ec5bf9
Author: Xi Ruoyao <[email protected]>
AuthorDate: Thu May 29 20:46:49 2025 +0800

    Merge remote-tracking branch 'origin/trunk' into xry111/mips64el

 appendices/dependencies.xml                |  93 +++---
 chapter01/changelog.xml                    | 512 +++++++----------------------
 chapter01/whatsnew.xml                     | 126 ++++---
 chapter03/packages.xml                     |  18 +-
 chapter04/addinguser.xml                   |   2 +-
 chapter05/glibc.xml                        | 116 +++++--
 chapter05/libstdc++.xml                    |  14 +-
 chapter06/diffutils.xml                    |  28 ++
 chapter06/gcc-pass2.xml                    |  37 +--
 chapter06/make.xml                         |  14 -
 chapter06/tar.xml                          |   4 +-
 chapter08/acl.xml                          |   4 +-
 chapter08/bison.xml                        |   2 +-
 chapter08/chapter08.xml                    |   4 +-
 chapter08/check.xml                        | 109 ------
 chapter08/e2fsprogs.xml                    |  12 +-
 chapter08/flex.xml                         |   2 +-
 chapter08/gcc.xml                          |   5 +-
 chapter08/gettext.xml                      |   3 +-
 chapter08/glibc.xml                        |  25 +-
 chapter08/gperf.xml                        |   6 +-
 chapter08/inetutils.xml                    |   2 +-
 chapter08/kmod.xml                         |  52 +--
 chapter08/libelf.xml                       |   7 +-
 chapter08/libffi.xml                       |  11 +-
 chapter08/libtool.xml                      |   2 +-
 chapter08/packaging.xml                    |  75 +++++
 chapter08/perl.xml                         |   2 +-
 chapter08/pkgconf.xml                      |   4 +-
 chapter08/pkgmgt.xml                       |  33 +-
 chapter08/stripping.xml                    |  28 +-
 chapter08/sysklogd.xml                     |   1 +
 chapter08/systemd.xml                      |   2 +-
 chapter08/tcl.xml                          |   6 +-
 chapter10/fstab.xml                        |   4 +-
 general.ent                                |  14 +-
 lfs-latest-git.php                         |   5 +-
 packages.ent                               | 274 +++++++--------
 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 +-
 44 files changed, 860 insertions(+), 1026 deletions(-)

diff --cc chapter04/addinguser.xml
index 5c6dbb76e,4b4ec7fd5..876b0f9a8
--- a/chapter04/addinguser.xml
+++ b/chapter04/addinguser.xml
@@@ -80,7 -80,10 +80,7 @@@ useradd -s /bin/bash -g &lfs-groupname
    all the directories under <filename class="directory">$LFS</filename> by making
    <systemitem class="username">lfs</systemitem> the owner:</para>
  
- <screen><userinput>chown -v &lfs-username; $LFS/{usr{,/*},lib*,var,etc,bin,sbin,tools}</userinput></screen>
 -<screen><userinput>chown -v &lfs-username; $LFS/{usr{,/*},var,etc,tools}
 -case $(uname -m) in
 -  x86_64) chown -v &lfs-username; $LFS/lib64 ;;
 -esac</userinput></screen>
++<screen><userinput>chown -v &lfs-username; $LFS/{usr{,/*},lib64,var,etc,tools}</userinput></screen>
  
  <note><para>In some host systems, the following <command>su</command> command does not complete
    properly and suspends the login for the &lfs-user; user to the background.
diff --cc chapter05/glibc.xml
index 6f9d6f171,def63edf0..f306b3f7a
--- a/chapter05/glibc.xml
+++ b/chapter05/glibc.xml
@@@ -197,33 -189,98 +186,102 @@@ 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</userinput></screen>
+ <screen><userinput>echo 'int main(){}' | $LFS_TGT-gcc -x c - -v -Wl,--verbose &amp;&gt; 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.so.1</computeroutput></screen>
 +
 +      <para>Note that if <parameter>--with-nan=2008</parameter> is used for
 +      GCC, the interpreter name will be
 +      <filename>/lib64/ld-linux-mipsn8.so.1</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>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 &lt;...&gt; 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>Once all is well, clean up the test file:</para>
+   <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
diff --cc chapter06/gcc-pass2.xml
index f316c8208,478462c78..1aedf4508
--- a/chapter06/gcc-pass2.xml
+++ b/chapter06/gcc-pass2.xml
@@@ -85,26 -83,24 +85,25 @@@ cd       build</userinput></screen
  
      <para>Now prepare GCC for compilation:</para>
  
- <screen><userinput remap="configure">../configure                                       \
-     --build=$(../config.guess)                     \
-     --host=$LFS_TGT                                \
-     --target=$LFS_TGT                              \
-     LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc      \
-     --prefix=/usr                                  \
-     --with-arch=mips64r2                           \
-     --with-build-sysroot=$LFS                      \
-     --enable-default-pie                           \
-     --enable-default-ssp                           \
-     --disable-nls                                  \
-     --disable-multilib                             \
-     --disable-libatomic                            \
-     --disable-libgomp                              \
-     --disable-libquadmath                          \
-     --disable-libsanitizer                         \
-     --disable-libssp                               \
-     --disable-libvtv                               \
-     --enable-languages=c,c++                       \
+ <screen><userinput remap="configure">../configure                   \
+     --build=$(../config.guess) \
+     --host=$LFS_TGT            \
+     --target=$LFS_TGT          \
+     LDFLAGS_FOR_TARGET=-L$PWD/$LFS_TGT/libgcc \
+     --prefix=/usr              \
+     --with-build-sysroot=$LFS  \
+     --enable-default-pie       \
+     --enable-default-ssp       \
+     --disable-nls              \
+     --disable-multilib         \
+     --disable-libatomic        \
+     --disable-libgomp          \
+     --disable-libquadmath      \
+     --disable-libsanitizer     \
+     --disable-libssp           \
+     --disable-libvtv           \
 -    --enable-languages=c,c++</userinput></screen>
++    --enable-languages=c,c++   \
 +    $($LFS_TGT-gcc -v 2>&amp;1 | grep -o ..with-nan=2008)</userinput></screen>
  
      <variablelist>
        <title>The meaning of the new configure options:</title><!-- WIP -->
diff --cc chapter08/libelf.xml
index 4fab3cf8b,c2d44c837..64142a4fc
--- a/chapter08/libelf.xml
+++ b/chapter08/libelf.xml
@@@ -58,9 -58,9 +58,12 @@@
  
  <screen><userinput remap="test">make check</userinput></screen>
  
+     <para>Two tests are known to fail, dwarf_srclang_check and 
+     run-backtrace-native-core.sh.</para>
+ 
 +    <para>Six tests are known to fail due to incomplete MIPS
 +    support.</para>
 +
      <para>Install only Libelf:</para>
  
  <screen><userinput remap="install">make -C libelf install
diff --cc chapter08/pkgmgt.xml
index b6b230b3f,3640b519d..b16894750
--- a/chapter08/pkgmgt.xml
+++ b/chapter08/pkgmgt.xml
@@@ -370,14 -385,16 +385,16 @@@ make DESTDIR=/usr/pkg/libfoo/1.1 instal
      differences in system hardware and the original kernel
      configuration.</para>
  
-     <note><para>There have been some reports of issues when copying between
-     similar but not identical architectures. For instance, the instruction set
-     for an Intel system is not identical with the AMD processor's instructions, and later
-     versions of some processors may provide instructions that are unavailable with
-     earlier versions.</para></note>
+     <important><para>If you want to deploy the LFS system onto a system
+     with a different CPU, when you build <xref linkend='ch-system-gmp'/> and
+     <xref linkend='ch-system-libffi'/> you must follow the notes about
+     overriding the architecture-specific optimization to produce libraries
+     suitable for both the host system and the system(s) where you'll deploy
+     the LFS system.  Otherwise you'll get <computeroutput>Illegal
+     Instruction</computeroutput> errors running LFS.</para></important>
  
 -    <para>Finally, the new system has to be made bootable via <xref
 -    linkend="ch-bootable-grub"/>.</para>
 +    <para>Finally, the new system has to be made bootable by configuring
 +    a bootloader correctly.</para>
  
    </sect2>
  

-- 
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.