diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2014-07-19 13:51:38 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2014-07-19 18:37:58 -0400 |
commit | aab7f3d5bce9a546927b8c460d4aeee6c602ae1c (patch) | |
tree | e9d9e0221e6895e2453ea3b7c1be41ab24542cb6 | |
parent | 88abe8fb309278b152681df9445c1ce9cf7189f3 (diff) | |
download | perl-aab7f3d5bce9a546927b8c460d4aeee6c602ae1c.tar.gz |
Add freebsd support.
-rw-r--r-- | t/porting/libperl.t | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/t/porting/libperl.t b/t/porting/libperl.t index d558bd3435..0cec1552d9 100644 --- a/t/porting/libperl.t +++ b/t/porting/libperl.t @@ -3,7 +3,11 @@ # Try opening libperl.a with nm, and verifying it has the kind of # symbols we expect, and no symbols we should avoid. # -# Fail softly, expect things only on known platforms. +# Fail softly, expect things only on known platforms: +# - linux +# - darwin (OS X), both x86 and ppc +# - freebsd +# and on other platforms, and if things seem odd, just give up (skip_all). # # Also, if the rarely-used builds options -DPERL_GLOBAL_STRUCT or # -DPERL_GLOBAL_STRUCT_PRIVATE are used, verify that they did what @@ -85,7 +89,9 @@ if (@ARGV == 1) { if ($fake_input =~ s/\@(.+)$//) { $fake_style = $1; print "# Faking nm style from $fake_style\n"; - if ($fake_style eq 'gnu' || $fake_style eq 'linux') { + if ($fake_style eq 'gnu' || + $fake_style eq 'linux' || + $fake_style eq 'freebsd') { $nm_style = 'gnu' } elsif ($fake_style eq 'darwin' || $fake_style eq 'osx') { $nm_style = 'darwin' @@ -97,6 +103,10 @@ if (@ARGV == 1) { unless (defined $nm_style) { if ($^O eq 'linux') { + # The 'gnu' style could be equally well be called 'bsd' style, + # since the output format of the GNU binutils nm is really BSD. + $nm_style = 'gnu'; + } elsif ($^O eq 'freebsd') { $nm_style = 'gnu'; } elsif ($^O eq 'darwin') { $nm_style = 'darwin'; @@ -419,7 +429,17 @@ my @bad = qw(gets strcpy strcat strncpy strncat sprintf vsprintf); for my $bad (@bad) { my @o = exists $symbols{undef}{$bad} ? sort keys %{ $symbols{undef}{$bad} } : (); - is(@o, 0, "uses no $bad (@o)"); + # While sprintf() is bad in the general case, + # some platforms implement Gconvert via sprintf, in sv.o. + if ($bad eq 'sprintf' && + $Config{d_Gconvert} =~ /^sprintf/ && + @o == 1 && $o[0] eq 'sv.o') { + SKIP: { + skip("uses sprintf for Gconvert in sv.o"); + } + } else { + is(@o, 0, "uses no $bad (@o)"); + } } if (defined $nm_err_tmp) { |