[lfs] 02/05: loongarch spec2026: ch06/bash: work around FTBFS with host GCC 15

"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/loongarch-12.0-spec2026
in repository lfs.

commit 9dbb1fac1cf48ea73aa9e408e50498e92db8fccf
Author: Xi Ruoyao <[email protected]>
AuthorDate: Sat May 2 23:21:04 2026 +0800

    loongarch spec2026: ch06/bash: work around FTBFS with host GCC 15
---
 chapter06/bash.xml | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/chapter06/bash.xml b/chapter06/bash.xml
index d00e685ca..331b22125 100644
--- a/chapter06/bash.xml
+++ b/chapter06/bash.xml
@@ -45,7 +45,8 @@
 
     <para>Prepare Bash for compilation:</para>
 
-<screen><userinput remap="configure">./configure --prefix=/usr                      \
+<screen><userinput remap="configure">CC_FOR_BUILD="gcc -std=gnu17" \
+./configure --prefix=/usr                      \
             --build=$(sh support/config.guess) \
             --host=$LFS_TGT                    \
             --without-bash-malloc</userinput></screen>
@@ -53,6 +54,21 @@
     <variablelist>
       <title>The meaning of the configure options:</title>
 
+      <varlistentry>
+        <term><parameter>CC_FOR_BUILD="gcc -std=gnu17"</parameter></term>
+        <listitem>
+          <para>The build system needs to compile some code generators
+          with the C compiler of the host distro (as we've discussed in
+          <xref linkend='ch-tools-toolchaintechnotes'/> it's not possible to
+          use the stage 1 or 2 GCC of LFS for this purpose).  If the host
+          distro ships GCC 15 or newer, the default C standard would
+          be C23 with GNU extensions (or maybe even newer), with that the
+          <quote>legacy</quote> code in the generators is not compatible.
+          Explicitly specify C17 with GNU extensions to work around the
+          issue.</para>
+        </listitem>
+      </varlistentry>
+
       <varlistentry>
         <term><parameter>--without-bash-malloc</parameter></term>
         <listitem>

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