[lfs] branch trunk updated: gcc: use gcc -print-* to simplify two commands

"Git Owner" ([email protected] via lfs-book Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.book
Message-ID <177770422221.28886.90018598980216479@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository lfs.

The following commit(s) were added to refs/heads/trunk by this push:
     new ca22500f1 gcc: use gcc -print-* to simplify two commands
ca22500f1 is described below

commit ca22500f18e126a7418c3843a3579ee97ee443e2
Author: Xi Ruoyao <[email protected]>
AuthorDate: Sat May 2 14:33:28 2026 +0800

    gcc: use gcc -print-* to simplify two commands
    
    Make the commands more concise, and remove the explicit GCC version
    number to make people easier trying a new GCC version.
---
 chapter08/gcc.xml | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/chapter08/gcc.xml b/chapter08/gcc.xml
index 71520b00b..441250f02 100644
--- a/chapter08/gcc.xml
+++ b/chapter08/gcc.xml
@@ -244,8 +244,7 @@ su tester -c "PATH=$PATH make -k check"</userinput></screen>
     directory (and its content) is incorrect.  Change the ownership to the
     <systemitem class="username">root</systemitem> user and group:</para>
 
-<screen><userinput remap="install">chown -v -R root:root \
-    /usr/lib/gcc/$(gcc -dumpmachine)/&gcc-version;/include{,-fixed}</userinput></screen>
+<screen><userinput remap="install">chown -v -R root:root $(gcc -print-file-name=include){,}</userinput></screen>
 
     <para>Create a symlink required by the <ulink
     url="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s09.html">FHS</ulink>
@@ -263,8 +262,7 @@ su tester -c "PATH=$PATH make -k check"</userinput></screen>
     <para>Add a compatibility symlink to enable building programs with
     Link Time Optimization (LTO):</para>
 
-<screen><userinput remap="install">ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so \
-        /usr/lib/bfd-plugins/</userinput></screen>
+<screen><userinput remap="install">ln -sfvr $(gcc -print-prog-name=liblto_plugin.so) /usr/lib/bfd-plugins/</userinput></screen>
 
     <para>Now that our final toolchain is in place, it is important to again ensure
     that compiling and linking will work as expected. We do this by performing

-- 
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.