This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix locale.c under -DPERL_GLOBAL_STRUCT(_PRIVATE)
authorDavid Mitchell <davem@iabyn.com>
Wed, 25 May 2016 18:15:27 +0000 (19:15 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 25 May 2016 21:57:09 +0000 (22:57 +0100)
With that build option initialised statics aren't allowed (no BSS).
So just disable using $ENV{PERL_DEBUG_LOCALE_INIT} under
-DPERL_GLOBAL_STRUCT.

locale.c

index 67843d2..141def9 100644 (file)
--- a/locale.c
+++ b/locale.c
  * initialization.  This is done before option parsing, and before any thread
  * creation, so can be a file-level static */
 #ifdef DEBUGGING
+# ifdef PERL_GLOBAL_STRUCT
+  /* no global syms allowed */
+#  define debug_initialization 0
+#  define DEBUG_INITIALIZATION_set(v)
+# else
 static bool debug_initialization = FALSE;
+#  define DEBUG_INITIALIZATION_set(v) (debug_initialization = v)
+# endif
 #endif
 
 #ifdef USE_LOCALE
@@ -947,9 +954,9 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
 #endif
 
 #ifdef DEBUGGING
-    debug_initialization = (PerlEnv_getenv("PERL_DEBUG_LOCALE_INIT"))
+    DEBUG_INITIALIZATION_set((PerlEnv_getenv("PERL_DEBUG_LOCALE_INIT"))
                            ? TRUE
-                           : FALSE;
+                           : FALSE);
 #   define DEBUG_LOCALE_INIT(category, locale, result)                      \
        STMT_START {                                                        \
                if (debug_initialization) {                                 \
@@ -1405,7 +1412,7 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
 
 #ifdef DEBUGGING
     /* So won't continue to output stuff */
-    debug_initialization = FALSE;
+    DEBUG_INITIALIZATION_set(FALSE);
 #endif
 
     return ok;