Subject: bug#79405: build failures on macOS and Cygwin

From: Bruno Haible <[email-masked]>
Date: Mon, 08 Sep 2025 09:41:00 +0200

Hi,

The CI reports build failures on macOS and Cygwin, regressions from
last week.

1) New build failure on macOS 13, 14:

gcc   -g -O2  -L/Users/runner/lib -L/usr/local/opt/gettext/lib -o diff analyze.o context.o diff.o dir.o ed.o ifdef.o io.o normal.o side.o system.o util.o libver.a ../lib/libdiffutils.a     -L/usr/local/lib -lintl -Wl,-framework -Wl,CoreFoundation      
ld: warning: search path '/Users/runner/lib' not found
ld: Undefined symbols:
  _locale_charset, referenced from:
      _rpl_wcwidth in libdiffutils.a[131](libdiffutils_a-wcwidth.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [diff] Error 1

2) New build failure on Cygwin:

gcc   -g -O2   -o cmp.exe cmp.o system.o libver.a ../lib/libdiffutils.a           
/usr/lib/gcc/i686-pc-cygwin/11/../../../../i686-pc-cygwin/bin/ld: ../lib/libdiffutils.a(libdiffutils_a-mbrtoc32.o): in function `mbrtoc32':
/cygdrive/d/a/ci-check/ci-check/diffutils-2025-09-08/build/lib/../../lib/mbrtoc32.c:157: undefined reference to `locale_charset'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:2507: cmp.exe] Error 1

This is caused by the --avoid=localcharset option in
commit e124541148d38cd8b7f962aceb72fb44e7cc0aab. Why would you want
to avoid this module? It does not use multithreading or locking,
and has no dependencies aside from the omnipresent 'extensions'.
It merely calls nl_langinfo (CODESET) with some table-based postprocessing.
Although this may be slow,
  - gnulib/lib/wcwidth.c mitigates this through a cache,
  - gnulib/lib/mbrtoc32.c uses it only on platforms with 16-bit wchar_t,
    and we don't care about speed on these platforms.

I would therefore suggest to remove this "--avoid=localcharset" line
from bootstrap.conf.

Bruno