On 18/09/2025 15:17, Pádraig Brady wrote:
On 15/07/2025 10:15, Bruno Haible via Gnulib discussion list wrote:
The module 'getlocalename_l-unsafe-limited' was supposed to be used only on
NetBSD and Solaris, because that's what strftime.c needed, so far.
With this patch, it can also be used on glibc, musl, macOS, FreeBSD, Haiku,
Cygwin, native Windows. The added dependencies are not large.
And similarly for the 'localename-unsafe-limited' module.
The added dependencies here: localename-environ, strdup, windows-mutex.
That's not a lot; especially not generic multithreading.
2025-07-15 Bruno Haible <[email protected]>
localename-unsafe-limited: Extend to more platforms.
* modules/localename-unsafe-limited (Description): Update platforms
list.
(Files): Add m4/intlmacosx.m4, m4/musl.m4.
(Depends-on): Add localename-environ, strdup, windows-mutex.
(configure.ac): Invoke gl_MUSL_LIBC.
(Link): Add $(INTL_MACOSX_LIBS).
* m4/localename.m4 (gl_LOCALENAME_UNSAFE): Don't require
gl_LOCALE_H_DEFAULTS.
(gl_LOCALENAME_UNSAFE_LIMITED): Require gt_INTL_MACOSX.
I think this may have triggered a build failure on
MacOSX 12.6 (cfarm112.cfarm.net), as I'm getting the following building
https://www.pixelbeat.org/cu/coreutils-9.7.321-dc30e.tar.xz
Undefined symbols for architecture arm64:
"_CFGetTypeID", referenced from:
_gl_locale_name_default in
libcoreutils.a(libcoreutils_a-localename-unsafe.o)
I see that INTL_MACOS_LIBS is set appropriately as
$ grep HAVE_CF lib/config.h
#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1
#define HAVE_CFPREFERENCESCOPYAPPVALUE 1
So I'm guessing those LIBS might not be added there is no libintl.h and:
configure:96915: checking whether to use NLS
configure:96917: result: no
Note it works to explicitly link @INTL_MACOS_LIBS@ in coreutils with:
diff --git a/src/local.mk b/src/local.mk
LDADD = src/libver.a lib/libcoreutils.a $(LIBINTL) $(MBRTOWC_LIB) \
- lib/libcoreutils.a
+ @INTL_MACOSX_LIBS@ lib/libcoreutils.a
I was unsure about that though as localename already
had the same @INTL_MACOSX_LIBS@ link requirements,
though I now see coreutils didn't actually use localename,
and now pulls localename-unsafe transitively through nstrftime.
I'll apply the attached to coreutils in a while.
cheers,
Padraig
From 4bb002172d4e617e1ef4aa2db3634956bff2065c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Thu, 18 Sep 2025 15:34:23 +0100
Subject: [PATCH] build: fix build failure on macOS
* src/local.mk: Explicitly depend on INTL_MACOS_LIBS
which may be not implicitly referenced without gettext.
---
src/local.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/local.mk b/src/local.mk
index a2985140f..bb5c0d250 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -100,7 +100,7 @@ remove_ldadd =
# replacement functions defined in libcoreutils.a.
# Similarly for $(MBRTOWC_LIB).
LDADD = src/libver.a lib/libcoreutils.a $(LIBINTL) $(MBRTOWC_LIB) \
- lib/libcoreutils.a
+ @INTL_MACOSX_LIBS@ lib/libcoreutils.a
# First, list all programs, to make listing per-program libraries easier.
# See [ below.
--
2.50.1