Closed jollyjoker992 closed 3 years ago
Perhaps your final issue would be fixed by #58? The binary we had been shipping for 32-bit ARM was not compiled for hardfp, which seems to be the norm now.
We would be happy to incorporate other changes you made. Please help us make jffi boot properly on Android! 😄
Related issue that has not been fixed is missing armv7l
- my particual Android device arch in https://github.com/jnr/jffi/blob/master/src/main/java/com/kenai/jffi/Platform.java
(and likely others as @jollyjoker992 mentioned), plus relying on Integer.getInteger("sun.arch.data.model")
which won't work on Android.
This can be likely closed now
@tomholub Right you are! Perhaps someone can submit an example Android app to jnr-ffi-examples that puts things in the right places?
I use jnr-ffi to bind native code to java code but I ran into a problem that cannot detect the CPU size from Platform#calculateAddressSize() because the line of code alway throw error
int dataModel = Integer.getInteger("sun.arch.data.model");
So I fix the problem by clone your code and using another system property (os.arch
) and rebuild the jar file. After that, I detect another problem in jffi lib that not support arm CPU architecture. The incorrect method is here that it's missing some architecture like i486,i586,i686,i786 (typically is android emulator x86) and arm architecture. So I need to modify code and rebuild the jar file of jffi lib. Everything is OK when I run new code in java app but isn't in Android app. The full stack trace is following