Re: Defaults when cross-compiling

2023-11-08 Thread Michael T. Kloos
It seems to me that Autoconf (configure) is making some bad choices if 
it is just guessing that support exists like that, especially when it 
has a guaranteed fallback.  It's job is to setup the build for the 
target host system.  I was able to fix the build by using 
--without-bash-malloc.  Simply unsetting HAVE_SBRK didn't work by 
itself.  It is my opinion that the behavior should be that if configure 
can't check that support exists, it should change the default build 
options to be --without-bash-malloc.  If the user, then, re-enables it 
on the configure command line with --with-bash-malloc, that is on them.


On 11/7/2023 11:11 AM, Chet Ramey wrote:

On 11/7/23 10:03 AM, Oğuz wrote:
On Tuesday, November 7, 2023, Chet Ramey > wrote:


    It's interesting that musl supports brk but not sbrk


It doesn't support locales either. I always assumed it's someone's 
toy project but looks like there are Linux distros shipping it 
instead of glibc. Huh


They probably want some minimal system for containers. dash doesn't 
handle
multibyte characters or different locales either, but distros still 
use it.






Defaults when cross-compiling

2023-11-06 Thread Michael T. Kloos
I was trying to cross-compile bash for musl libc.  The configure script reports:

checking for working sbrk... configure: WARNING: cannot check working sbrk if 
cross-compiling
yes

However, I don't believe musl libc supports sbrk.  However, autoconf seems to 
default
to assuming yes and sets the HAVE_SBRK definition.  Bash then crashes on 
xmalloc failure.  
Is this intended behavior?