Hi,

A failure to link with libintl.a statically has been reported on the crosstool-ng list:
https://github.com/crosstool-ng/crosstool-ng/issues/597

The reason is again, multiple definitions of several symbols. libintl was configured with:
        --enable-static
        --disable-shared
        --disable-java
        --disable-native-java
        --disable-csharp
        --without-emacs
        --disable-openmp
        --with-included-libxml
        --with-included-gettext
        --with-included-glib
        --with-included-libcroco
        --with-included-libunistring
        --with-libncurses-prefix=/..../
        --with-libiconv-prefix=/..../
        --without-libpth-prefix

Patch attached.

Regards,
Alexey.

>From d9b53af8a467d3ac1d8bdbf45e828127d416aa98 Mon Sep 17 00:00:00 2001
From: Alexey Neyman <sti...@att.net>
Date: Mon, 13 Feb 2017 13:42:44 -0800
Subject: [PATCH] Internalize more function/variable names

... to avoid the conflict with glibc during a static link.

Signed-off-by: Alexey Neyman <sti...@att.net>
---
 gettext-runtime/intl/gettextP.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gettext-runtime/intl/gettextP.h b/gettext-runtime/intl/gettextP.h
index 52be2fc..a94c7e5 100644
--- a/gettext-runtime/intl/gettextP.h
+++ b/gettext-runtime/intl/gettextP.h
@@ -256,6 +256,15 @@ extern const char *_nl_locale_name_default (void);
 				       const char *categoryname); */
 #endif
 
+/* The internal functions/variables in the standalone libintl.a must have
+   different names than the internal functions/variables in GNU libc,
+   otherwise programs using libintl.a cannot be linked statically.  */
+#if !defined _LIBC
+# define _nl_find_domain libintl_nl_find_domain
+# define _nl_load_domain libintl_nl_load_domain
+# define _nl_find_msg libintl_nl_find_msg
+# define _nl_state_lock libintl_nl_state_lock
+#endif
 struct loaded_l10nfile *_nl_find_domain (const char *__dirname, char *__locale,
 					 const char *__domainname,
 					 struct binding *__domainbinding)
-- 
2.9.3

Reply via email to