[Bug libstdc++/56779] [4.8/4.9 Regression] libstdc++.so: undefined reference to `libintl_textdomain'

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 20 18:19:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56779

--- Comment #12 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks, Daniel. I'm still trying to understand what's happening here so I can
reproduce it.

libintl_textdomain is the GNU gettext implementation of the textdomain(3)
function. On my Fedora systems textdomain(3) is provided by glibc, not GNU
gettext, so it defines the symbol textdomain not libintl_textdomain.

The GNU clocale model unconditionally includes <libintl.h> in
<bits/messages_members.h> and uses textdomain, and assumes it comes from glibc:


      # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
      AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
      if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
    USE_NLS=yes
      fi

When using --disable-nls the configure script does not check whether -lintl is
needed for gettext:

  # A standalone libintl (e.g., GNU libintl) may be in use.
  if test $USE_NLS = yes; then
    AC_CHECK_HEADERS([libintl.h], [], USE_NLS=no)
    AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
  fi

So I need to know which GNU/Linux distro you are using, and why it does not
provide textdomain in glibc.


1) Which GNU/Linux distro are you using?

2) Does your libintl.h come from glibc or gettext? 

3) What does this command print?

   g++ -E -x c++ - <<< '#include <libintl.h>' | head

4) What does this command print?

   which msgfmt


Here's an untested patch that might help:

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index fcdcd9a..50b0b0e 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -2093,6 +2093,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
       AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
       if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
        USE_NLS=yes
+        AC_SEARCH_LIBS(gettext, intl, [], USE_NLS=no)
       fi
       # Export the build objects.
       for ling in $ALL_LINGUAS; do \



More information about the Gcc-bugs mailing list