develooper Front page | perl.perl5.porters | Postings from April 2007

Re: long symbol names in mro.c

Thread Previous | Thread Next
John E. Malmberg
April 21, 2007 19:32
Re: long symbol names in mro.c
Message ID:
Craig A. Berry wrote:
> The new mro.c file in blead currently causes the following compilation 
> grief on VMS:
> XS(XS_mro_get_global_sub_generation);
> ^
> %CC-W-LONGEXTERN, The external identifier name exceeds 31 characters; 
> at line number 694 in file D0:[CRAIG.perl]mro.c;1
> XS(XS_mro_invalidate_all_method_caches);
> ^
> %CC-W-LONGEXTERN, The external identifier name exceeds 31 characters; 
> at line number 695 in file D0:[CRAIG.perl]mro.c;1
> Normally XS symbols are shortened by a VMS-only name mangler when
> processed by xsubpp, but here we are bypassing that process.  By far
> the easiest thing to do would be to simply shorten them manually as
> in the attached patch, but will that break anything that's already
> out there?  I don't see anything in the core that calls these from C.

It may be time to teach the dynamic loader routine to understand the 
name mangler that has long been built into DEC/HP C compilers.  That 
would make another VMSism invisible to most of Perl when the C complier 
is set to automatically CRC shorten names.

After this is done, I do no know if backwards binary compatibility is 

The DEC/HP C name mangling algorithm has been published on comp.os.vms 
by someone in the compiler group.

I have found that for building most open source projects on VMS, I need 
to use /NAMES=(AS-IS,SHORTENED) which preserves case, and uses a CRC 
algorithm to generate unique shortened names.

The generic algorithm would require that the routine that calls 
LIB$FIND_IMAGE_SYMBOL to first try to find the symbol as-is, and then in 
uppercase if less than 31 characters.  If over 31 characters, try first 
exact case CRC shortened, and then uppercase CRC shortened.

The CRC shortening works on VAX/ALPHA/I64.

If someone resurrects GCC on VMS, something probably needs to be done there.

I requested an that the dlsym() routine in the CRTL be updated to handle 
names mangled by the C compiler, and for a LIB$ routine to assist 
programmers.  I do not know if or when those enhancements will show up.

Personal Opinion Only

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About