mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Daiki Ueno <ueno-mXXj517/zsQ@public.gmane.org>
To: Masanori Ogino <masanori.ogino-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: bug-gnu-gettext-mXXj517/zsQ@public.gmane.org,
	musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org
Subject: Re: [musl] Re: AM_GNU_GETTEXT without referring internal symbols?
Date: Thu, 26 May 2016 15:09:56 +0900	[thread overview]
Message-ID: <m31t4pe4ej.fsf-ueno@gnu.org> (raw)
In-Reply-To: <CAA-4+jfbUEi1bBBP7iT2_9zaxyR+XvRb00yrWsoFj7iWiN3uUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (Masanori Ogino's message of "Thu, 7 Apr 2016 14:34:01 +0900")

[-- Attachment #1: Type: text/plain, Size: 1494 bytes --]

Hello,

Masanori Ogino <masanori.ogino-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> 2016-04-07 11:26 GMT+09:00 Daiki Ueno <ueno-mXXj517/zsQ@public.gmane.org>:
>> Masanori Ogino <masanori.ogino-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-m4-Rely-less-on-internal-symbols.patch --]
[-- Type: text/x-patch, Size: 3400 bytes --]

From 77a71921d4925db2abc53a4610e89799e19fb113 Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno-mXXj517/zsQ@public.gmane.org>
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 <libintl.h>
-$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 <libintl.h>
-$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 <libintl.h>
-$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


  parent reply	other threads:[~2016-05-26  6:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01 12:56 Masanori Ogino
     [not found] ` <CAA-4+jeUF8c+Kmv0UQi0akMAtc2hmi3pC_8=nBNcsfuRcjSgNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-04  2:23   ` Daiki Ueno
     [not found]     ` <m3h9fit8lg.fsf-ueno-mXXj517/zsQ@public.gmane.org>
2016-04-04  4:23       ` Masanori Ogino
     [not found]         ` <CAA-4+jcpfOXoYx1g_48M0B7punK7r2AOU7YU-V_pdQNGYcFmng-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-07  2:26           ` [musl] " Daiki Ueno
2016-04-07  5:34             ` Re: [bug-gettext] " Masanori Ogino
     [not found]               ` <CAA-4+jfbUEi1bBBP7iT2_9zaxyR+XvRb00yrWsoFj7iWiN3uUw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-04-07  5:36                 ` [musl] " Masanori Ogino
2016-05-26  6:09                 ` Daiki Ueno [this message]
2016-05-26 12:53                   ` Re: [bug-gettext] " Masanori Ogino
2016-05-26 19:36                     ` Rich Felker
     [not found]                       ` <20160526193658.GA21636-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2016-05-27  8:48                         ` [musl] " Daiki Ueno
2016-04-07  6:26               ` Re: [bug-gettext] " Rich Felker
2016-04-07  7:12                 ` Masanori Ogino
2016-04-07 10:57                   ` Szabolcs Nagy
2016-04-07 13:53                     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m31t4pe4ej.fsf-ueno@gnu.org \
    --to=ueno-mxxj517/zsq@public.gmane.org \
    --cc=bug-gnu-gettext-mXXj517/zsQ@public.gmane.org \
    --cc=masanori.ogino-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).