From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9842 Path: news.gmane.org!not-for-mail From: Masanori Ogino Newsgroups: gmane.comp.gnu.gettext.bugs,gmane.linux.lib.musl.general Subject: Re: AM_GNU_GETTEXT without referring internal symbols? Date: Mon, 4 Apr 2016 13:23:41 +0900 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1459743846 3457 80.91.229.3 (4 Apr 2016 04:24:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Apr 2016 04:24:06 +0000 (UTC) Cc: musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org, bug-gnu-gettext-mXXj517/zsQ@public.gmane.org To: Daiki Ueno Original-X-From: bug-gettext-bounces+gcggb-bug-gettext=m.gmane.org-mXXj517/zsQ@public.gmane.org Mon Apr 04 06:23:57 2016 Return-path: Envelope-to: gcggb-bug-gettext@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1amw3P-0003LE-Vk for gcggb-bug-gettext@m.gmane.org; Mon, 04 Apr 2016 06:23:56 +0200 Original-Received: from localhost ([::1]:56471 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amw3P-0006Hc-3T for gcggb-bug-gettext@m.gmane.org; Mon, 04 Apr 2016 00:23:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amw3L-0006HX-CO for bug-gettext-mXXj517/zsQ@public.gmane.org; Mon, 04 Apr 2016 00:23:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amw3K-0006bA-9s for bug-gettext-mXXj517/zsQ@public.gmane.org; Mon, 04 Apr 2016 00:23:51 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amw3K-0006b1-6o; Mon, 04 Apr 2016 00:23:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44760) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1amw3J-00072i-OE for bug-gnu-gettext-mXXj517/zsQ@public.gmane.org; Mon, 04 Apr 2016 00:23:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amw3E-0006aW-Ex for bug-gnu-gettext-mXXj517/zsQ@public.gmane.org; Mon, 04 Apr 2016 00:23:49 -0400 Original-Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:34448) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amw3C-0006aJ-FW; Mon, 04 Apr 2016 00:23:42 -0400 Original-Received: by mail-oi0-x230.google.com with SMTP id s79so52636231oie.1; Sun, 03 Apr 2016 21:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=LkMIrb9H9FCXItyAeZtpz/r4ttD7bcyYivFgKSo1qJM=; b=tF7cJtmQFMhpoSIRu7zDbypygtwGhETCt4V7+Bi+CfCKWOBmIY+K5785PQaUX8Xbdn sGxBaZbMGVauMZbAVEgfs34U7//YGni/KERDGWf6itzspDHTT89d134C/h3PLm7GcCQ/ Gh6073wV2jzJDSD+2aEl4Yo0W3Sm8zfjhjZfNmk4L6b0YJlkiz/EoXmwv9Cl3yunU6JK ySQFDJ+shsJ/7DGNbYuF9/uFEA8AfS/YSFWs8PZanxA+ga/j+8RW2AW7EjhPalHIbOFb tQoHw9xWemwGYCABnburlMa+m1p4EmAbAg39bcuBP8XKH9onG1N+/U972eZ8AALnG2Ow dWqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=LkMIrb9H9FCXItyAeZtpz/r4ttD7bcyYivFgKSo1qJM=; b=MwYq/R/OIqPXaWhyBXQ1Mk8P02bCokaiBIkXdSxj9hE9gKI2PqZkiANJWEz1H0vZgB gIUT5zc7TTuJMukfAcGgMviyCgby7AoInbWVUwJboB2cOZZG7URaU1lnWVTgekjzFV8R 1g4g1wz24rXhe2cVMJPX6m41IwZjDoUDuqIj7e67bdu94C+Zsvoa4hLutob70qAAe87H Q8NlNmuy89tPefFgEcZNac1m2m80/0qb8Ss6TK7IvuRwvC92/CjviUl+75A4sNHaLqXn aKdbe+9JoYiur866B0g9jJ2CdSyowOhYIdvI6DWssUIMTg8hqjT2sOQVzltkVDZTDpCu 3aQg== X-Gm-Message-State: AD7BkJITLIdnptLYQzQdxsSB+4fZ5xPFNvtNHTSR7X8D89/DQDXLPr+h8DeeweS2bw2jkPlrAfvtQt49wS3Ofg== X-Received: by 10.202.75.194 with SMTP id y185mr5006516oia.100.1459743821469; Sun, 03 Apr 2016 21:23:41 -0700 (PDT) Original-Received: by 10.157.61.227 with HTTP; Sun, 3 Apr 2016 21:23:41 -0700 (PDT) In-Reply-To: X-Google-Sender-Auth: kE5Efb4XtorcV8ASgF4LnWO-Ic4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: bug-gettext-mXXj517/zsQ@public.gmane.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for GNU gettext List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gettext-bounces+gcggb-bug-gettext=m.gmane.org-mXXj517/zsQ@public.gmane.org Original-Sender: bug-gettext-bounces+gcggb-bug-gettext=m.gmane.org-mXXj517/zsQ@public.gmane.org Xref: news.gmane.org gmane.comp.gnu.gettext.bugs:1173 gmane.linux.lib.musl.general:9842 Archived-At: Thank you for your reply, Daiki. 2016-04-04 11:23 GMT+09:00 Daiki Ueno : > Hello, > > Masanori Ogino 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