diff options
author | Craig A. Berry <craigberry@mac.com> | 2010-10-15 14:38:53 -0500 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2010-10-15 14:38:53 -0500 |
commit | 0729becf1b30da9d73bf0cab31f9e80d8aa8fd26 (patch) | |
tree | eecd1d8699b45d6067b333902784a508d4600568 /vms/gen_shrfls.pl | |
parent | 474af99058f4c0fc3b80d73763da5b29c1ff8c66 (diff) | |
download | perl-0729becf1b30da9d73bf0cab31f9e80d8aa8fd26.tar.gz |
Band-aid to handle long API symbol on VMS.
For the first time we now have a symbol longer than 31 characters
in the API, not just internally or generated in xsubs. That means
we have to provide the shortened name in the linker options file
used to produce the shareable image, but the documentation on the
CRC used to produce the short name is incomplete. For a more
general solution, we may have to root through the demangler
database or parse the output of CC/WARN=ENABLE=NAMESHORTENED.
Diffstat (limited to 'vms/gen_shrfls.pl')
-rw-r--r-- | vms/gen_shrfls.pl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/vms/gen_shrfls.pl b/vms/gen_shrfls.pl index c3210e0287..15e641839e 100644 --- a/vms/gen_shrfls.pl +++ b/vms/gen_shrfls.pl @@ -70,8 +70,8 @@ print "Input \$cc_cmd: \\$cc_cmd\\\n" if $debug; my $docc = ($cc_cmd !~ /^~~/); print "\$docc = $docc\n" if $debug; -my ( $use_threads, $use_mymalloc, $care_about_case, $debugging_enabled, - $hide_mymalloc, $isgcc, $use_perlio, $dir ) +my ( $use_threads, $use_mymalloc, $care_about_case, $shorten_symbols, + $debugging_enabled, $hide_mymalloc, $isgcc, $use_perlio, $dir ) = ( 0, 0, 0, 0, 0, 0, 0, 0 ); if ($docc) { @@ -86,6 +86,7 @@ if ($docc) { $use_threads++ if /usethreads='(define|yes|true|t|y|1)'/i; $use_mymalloc++ if /usemymalloc='(define|yes|true|t|y|1)'/i; $care_about_case++ if /d_vms_case_sensitive_symbols='(define|yes|true|t|y|1)'/i; + $shorten_symbols++ if /d_vms_shorten_long_symbols='(define|yes|true|t|y|1)'/i; $debugging_enabled++ if /usedebugging_perl='(define|yes|true|t|y|1)'/i; $hide_mymalloc++ if /embedmymalloc='(define|yes|true|t|y|1)'/i; $isgcc++ if /gccversion='[^']/; @@ -263,6 +264,25 @@ foreach (split /\s+/, $extnames) { print "Adding boot_$pkgname to \%fcns (for extension $_)\n" if $debug; } +# For symbols over 31 characters, export the shortened name. +# TODO: Make this general purpose so we can predict the shortened name the +# compiler will generate for any symbol over 31 characters in length. The +# docs to CC/NAMES=SHORTENED describe the CRC used to shorten the name, but +# don't describe its use fully enough to actually mimic what the compiler +# does. + +if ($shorten_symbols) { + if (exists $fcns{'Perl_ck_entersub_args_proto_or_list'}) { + delete $fcns{'Perl_ck_entersub_args_proto_or_list'}; + if ($care_about_case) { + $fcns{'Perl_ck_entersub_args_p11c2bjj$'}++; + } + else { + $fcns{'PERL_CK_ENTERSUB_ARGS_P3IAT616$'}++; + } + } +} + # Eventually, we'll check against existing copies here, so we can add new # symbols to an existing options file in an upwardly-compatible manner. |