Thank you for all the help. Much appreciated!
@Laksen: That works great! I have got my hello world sample working on android! So it goes like this. I assume you have the basic project framework allready set up, that loads a native lib and does a JNI call on it:
1. Create a dpr in the project/jni directory
2. Add jni.pas over there, include it and write a jni function
3. run: fpc -Tlinux -Parm -XParm-linux- -FL/system/bin/linker -olibyourproject.so -sh yourproject.dpr (replace "yourproject" by a different name)
4. Remove "/system/bin/linker" from the input section in link.res
5. Run chmod u+x ppas.sh (just to make sure it can execute).
6. Run ppas.sh
7. Move lib<yourproject>.so to project/libs/armeabi (make this dir if nonexistent)
6. cd to your project dir and execute "ant install" (make sure your device/emulator is connected and running).
Now you can start the app in your device. I will provide a working example later.
It seems that the dynamic linker is called something else on Android, and that fpc puts the dynamic linker as an input to the linker script(line 439 in t_linux.pas). As far as I know it should only specify the dynamic linker as a parameter to ld, and not as an input
Do you mean that ld-linux.so.3 is the default used by FPC, while android uses /system/bin/linker? I have found the latter on my device.
So the solution was to override this default by generating a linker script. I only don't really know what link.res is and why I needed to remove /system/lib/linker.
Would it be possible to make this build process a bit simpler? I tried removing -sh but then it complained that /system/bin/linker was not there. Is there a way to tell FPC that I'm cross-compiling so that it doesn't look for the dynamic linker on the host machine?
Thanks alot!