Hi Bruno,

Bruno Haible <[email protected]> writes:

> On FreeBSD:
>
> depbase=`echo test-xstrtoimax.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`; cc 
> -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..  
> -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. 
> -I../../gltests/..  -I../gllib -I../../gltests/../gllib  -I/usr/local/include 
> -Wall -DCONTINUE_AFTER_ASSERT -D_THREAD_SAFE -Wno-error -Wno-error -g -O2 -MT 
> test-xstrtoimax.o -MD -MP -MF $depbase.Tpo -c -o test-xstrtoimax.o 
> ../../gltests/test-xstrtoimax.c && mv -f $depbase.Tpo $depbase.Po
> cc -Wno-error -Wno-error -g -O2  -L/usr/local/lib -o test-xstrtoimax 
> test-xstrtoimax.o libtests.a ../gllib/libgnu.a libtests.a ../gllib/libgnu.a 
> libtests.a  /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib 
> -lbacktrace -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm -lm
> ld: error: undefined symbol: libiconv
>>>> referenced by lc-charset-unicode.c:177 
>>>> (../../gllib/lc-charset-unicode.c:177)
>>>>               lc-charset-unicode.o:(locale_encoding_to_unicode) in archive 
>>>> ../gllib/libgnu.a
>>>> referenced by lc-charset-unicode.c:236 
>>>> (../../gllib/lc-charset-unicode.c:236)
>>>>               lc-charset-unicode.o:(unicode_to_locale_encoding) in archive 
>>>> ../gllib/libgnu.a

Oh, I didn't see it was called in tests. My bad.

I pushed the attached patch which fixes in on FreeBSD. Based on the
macOS output, it should also fix it there. The cfarm machine seems to
not have libiconv installed, though, so I couldn't really test there.

Collin

>From d7b8678ad36518bd8e13d8bbb9e893f042e63884 Mon Sep 17 00:00:00 2001
Message-ID: <d7b8678ad36518bd8e13d8bbb9e893f042e63884.1781580607.git.collin.fu...@gmail.com>
From: Collin Funk <[email protected]>
Date: Mon, 15 Jun 2026 19:36:06 -0700
Subject: [PATCH] xstrtol tests: Fix link error on FreeBSD and macOS (regr.
 2026-06-13).

* modules/xstrtol-tests (Makefile.am): Link the test programs to
$(LIBUNISTRING), $(MBRTOWC_LIB), and $(LIBC32CONV).
* modules/xstrtoimax-tests (Makefile.am): Likewise.
* modules/xstrtoumax-tests (Makefile.am): Likewise.
* modules/xstrtoll-tests (Makefile.am): Likewise. Use @LIBINTL@ instead
of $(LIBINTL).
---
 ChangeLog                | 10 ++++++++++
 modules/xstrtoimax-tests |  2 +-
 modules/xstrtol-tests    |  4 ++--
 modules/xstrtoll-tests   |  4 ++--
 modules/xstrtoumax-tests |  2 +-
 5 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dd9cb7c86b..3d2c75ac50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2026-06-15  Collin Funk  <[email protected]>
+
+	xstrtol tests: Fix link error on FreeBSD and macOS (regr. 2026-06-13).
+	* modules/xstrtol-tests (Makefile.am): Link the test programs to
+	$(LIBUNISTRING), $(MBRTOWC_LIB), and $(LIBC32CONV).
+	* modules/xstrtoimax-tests (Makefile.am): Likewise.
+	* modules/xstrtoumax-tests (Makefile.am): Likewise.
+	* modules/xstrtoll-tests (Makefile.am): Likewise. Use @LIBINTL@ instead
+	of $(LIBINTL).
+
 2026-06-15  Bruno Haible  <[email protected]>
 
 	localeconv: Fix compilation error on mingw (regression 2026-06-08).
diff --git a/modules/xstrtoimax-tests b/modules/xstrtoimax-tests
index 52dd71ed84..4b90a9061d 100644
--- a/modules/xstrtoimax-tests
+++ b/modules/xstrtoimax-tests
@@ -10,4 +10,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-xstrtoimax.sh
 check_PROGRAMS += test-xstrtoimax
-test_xstrtoimax_LDADD = $(LDADD) @LIBINTL@
+test_xstrtoimax_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
diff --git a/modules/xstrtol-tests b/modules/xstrtol-tests
index 3aa90b0d78..0b3c7a7196 100644
--- a/modules/xstrtol-tests
+++ b/modules/xstrtol-tests
@@ -14,5 +14,5 @@ configure.ac:
 Makefile.am:
 TESTS += test-xstrtol.sh
 check_PROGRAMS += test-xstrtol test-xstrtoul
-test_xstrtol_LDADD = $(LDADD) @LIBINTL@
-test_xstrtoul_LDADD = $(LDADD) @LIBINTL@
+test_xstrtol_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
+test_xstrtoul_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
diff --git a/modules/xstrtoll-tests b/modules/xstrtoll-tests
index 16902c43a8..a3b30a7bd2 100644
--- a/modules/xstrtoll-tests
+++ b/modules/xstrtoll-tests
@@ -14,5 +14,5 @@ configure.ac:
 Makefile.am:
 TESTS += test-xstrtoll.sh
 check_PROGRAMS += test-xstrtoll test-xstrtoull
-test_xstrtoll_LDADD = $(LDADD) $(LIBINTL)
-test_xstrtoull_LDADD = $(LDADD) $(LIBINTL)
+test_xstrtoll_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
+test_xstrtoull_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
diff --git a/modules/xstrtoumax-tests b/modules/xstrtoumax-tests
index 83c4d1bcaa..768f577f52 100644
--- a/modules/xstrtoumax-tests
+++ b/modules/xstrtoumax-tests
@@ -10,4 +10,4 @@ configure.ac:
 Makefile.am:
 TESTS += test-xstrtoumax.sh
 check_PROGRAMS += test-xstrtoumax
-test_xstrtoumax_LDADD = $(LDADD) @LIBINTL@
+test_xstrtoumax_LDADD = $(LDADD) $(LIBUNISTRING) @LIBINTL@ $(MBRTOWC_LIB) $(LIBC32CONV)
-- 
2.54.0

Reply via email to