diff options
author | Nicolas R <atoomic@cpan.org> | 2019-10-11 15:38:53 -0600 |
---|---|---|
committer | Steve Hay <steve.m.hay@googlemail.com> | 2020-03-09 17:17:58 +0000 |
commit | 5093e0eb37ed945960a3b3184f234d51a3cf226a (patch) | |
tree | 35b420f34645911c24749008663f05114fb15706 | |
parent | e7a090b050f1e68c0155f62c075b0a559210fa29 (diff) | |
download | perl-5093e0eb37ed945960a3b3184f234d51a3cf226a.tar.gz |
Fix libperl.t 'no symbols' warning on darwin
darwin can compile perlapi.o without any symbols.
libperl.t is running 'mm -m ./libperl.a' and is
is viewing the 'no symbols' stderr output from perlapi.o
then fail.
'nm -g perlapi.o'
We can either add a dummy symbol to libperl via
regen/embed.pl or simply ignore that error in a generic way,
or avoid compiling that file when not needed.
Notice the error with nm 11.0.0
Apple LLVM version 11.0.0 (clang-1100.0.33.8)
The older version of nm does not raise a warning for empty .o
files.
Steps to reproduce:
echo '' > test.c; gcc -o test.o -c test.c; nm -g test.o
(cherry picked from commit d74b131b0ba952f0c894f2462279e1dc12f94d82)
-rw-r--r-- | t/porting/libperl.t | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/t/porting/libperl.t b/t/porting/libperl.t index f5fb53d2c3..72b4220c6a 100644 --- a/t/porting/libperl.t +++ b/t/porting/libperl.t @@ -581,9 +581,11 @@ if (defined $nm_err_tmp) { while (<$nm_err_fh>) { # OS X has weird error where nm warns about # "no name list" but then outputs fine. - if (/nm: no name list/ && $^O eq 'darwin') { - print "# $^O ignoring $nm output: $_"; - next; + if ( $^O eq 'darwin' ) { + if (/nm: no name list/ || /^no symbols$/ ) { + print "# $^O ignoring $nm output: $_"; + next; + } } warn "$0: Unexpected $nm error: $_"; $error++; |