This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
libperl.t: Allow tetss to pass if perl was compiled with -fno-common
authorBrian Fraser <fraserbn@gmail.com>
Sun, 29 Jun 2014 13:16:45 +0000 (15:16 +0200)
committerBrian Fraser <fraserbn@gmail.com>
Sun, 29 Jun 2014 13:54:08 +0000 (15:54 +0200)
If Perl was compiled with -fno-common, there will be no common
section in nm's output; the symbols we're looking for will be
under bss ('unknown').

t/porting/libperl.t

index 6c4a4c5..5a23bac 100644 (file)
@@ -312,6 +312,12 @@ if ($GSP) {
 } else {
     print "# neither -DPERL_GLOBAL_STRUCT nor -DPERL_GLOBAL_STRUCT_PRIVATE\n";
 
+    if ( !$symbols{data}{common} ) {
+        # This is likely because Perl was compiled with 
+        # -Accflags="-fno-common"
+        $symbols{data}{common} = $symbols{data}{bss};
+    }
+    
     ok($symbols{data}{common}{PL_hash_seed}{'globals.o'}, "has PL_hash_seed");
     ok($symbols{data}{data}{PL_ppaddr}{'globals.o'}, "has PL_ppaddr");