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

袁博实 ([email protected] via lfs-support Mailing List) <[email protected]> Sun, 29 Jun 2025 12:46:39 +0800
Newsgroups gmane.linux.lfs.support
Message-ID <[email protected]>
> 2025年6月29日 01:47,Bhaumik Tripathi <[email protected]> wrote:
> 
> On 28/06/25 11:06, 袁博实 ([email protected] via lfs-support Mailing
> List) 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.
>> 
>> Thank you!
>> 
> 
> Arch is ahead and uses gcc-15. A similar error made me open a request in
> this mail. You can fix this issue as mentioned here precisely.
> https://github.com/openwrt/packages/issues/26469
> Moving further in the book wouldn't cause any other issues with this
> fix.

Thanks Bhaumik! The problem is fixed after exporting
CFLAGS_FOR_BUILD="-std=gnu17”. 

Boshi Yuan

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