javah output file naming weirdness

Ian Rogers rogers.email at gmail.com
Sun Apr 27 14:28:45 PDT 2008


Alan Bateman wrote:
> Andrew John Hughes wrote:
>> We recently uncovered a bug in the JikesRVM
>> (http://jira.codehaus.org/browse/RVM-456), namely that we were relying
>> on the naming of the header files generated by javah being in the same
>> style as those generated by the proprietary Sun JDK.
>>
>> As can be seen in the bug report, the breakage showed up when using
>> IcedTea6/OpenJDK6 to build JikesRVM.  On OpenJDK6,
>>
>> javah -verbose -d
>> /home/andrew/projects/classpath/jikesrvm/target/prototype_x86_64-linux/c
>> -classpath 
>> /home/andrew/projects/classpath/jikesrvm/target/prototype_x86_64-linux/jksvm.jar 
>>
>> org.jikesrvm.scheduler.greenthreads.VM_Process
>>
>> produces a file named:
>>
>> org_jikesrvm_scheduler_greenthreads_VM_Process.h
>>
>> while apparently the proprietary version emits:
>>
>> org_jikesrvm_scheduler_greenthreads_VM_0005fProcess.h
>>
>> (encoding the classname's underscore character as 0005f).  We fixed
>> our bug by explicitly asking for javah to emit the latter named file,
>> but is this a regression in the OpenJDK6 version of javah?  Even the
>> OpenJDK I was using before (b12) still emitted the 0005f version (at
>> least I presume so, because the build worked...)
>>
>> Any ideas?
>>   
> I'm not involved in this area but I suspect this is related to the 
> re-write of javah in 1.4.2. I just did a quick test with 1.4.2 to 
> check and it emits the header file as VM_0005fProcess.h. Running 
> 1.4.2's javah with an undocumented -Xnew option to select the "new" 
> version causes it to emit VM_Process.h which is what 5.0 and newer 
> also emits (the new version became the default in 5.0).  Is there any 
> possibility you've been building JikesRVM with a 1.4.2 or older 
> release? When you say that the OpenJDK javah was generating the 0005f 
> version then are you sure? Any possibility the build worked because it 
> was picking up a header from a previous build with 1.4.2 or older?
Hi everyone and thanks for the help,

it's a requirement that the Jikes RVM is built with at least Java 5.0 
due to wide spread use of generics and annotations in the code base. I 
personally use Java 6 to build Jikes RVM (on systems with neither Java 
1.4.2 or Java 5.0 installed). The only time I've heard of a problem with 
javah is Andrew when using Open JDK 6. We could have been fluking things 
before.

Thanks again,
Ian Rogers
-- 
Third International Workshop on Implementation, Compilation, 
Optimization of Object-Oriented Languages, Programs and Systems 
(ICOOOLPS 2008)
Submissions/Notification/Conference: May 4th/May 19th/July 7th
Paphos (Cyprus) http://icoolps.loria.fr



More information about the jdk6-dev mailing list