Re: strtoimax test still broken

2024-04-09 Thread Dag-Erling Smørgrav
Chet Ramey  writes:
> The fixed version of strtoimax.m4 has been in the devel branch since
> October 3, 2022. Since bash-5.2 built fine on FreeBSD 13 before I released
> it, I assume the link problem exist only on systems using musl.

des@crash13 ~/src/bash-5.2% uname -r
13.3-STABLE
des@crash13 ~/src/bash-5.2% ./configure --enable-static-link && make
[...]
cc -L./builtins -L./lib/readline -L./lib/readline -L./lib/glob  -L./lib/tilde 
-L./lib/malloc -L./lib/sh  -static  -g -O2  -static -o bash shell.o eval.o 
y.tab.o general.o make_cmd.o print_cmd.o   dispose_cmd.o execute_cmd.o 
variables.o copy_cmd.o error.o  expr.o flags.o jobs.o subst.o hashcmd.o 
hashlib.o mailcheck.o  trap.o input.o unwind_prot.o pathexp.o sig.o test.o 
version.o  alias.o array.o arrayfunc.o assoc.o braces.o bracecomp.o bashhist.o  
bashline.o  list.o stringlib.o locale.o findcmd.o redir.o  pcomplete.o 
pcomplib.o syntax.o xmalloc.o  -lbuiltins -lglob -lsh -lreadline -lhistory  
-ltermcap -ltilde -lmalloc lib/intl/libintl.a   
ld: error: duplicate symbol: strtoimax
>>> defined at strtoimax.c:67
>>>strtoimax.o:(strtoimax) in archive ./lib/sh/libsh.a
>>> defined at xlocale_private.h:201 
>>> (/usr/src/lib/libc/locale/xlocale_private.h:201)
>>>strtoimax.o:(.text+0x230) in archive /usr/lib/libc.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /home/des/src/bash-5.2

DES
-- 
Dag-Erling Smørgrav - d...@des.no



strtoimax test still broken

2024-04-07 Thread Dag-Erling Smørgrav
Hi,

The strtoimax() existence test in m4/strtoimax.m4 has been broken since
its inception in September 2022.  The test is supposed to check if
strtoimax() is available, and provide a replacement if it isn't, but the
condition is inverted, so it provides a replacement if and only if the
function is already available.  This means that bash a) fails to link on
systems that lack strtoimax(), and b) may also fail to link on systems
that do have it, depending on implementation details.

This issue was reported here on 2022-10-01, with a trivial patch (and a
slightly incorrect description):

https://lists.gnu.org/archive/html/bug-bash/2022-10/msg0.html

A year and a half later, the patch has still not been committed, and
downstream distributions are still having to carry their own patch:

https://cgit.freebsd.org/ports/tree/shells/bash/files/patch-m4_strtoimax.m4
https://sources.debian.org/patches/bash/5.2.15-2/bash-musl.diff/

Can you please deal with this?

DES
-- 
Dag-Erling Smørgrav - d...@des.no