From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10052 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.comp.gnu.gettext.bugs,gmane.linux.lib.musl.general Subject: Re: [musl] Re: AM_GNU_GETTEXT without referring internal symbols? Date: Thu, 26 May 2016 15:09:56 +0900 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1464243028 1323 80.91.229.3 (26 May 2016 06:10:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 May 2016 06:10:28 +0000 (UTC) Cc: bug-gnu-gettext-mXXj517/zsQ@public.gmane.org, musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org To: Masanori Ogino Original-X-From: bug-gettext-bounces+gcggb-bug-gettext=m.gmane.org-mXXj517/zsQ@public.gmane.org Thu May 26 08:10:21 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 1b5oUt-0002Ev-9w for gcggb-bug-gettext@m.gmane.org; Thu, 26 May 2016 08:10:19 +0200 Original-Received: from localhost ([::1]:36548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5oUp-0004Kz-3u for gcggb-bug-gettext@m.gmane.org; Thu, 26 May 2016 02:10:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5oUj-0004IJ-Nt for bug-gettext-mXXj517/zsQ@public.gmane.org; Thu, 26 May 2016 02:10:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b5oUf-0007kj-HU for bug-gettext-mXXj517/zsQ@public.gmane.org; Thu, 26 May 2016 02:10:08 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33017) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b5oUf-0007kJ-Dz; Thu, 26 May 2016 02:10:05 -0400 Original-Received: from du-a.org ([219.94.251.20]:38878 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1b5oUd-0002il-Cc; Thu, 26 May 2016 02:10:03 -0400 In-Reply-To: (Masanori Ogino's message of "Thu, 7 Apr 2016 14:34:01 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) 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.21 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" Xref: news.gmane.org gmane.comp.gnu.gettext.bugs:1223 gmane.linux.lib.musl.general:10052 Archived-At: --=-=-= Content-Type: text/plain Hello, Masanori Ogino writes: > 2016-04-07 11:26 GMT+09:00 Daiki Ueno : >> Masanori Ogino writes: >>> 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? >> >> Yes, that sounds like a good idea. But I guess we then need to collect >> information about incompatible implementations. In this regard I'm >> actually not sure if the gettext-tools test coverage can be used as an >> indicator of compatibility. > > Indeed. I was wondering if there is anything could be done in the upcoming gettext release. Let's go back to the original explanation by Bruno: https://lists.gnu.org/archive/html/bug-gnu-utils/2006-03/msg00011.html where he states two things: 1. The purpose of the checks are excluding incompatible implementations, e.g., NetBSD (around 1.5?) and Solaris 7 2. The __GNU_GETTEXT_SUPPORTED_REVISION macro is a recent addition In that case, I guess we could bypass the symbol checks if __GNU_GETTEXT_SUPPORTED_REVISION is defined, as long as broken implementations do not define it. How about the attached patch? Regards, -- Daiki Ueno --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-m4-Rely-less-on-internal-symbols.patch >From 77a71921d4925db2abc53a4610e89799e19fb113 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 26 May 2016 13:38:57 +0900 Subject: [PATCH] m4: Rely less on internal symbols * gettext-runtime/m4/gettext.m4 (AM_GNU_GETTEXT): Skip checks for the internal symbols _nl_msg_cat_cntr, _nl_domain_bindings, and _nl_expand_alias, if __GNU_GETTEXT_SUPPORTED_REVISION is defined. --- gettext-runtime/m4/gettext.m4 | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/gettext-runtime/m4/gettext.m4 b/gettext-runtime/m4/gettext.m4 index 1f6979a..32ff263 100644 --- a/gettext-runtime/m4/gettext.m4 +++ b/gettext-runtime/m4/gettext.m4 @@ -1,4 +1,4 @@ -# gettext.m4 serial 67 (gettext-0.19.6) +# gettext.m4 serial 68 (gettext-0.19.6) dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -161,13 +161,18 @@ changequote([,])dnl [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern int *_nl_domain_bindings; +#define _GT_COMPAT (_nl_msg_cat_cntr + *_nl_domain_bindings) +#else +#define _GT_COMPAT 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings +return * gettext ("")$gt_expression_test_code + _GT_COMPAT ]])], [eval "$gt_func_gnugettext_libc=yes"], [eval "$gt_func_gnugettext_libc=no"])]) @@ -193,17 +198,22 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_b [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define _GT_COMPAT (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define _GT_COMPAT 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + _GT_COMPAT ]])], [eval "$gt_func_gnugettext_libintl=yes"], [eval "$gt_func_gnugettext_libintl=no"]) @@ -214,17 +224,22 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a [AC_LANG_PROGRAM( [[ #include -$gt_revision_test_code +#ifndef __GNU_GETTEXT_SUPPORTED_REVISION extern int _nl_msg_cat_cntr; extern #ifdef __cplusplus "C" #endif const char *_nl_expand_alias (const char *); +#define _GT_COMPAT (_nl_msg_cat_cntr + *_nl_expand_alias ("")) +#else +#define _GT_COMPAT 0 +#endif +$gt_revision_test_code ]], [[ bindtextdomain ("", ""); -return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("") +return * gettext ("")$gt_expression_test_code + _GT_COMPAT ]])], [LIBINTL="$LIBINTL $LIBICONV" LTLIBINTL="$LTLIBINTL $LTLIBICONV" -- 2.5.5 --=-=-=--