Skip to content

Commit

Permalink
globvar.t: allow duplicate definitions of symbols
Browse files Browse the repository at this point in the history
nm on AIX can list both local and global definitions for the same
variable, which meant the parsing would delete the first instance
from %exported, but then add the second to %unexported, failing the
test.

This didn't fail on AIX 5 because the default nm output didn't
match what the code expected when checking for PL_Yes, and so
the entire test script skipped.

Fixes #21623
  • Loading branch information
tonycoz committed Nov 12, 2023
1 parent e97a5ef commit f96b74e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions t/porting/globvar.t
Expand Up @@ -45,23 +45,29 @@ while (<$fh>) {

close $fh or die "Problem running makedef.pl";

my %unexported;

# AIX can list a symbol as both a local and a global symbol
# so collect all of the symbols *then* process them
my %defined;
foreach my $file (map {$_ . $Config{_o}} qw(globals regcomp)) {
open $fh, '-|', $Config{nm}, "-P", $file
or die "Can't run nm $file";

while (<$fh>) {
next unless /^_?(PL_\S+)${defined}/;
if (delete $exported{$1}) {
note("Seen definition of $1");
next;
}
++$unexported{$1};
$defined{$1} = 1;
}
close $fh or die "Problem running nm $file";
}

my %unexported;
for my $name (sort keys %defined) {
if (delete $exported{$name}) {
note("Seen definition of $name");
next;
}
++$unexported{$name};
}

unless ($Config{d_double_has_inf}) {
$skip{PL_inf}++;
}
Expand Down

0 comments on commit f96b74e

Please sign in to comment.