bug-gnulib
[Top][All Lists]
Advanced

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

Re: locale test failures on illumos


From: Daiki Ueno
Subject: Re: locale test failures on illumos
Date: Tue, 07 Jul 2015 15:46:34 +0900
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Alexander Pyhalov <address@hidden> writes:

> On 01/29/2015 19:53, Pádraig Brady wrote:
>> On 19/01/15 14:01, Pádraig Brady wrote:
>>> On 15/01/15 18:05, Alexander Pyhalov wrote:
>
>>> Does querylocale() exist for __sun ?
>>> Perhaps it's just a matter of adding __sun to the elif define
>>> in gl_locale_name_thread_unsafe() ?
>>
>> It seems this is hitting recently as solaris 12 added uselocale()
>> which triggers this path.  Rich Burridge tells me that the function
>> used on solaris 12 is in fact getlocalename_l(), which
>> may work for Illumos also?
>
> Hi, sorry for long silence (was on vacation for some time).
> Illumos currently doesn't provid getlocalename_l() function (and as I
> know any similar function).

That is unfortunate.  In that case, shouldn't we avoid referring to the
missing symbol?  This wouldn't fix the test failure, but IMO it would be
better not to break builds:
https://lists.gnu.org/archive/html/bug-libunistring/2015-07/msg00007.html

Patch attached (not tested at all).

Regards,
-- 
Daiki Ueno
>From c8a9319afb98cdc4415b07779c1be8508445f2ec Mon Sep 17 00:00:00 2001
From: Daiki Ueno <address@hidden>
Date: Tue, 7 Jul 2015 15:36:43 +0900
Subject: [PATCH] localename: fix link error on Illumos

Illumos defines __sun, but does not have getlocalename_l nor the
equivalent.
* m4/localename.m4 (gl_LOCALENAME): Check if getlocalename_l is
available, as well as uselocale.
* lib/localename.c [HAVE_USELOCALE && __sun]: Don't fallback to
use getlocalename_l if it is not available.
---
 ChangeLog        | 10 ++++++++++
 lib/localename.c |  4 ++--
 m4/localename.m4 |  5 +++++
 3 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e8fd9ed..fbd2ac1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2015-07-07  Daiki Ueno  <address@hidden>
 
+       localename: fix link error on Illumos
+       Illumos defines __sun, but does not have getlocalename_l nor the
+       equivalent.
+       * m4/localename.m4 (gl_LOCALENAME): Check if getlocalename_l is
+       available, as well as uselocale.
+       * lib/localename.c [HAVE_USELOCALE && __sun]: Don't fallback to
+       use getlocalename_l if it is not available.
+
+2015-07-07  Daiki Ueno  <address@hidden>
+
        unistr/uN-strtok-tests: avoid a trivial leak
        * tests/unistr/test-u-strtok.h (test_u_strtok): Untabify.  Free
        input and delim after the multibyte delimiter tests.
diff --git a/lib/localename.c b/lib/localename.c
index f3733eb..f8cf3f2 100644
--- a/lib/localename.c
+++ b/lib/localename.c
@@ -42,7 +42,7 @@
 # if !defined IN_LIBINTL
 #  include "glthread/lock.h"
 # endif
-# if defined __sun
+# if defined __sun && HAVE_GETLOCALENAME_L
 /* Solaris >= 12.  */
 extern char * getlocalename_l(int, locale_t);
 # endif
@@ -2727,7 +2727,7 @@ gl_locale_name_thread_unsafe (int category, const char 
*categoryname)
             return "";
           }
         return querylocale (mask, thread_locale);
-#  elif defined __sun
+#  elif defined __sun && HAVE_GETLOCALENAME_L
         /* Solaris >= 12.  */
         return getlocalename_l (category, thread_locale);
 #  elif defined __ANDROID__
diff --git a/m4/localename.m4 b/m4/localename.m4
index ef5dd5f..2bdf31e 100644
--- a/m4/localename.m4
+++ b/m4/localename.m4
@@ -9,4 +9,9 @@ AC_DEFUN([gl_LOCALENAME],
   AC_REQUIRE([gt_LC_MESSAGES])
   AC_REQUIRE([gt_INTL_MACOSX])
   AC_CHECK_FUNCS([setlocale uselocale])
+  dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have
+  dnl it nor the equivalent.
+  if test $ac_cv_func_uselocale = yes; then
+    AC_CHECK_FUNCS([getlocalename_l])
+  fi
 ])
-- 
2.4.3


reply via email to

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