[fpc-pascal] FPC - Compile To Android (ARM) On Mac

de_jean_7777 de_jean_7777 at yahoo.com
Sat Mar 5 12:45:04 CET 2011


On 3.3.2011. 15:18, Lennie De Villiers wrote:
> Hi,
>
> Has anyone got this right and wiling to share some knowledge?
>
> cheers
>
> Lennie
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
I've got it right, but unfortunately only on Windows. However I hope 
I'll help with a few insights.

Things to look out for: gnu assembler needs "-meabi=5" passed when 
something is compiled. This can be achieved by writing a hook script (a 
program that will serve as the assembler but will transfer all 
parameters along with additional -meabi=5 to the original assembler). 
You'll need to pass  -CpARMV5 and -CfSOFT parameters to FPC. You'll also 
need to apply a patch to the fpc sources when building your 
crosscompiler, since there are issues with getting environment variables 
and arguments in a shared library under Android (bug #18833).  This 
patch does not fix the issue, it just sets argc, argv and envp to nil 
values so sysutils and others don't crash when trying to access 
environment variables or arguments

I've attached the patch, and all the scripts I use to build a working 
crosscompiler. These are intended for windows, but you'll probably only 
need to modify the paths and convert the .cmd files to .sh (or type this 
stuff yourself in a terminal).

You'll also need a set of arm-linux (gnueabi) binutils. I simply used 
prebuilt ones, but you may need to compile these yourself.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tools.zip
Type: application/x-zip-compressed
Size: 5501 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110305/49a8f6ff/attachment.bin>


More information about the fpc-pascal mailing list