Inspired by Stuart's comment to yesterday's post, I decided to clean up ikvmc a little to make it possible to compile executables.
Other changes:
- it's now possible to specify an IL implementation of a native method in map.xml. At the moment this is used only for System.identityHashCode() to solve this issue.
- map.xml is now parsed using the XmlSerializer (see yesterday's post on why this is not a good idea)
- implemented a work-around for the stack overflow that occurred when the compiler couldn't find java.lang.ClassNotFoundException
- ikvm now supports -classpath switch (thanks dIon)
I've only compiled a simple Hello World type executable with ikvmc and here are some things to look out for:
- all classes (or jars) that are referenced by the application must be specified (except for the Classpath classes)
- a reference (-reference:<path>) to the classpath.dll must be specified
- when compiling an executable the class containing the main method must be specified
- code that expects to be loaded by the system classloader will probably not work. Statically compiled code will be loaded by the bootstrap (aka null) classloader.
Example: ikvmc -out:hello.exe -reference:bin/classpath.dll -main:Hello Hello.class
Updated the binaries and source snaphots.
12:53:45 PM Comments
|