[patch] AIX 7.1 has uselocale but lacks strtod_l

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
haubi
Posts: 1
Joined: 2015-04-14T07:28:57-07:00
Authentication code: 6789

[patch] AIX 7.1 has uselocale but lacks strtod_l

Post by haubi »

Hi,

on AIX 7.1 I'm encountering this linker error with ImageMagick-6.8.8:

Code: Select all

ld: 0711-317 ERROR: Undefined symbol: .AcquireCLocale
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
Makefile:6457: recipe for target 'magick/libMagickCore-6.Q16.la' failed
make[3]: *** [magick/libMagickCore-6.Q16.la] Error 1
Problem is that AcquireCLocale() is defined upon available strtod_l only, but used upon available strtod_l, vfprintf_l, vsnprintf_l and uselocale. Although there is changeset 16685 since ImageMagick-6.9.0, I fail to find a reason to not use AcquireCLocale() when there is uselocale() but no strtod_l().

So I'm proposing this patch for current trunk, including the reversion of r16685:

Code: Select all

Index: MagickCore/locale.c
===================================================================
--- MagickCore/locale.c (revision 18390)
+++ MagickCore/locale.c (working copy)
@@ -97,7 +97,7 @@
 static SplayTreeInfo
   *locale_cache = (SplayTreeInfo *) NULL;
 
-#if defined(MAGICKCORE_HAVE_STRTOD_L)
+#if defined(MAGICKCORE_HAVE_STRTOD_L) || defined(MAGICKCORE_HAVE_USELOCALE)
 static volatile locale_t
   c_locale = (locale_t) NULL;
 #endif
@@ -110,7 +110,7 @@
   LoadLocaleCache(SplayTreeInfo *,const char *,const char *,const char *,
     const size_t,ExceptionInfo *);
 
-#if defined(MAGICKCORE_HAVE_STRTOD_L)
+#if defined(MAGICKCORE_HAVE_STRTOD_L) || defined(MAGICKCORE_HAVE_USELOCALE)
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -240,7 +240,7 @@
   return(locale_cache);
 }
 
-#if defined(MAGICKCORE_HAVE_STRTOD_L)
+#if defined(MAGICKCORE_HAVE_STRTOD_L) || defined(MAGICKCORE_HAVE_USELOCALE)
 /*
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 %                                                                             %
@@ -358,7 +358,7 @@
 #endif
   }
 #else
-#if defined(MAGICKCORE_HAVE_USELOCALE) && defined(MAGICKCORE_HAVE_STRTOD_L)
+#if defined(MAGICKCORE_HAVE_USELOCALE)
   {
     locale_t
       locale,
@@ -449,7 +449,7 @@
 #endif
   }
 #elif defined(MAGICKCORE_HAVE_VSNPRINTF)
-#if defined(MAGICKCORE_HAVE_USELOCALE) && defined(MAGICKCORE_HAVE_STRTOD_L)
+#if defined(MAGICKCORE_HAVE_USELOCALE)
   {
     locale_t
       locale,
@@ -1429,7 +1429,7 @@
   LockSemaphoreInfo(locale_semaphore);
   if (locale_cache != (SplayTreeInfo *) NULL)
     locale_cache=DestroySplayTree(locale_cache);
-#if defined(MAGICKCORE_HAVE_STRTOD_L)
+#if defined(MAGICKCORE_HAVE_STRTOD_L) || defined(MAGICKCORE_HAVE_USELOCALE)
   DestroyCLocale();
 #endif
   UnlockSemaphoreInfo(locale_semaphore);
Thanks!
/haubi/
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: [patch] AIX 7.1 has uselocale but lacks strtod_l

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.9.1-2 Beta, available by sometime tomorrow. Thanks.
Post Reply