From: Craig A. Berry Date: Thu, 4 Nov 2010 12:36:52 +0000 (-0500) Subject: Exclude more exported but non-existent functions. X-Git-Tag: v5.13.7~248 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/713ca5fadd44860c83993b586ad6ee925fb00c2d Exclude more exported but non-existent functions. pp_reach, pp_rvalues, and pp_transr are aliases, but regen/opcode.pl generates declarations for aliases as if they were C functions in their own right. This is necessary for aliases that refer to mathoms (as most of them do) but seems less right for new entries that will never refer to an actual function of the same name. For now, these need to be explicitly excluded when building the linker options file on VMS. Failure to do so breaks the build with undefined symbol warnings. --- diff --git a/vms/gen_shrfls.pl b/vms/gen_shrfls.pl index 15e6418..8576827 100644 --- a/vms/gen_shrfls.pl +++ b/vms/gen_shrfls.pl @@ -136,6 +136,22 @@ print "\$rtlopt: \\$rtlopt\\\n" if $debug; my (%vars, %cvars, %fcns); +# These are symbols that we should not export. They may merely +# look like exportable symbols but aren't, or they may be declared +# as exportable symbols but there is no function implementing them +# (possibly due to an alias). + +my %symbols_to_exclude = ( + '__attribute__format__' => 1, + 'main' => 1, + 'Perl_pp_avalues' => 1, + 'Perl_pp_reach' => 1, + 'Perl_pp_rvalues' => 1, + 'Perl_pp_say' => 1, + 'Perl_pp_transr' => 1, + 'sizeof' => 1, +); + sub scan_var { my($line) = @_; my($const) = $line =~ /^EXTCONST/; @@ -163,9 +179,8 @@ sub scan_func { $line =~ s/\b(IV|Off_t|Size_t|SSize_t|void|int)\b//i; if ( $line =~ /(\w+)\s*\(/ ) { print "\troutine name is \\$1\\\n" if $debug > 1; - if ($1 eq 'main' || $1 eq 'perl_init_ext' || $1 eq '__attribute__format__' - || $1 eq 'sizeof' || (($1 eq 'Perl_stashpv_hvname_match') && ! $use_threads) - || $1 eq 'Perl_pp_avalues' || $1 eq 'Perl_pp_say') { + if (exists($symbols_to_exclude{$1}) + || ($1 eq 'Perl_stashpv_hvname_match' && ! $use_threads)) { print "\tskipped\n" if $debug > 1; } else { $fcns{$1}++ }