%general-entities; ]> bash &bash-version;
&bash-url;
Bash-&bash-version; Bash tools <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="../chapter08/bash.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> <seg>&bash-tmp-sbu;</seg> <seg>&bash-tmp-du;</seg> </seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Bash Fix an issue when host has already gcc-15: patch -Np1 <<EOF --- bash-5.3-rc1/bashansi.h 2024-03-26 00:17:49.000000000 +0800 +++ bash-5.3-rc1.patched/bashansi.h 2025-05-21 15:04:17.090096535 +0800 @@ -35,8 +35,11 @@ # include "ansi_stdlib.h" #endif /* !HAVE_STDLIB_H */ -/* If bool is not a compiler builtin, prefer stdbool.h if we have it */ -#if !defined (HAVE_C_BOOL) +/* If bool is not a compiler builtin, prefer stdbool.h if we have it + + Explicitly check __STDC_VERSION__ here in addition to HAVE_C_BOOL: + in cross-compilation build tools does not include config.h. */ +#if !defined (HAVE_C_BOOL) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L) # if defined (HAVE_STDBOOL_H) # include <stdbool.h> # else EOF Prepare Bash for compilation: ./configure --prefix=/usr \ --build=$(sh support/config.guess) \ --host=$LFS_TGT \ --without-bash-malloc The meaning of the configure options: --without-bash-malloc This option turns off the use of Bash's memory allocation (malloc) function which is known to cause segmentation faults. By turning this option off, Bash will use the malloc functions from Glibc which are more stable. Compile the package: make Install the package: make DESTDIR=$LFS install Make a link for the programs that use sh for a shell: ln -sv bash $LFS/bin/sh <para>Details on this package are located in <xref linkend="contents-bash" role="."/></para> </sect2> </sect1>