Re: Error building Bash-5.2.37 (12.3-systemd)

"Xi Ruoyao" ([email protected] via lfs-support Mailing List) <[email protected]> Sat, 28 Jun 2025 13:38:59 +0800
Newsgroups gmane.linux.lfs.support
Message-ID <[email protected]>
On Sat, 2025-06-28 at 13:36 +0800, 袁博实 wrote:
> Hi,
> 
> I encountered build errors when building bash, I (seem to) have fixed
> them, so I would like to provide some feedbacks.
> 
> Book version: 12.3-systemd 
> Host OS $(uname -r): 6.15.3-arch1-1
> The output from the Host System Requirements script: All OK
> 
> The section: 6.4. Bash-5.2.37
> 
> I followed every step of the book, but when building bash (running
> make), I encountered the following error:
> 
> mkbuiltins.c:267:29: error: too many arguments to function 'xmalloc';
> expected 0, have 1
>   267 |error_directory = xmalloc (2 + strlen (argv[arg_index]));
>       |                  ^~~~~~~  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> The error messages are too long so I only included the first error.
> 
> After search on the Internet
> (https://mail.gnu.org/archive/html/bug-bash/2025-03/msg00063.html), I
> found that this is due to the C23 standards in newer versions of GCC.
> 
> So I "export CFLAGS=-std=gnu17" then the problem is solved. I haven't
> finished the book so I'm not sure whether there would be further
> issues.
> 
> This problem does not seem to be due to cross-compilation, since the
> bulding of Bash-5.2.37 also fails with my host compiler (gcc 15.1.1).
> Bash-5.3-rc2 can be built with my host compiler, but I have not yet
> tested in cross-compilation configuration.

Quote from
https://www.linuxfromscratch.org/lfs/view/12.3-systemd/chapter02/hostreqs.html:

   GCC-5.2 including the C++ compiler, g++ (Versions greater than 14.2.0
   are not recommended as they have not been tested). 

There's nothing we can do here as we cannot edit a book version that
we've already released, nor anticipate what a future version of the
compiler will do.

-- 
Xi Ruoyao <[email protected]>

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-support
Unsubscribe: See the above information page