[Pkg-pascal-devel] Castle Game Engine build tool

Michalis Kamburelis michalis.kambi at gmail.com
Mon Feb 22 19:48:27 UTC 2016


On Mon, Feb 22, 2016 at 10:23 AM Abou Al Montacir <abou.almontacir at sfr.fr>
wrote:

> That is, "ppcross386" or "ppcrossarm", running on x86_64.
> I would like to install them of course using pure "apt-get install
> ..." calls (without the need to make cross-compiler myself from FPC
> sources, like I do now). Is this within the scope of Debian
> multi-arch?
>
> The cross compiler himself is not, but this can be fixed easily.
> Normally for this you need to use fpc -P<cpu> -Xp<path>. This is
> undocumented feature but is very useful.
> Please see compiler/utils/fpc.pp lines 167-240 for code selecting the
> compiler backend.
> This code could also be modified to use qemu as a workaround and install
> the native arm compiler package for example
>

I'm using "fpc -Pxxx" already in CGE build tool, in case of "castle-engine
compile --cpu=xxx" call:) It works cool:)

To avoid having to specify -Xp at command-line, one can use something like

#ifdef android
#ifdef cpuarm
... path options for cross-ompiling, like -Xp or -Fl, here
#endif
#endif

inside /etc/fpc.cfg or ~/.fpc.cfg. Then in particular scripts you only use
-P / -T to indicate target CPU / OS, and you don't worry where the
particular tools are installed. Although this is just my preference of
course:)

Being able to use qemu is interesting as an option. It would mean that
there's no need to package (all) cross-compilers, just make (once) a
reliable system to run fpc in qemu under the hood. Nice.

If we're talking about cross-compiling for Android, I should also mention
one important thing: for Castle Game Engine, compiling to Arm should be
done with "hard floats" (-CfVFPV3 option to FPC). This is important,
because *all* your units, including FPC RTL, must then also be compiled
with -CfVFPV3 (you cannot link together units compiled with and without
-CfVFPV3).

Without hard floats, performance drops (a lot --- see
https://github.com/castle-engine/castle-engine/wiki/Android-Internal-Information#notes-about-compiling-with-hard-floats--cfvfpv3
).

Regards,
Michalis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-pascal-devel/attachments/20160222/61bf94dc/attachment.html>


More information about the Pkg-pascal-devel mailing list