[fpc-pascal] getting cross with the cross compiler

Sven Barth pascaldragon at googlemail.com
Sat Oct 7 11:01:14 CEST 2017


Am 07.10.2017 10:57 schrieb <pascalX at piments.com>:
>
> Hi,
>
> I am having trouble getting fpc to cross-compiler for win64 target.
>
> I'm using fedora 26 which supplies 3.0.2
>
> I used instructions here to create the cross compiler using trunk fpc
since the fedora fpc-src does not seem to have the full Makefile structure:
>
>
http://wiki.lazarus.freepascal.org/Cross_compiling_for_Win32_under_Linux#Free_Pascal
>
> I have a simple test file:
>
> {$MACRO ON}
> program Hello;
> begin
>   Writeln('Hello world, from FPC ', FPC_FULLVERSION, '!');
> end.
>
>
> This builds fine using the stock fpc 3.0.2 with linux target.  However,
the supposed cross-compiler seems to be trying to build for linux.
>
> $/usr/lib/fpc/3.1.1/ppcrossx64  /back/coredata/hello.pas
> Free Pascal Compiler version 3.1.1 [2017/10/06] for x86_64
> Copyright (c) 1993-2017 by Florian Klaempfl and others
> Target OS: Linux for x86-64
> Compiling /back/coredata/hello.pas
> Fatal: Can't find unit system used by Hello
> Fatal: Compilation aborted
>
>
> $/usr/lib/fpc/3.1.1/ppcrossx64  -iTO
> linux
>
>
>
> So where is my cross compiler ??
>
> Thanks for any help and suggestions.

A single compiler binary can always compile for all supported targets of
that processor. So as long as all the units are available you simply need
to pass "-Twin64" as additional parameter to compile for x86_64-win64.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20171007/c8dd3bb3/attachment.html>


More information about the fpc-pascal mailing list