Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2011-03

FPC - Compile To Android (ARM) On Mac

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Schindler Karl-Michael
Lennie De Villiers wrote 7 lines
Hi, Has anyone got this right and wiling to share some knowledge? cheers Lennie

Maybe the fink packages for the arm-linux crosscompiler and the arm-linux binutils can help you; at least as a template for starting. Does it matter that they are release versions only, not the 2.5.1 version from trunk?

MiSchi

Reply by email

de_jean_7777
to Lennie De Villiers: Has anyone got this right and wiling to share some knowledge? cheers Lennie
Lennie De Villiers wrote 12 lines
Hi, Has anyone got this right and wiling to share some knowledge? cheers Lennie _______________________________________________ fpc-pascal maillist - 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.

Reply by email