bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Avoid multiple symbols from locale_charset


From: Bruno Haible
Subject: Re: [PATCH] Avoid multiple symbols from locale_charset
Date: Thu, 21 Sep 2006 16:32:57 +0200
User-agent: KMail/1.9.1

Jack Howarth wrote:
>           The current gcc trunk uses the intl code from
> gettext which (including the current release) appears to
> generate duplicate symbols for _locale_charset if libiconv
> is present when intl/localecharset.c is compiled.

This is only true when you use gcc versions older than 4.0 to compile
libiconv. With a gcc >= 4.0, the only symbols exported are these:

$ nm libiconv.so.2 | grep ' T '
00000000000143a8 T _fini
00000000000133a0 T iconv_canonicalize
0000000000002230 T _init
000000000000ab10 T libiconv
0000000000012bb0 T libiconv_close
000000000000ae90 T libiconvctl
000000000000ab50 T libiconvlist
0000000000013610 T libiconv_open
0000000000014060 T libiconv_set_relocation_prefix

> The gcc developers want any changes run pass the gettext
> developers and you appear to be the maintainer of the
> intl code in that package.

Yes, I am.

> The change I have proposed to 
> eliminate the duplicate symbols has been proposed by
> others as well as is shown at...
> 
> http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00434.html
> 
> I would greatly appreciate any comments you could make
> on this patch

The patch is incorrect: It removes the locale_charset function if
an iconv() function is found. However, there are iconv implementations
that don't provide a locale_charset functions (such as the one in glibc,
Solaris, Tru64 or NetBSD 3.0); and with newer libiconvs and newer gccs
locale_charset is not exported from libiconv any more.

It would be possible to include the localcharset.c code in a
  #if HAVE_ICONV
  #endif
(since the same #if is also in dcigettext.c) but this is pointless since
  1. most platforms (including Darwin) do have an iconv function nowadays,
  2. the internationalization is pointless without iconv(), because the
     encoding of the message catalog often doesn't match the user's locale
     encoding.

The patch's ChangeLog entry is also incorrect: It talks about libiconv;
if you want to test for libiconv, you need to test for _LIBICONV_VERSION.

Yes I know the duplicate symbols generate a warning on current Darwin
systems, because Darwin is not using ELF. These warnings are harmless;
you can ignore them.

If you really want to get rid of the warning, IMO the way to go is to
rename locale_charset to gcc_locale_charset in all files (at least
dcigettext.c and localcharset.c, maybe more).

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]