diff mbox series

gettext: Use shared libunistring on musl

Message ID 20261125232959.3962552-1-khem.raj@oss.qualcomm.com
State Under Review
Headers show
Series gettext: Use shared libunistring on musl | expand

Commit Message

Khem Raj Nov. 25, 2026, 11:29 p.m. UTC
libgettextpo is built with -DOMIT_SETLOCALE_LOCK=1 and relies on a
dependency library to provide gl_get_setlocale_null_lock: GNU libintl or
a shared libunistring. On musl there is no GNU libintl, and the bundled
libunistring copy does not export it, so libgettextpo.so was left with an
undefined symbol.

Instead of patching gettext to define its own copy of the lock, which
upstream considers a configuration problem
(https://savannah.gnu.org/bugs/?62659), link against the shared
libunistring on musl, which exports the lock, and drop the patch.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta/recipes-core/gettext/gettext_1.0.bb | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-core/gettext/gettext_1.0.bb b/meta/recipes-core/gettext/gettext_1.0.bb
index 8a93ce1b49..4bfcee20ee 100644
--- a/meta/recipes-core/gettext/gettext_1.0.bb
+++ b/meta/recipes-core/gettext/gettext_1.0.bb
@@ -61,6 +61,8 @@  EXTRA_OECONF:append:libc-musl = "\
 PACKAGECONFIG ??= "glib libxml ${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
 PACKAGECONFIG:class-native = ""
 PACKAGECONFIG:class-nativesdk = ""
+# musl has no GNU libintl, so libgettextpo needs gl_get_setlocale_null_lock from shared libunistring
+PACKAGECONFIG:append:libc-musl = " libunistring"
 
 PACKAGECONFIG[glib] = "--without-included-glib,--with-included-glib,glib-2.0"
 PACKAGECONFIG[libxml] = "--without-included-libxml,--with-included-libxml,libxml2"