[fpc-devel] FPC-JVM: Status report on Android

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Aug 29 00:56:37 CEST 2011

On 28 Aug 2011, at 23:01, Jonas Maebe wrote:

> The org.freepascal.rtl.system class verifies fine here, and the FpcBitSet stuff also works fine. Maybe the methods of java.util.BitSet (on which org.freepascal.rtl.FpcBitSet is based) have different signatures in the Android version compared to the Java version. Since the FPC RTL shipped with the snapshot is compiled against the JDK bindings, that would explain the problems.

Now I see: the Android VM apparently also looks at the debug information and checks whether it's appropriate everywhere. The compiler currently says for each local variable and parameter that it's located in a particular stack slot from start to finish of the method. However, if it's only used in part of the method, the stack slot may be reused by temporary values with different types (or because of SSA, it may migrate from one stack slot to another, because virtual registers are also mapped to stack slots). This is what the Android VM verifier is complaining about.

You may be able to work around the issue for now by compiling without debugging information (-g-), but you'll also have to recompile the RTL without debug information. I believe Florian has been working recently on tracking the location of variables/parameters throughout  the code of a procedure, so it may be possible to fix it with the help of that information.


More information about the fpc-devel mailing list