[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gettext] AM_GNU_GETTEXT without referring internal symbols?
From: |
Masanori Ogino |
Subject: |
Re: [bug-gettext] AM_GNU_GETTEXT without referring internal symbols? |
Date: |
Mon, 4 Apr 2016 13:23:41 +0900 |
Thank you for your reply, Daiki.
2016-04-04 11:23 GMT+09:00 Daiki Ueno <address@hidden>:
> Hello,
>
> Masanori Ogino <address@hidden> writes:
>
>> Now AM_GNU_GETTEXT uses _nl_msg_cat_cntr and _nl_expand_alias to check
>> whether the implementation is compatible with GNU gettext. However,
>> the symbols don't appear in libintl.h so it seems that they are not
>> part of the public API.
>>
>> Actually, musl libc implements libintl features and the score of
>> gettext-tools' testsuite is equal to that with the internal libintl,
>> using a modified AM_GNU_GETTEXT.
>>
>> The musl's libintl.h even defines __USE_GNU_GETTEXT and
>> __GNU_GETTEXT_SUPPORTED_REVISION, but it does not imitate private
>> symbols.
>>
>> I had checked the archive and I've found some discussions:
>> https://lists.gnu.org/archive/html/bug-gnu-utils/2006-03/msg00011.html
>> http://lists.gnu.org/archive/html/bug-gettext/2015-11/msg00015.html
>>
>> So, if the goal of the macro is check if the implementation is
>> compatible with GNU gettext, why don't we check the public API rather
>> than using internal symbols? Is it possible to check if the
>> implementation is not one of known "broken" implementations and/or it
>> is really compatible?
>
> I agree that it would be desirable, but doubt that it is possible (at
> least reliably), because:
>
> - For some reason, there is no public API to directly load arbitrary MO
> files and we need to mimic the behavior of translated applications:
> prepare a directory structure (e.g. DIR/fr/domain.mo), call
> bindtextdomain() for the directory, and finally call gettext().
>
> - That requires that at least one non-POSIX locale is available on the
> system, to pick the translation. However, even if the system is glibc
> based, not all locales might be available thanks to sub-packaging
> (Fedora) or user configuration (Debian).
OK, I understood now.
> So I suppose the only feasible option here is to somehow whitelist the
> implementations by checking macros or symbols. Does musl provides
> anything like that[1]?
No, it doesn't on purpose. Here is the entry on this topic in the FAQ:
http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_there_no_MUSL_macro_.3F
Also, I'd like to point out some detailed explanations in a recent discussion:
http://www.openwall.com/lists/musl/2016/03/23/6
http://www.openwall.com/lists/musl/2016/03/23/7
http://www.openwall.com/lists/musl/2016/03/23/9
That is why I proposed to have a blacklist of "broken" implementations
as an option.
AFAIK there have already been some blacklisting in autotools e.g.
checking the version of glibc to reject specific broken implementation
of a function. Thus, I think it's acceptable to use a blacklist. What
do you think about it?
--
Masanori Ogino
- [bug-gettext] AM_GNU_GETTEXT without referring internal symbols?, Masanori Ogino, 2016/04/01
- Re: [bug-gettext] AM_GNU_GETTEXT without referring internal symbols?, Daiki Ueno, 2016/04/03
- Re: [bug-gettext] AM_GNU_GETTEXT without referring internal symbols?,
Masanori Ogino <=
- Re: [bug-gettext] [musl] Re: AM_GNU_GETTEXT without referring internal symbols?, Daiki Ueno, 2016/04/06
- Re: [bug-gettext] [musl] Re: AM_GNU_GETTEXT without referring internal symbols?, Masanori Ogino, 2016/04/07
- Re: [bug-gettext] [musl] Re: AM_GNU_GETTEXT without referring internal symbols?, Masanori Ogino, 2016/04/07
- Re: [bug-gettext] [musl] Re: AM_GNU_GETTEXT without referring internal symbols?, Rich Felker, 2016/04/07
- Re: [bug-gettext] [musl] Re: AM_GNU_GETTEXT without referring internal symbols?, Masanori Ogino, 2016/04/07
- Re: [bug-gettext] [musl] Re: AM_GNU_GETTEXT without referring internal symbols?, Szabolcs Nagy, 2016/04/07
- Re: [bug-gettext] [musl] Re: AM_GNU_GETTEXT without referring internal symbols?, Rich Felker, 2016/04/07