[fpc-pascal] getting cross with the cross compiler

pascalX at piments.com pascalX at piments.com
Sat Oct 7 11:44:20 CEST 2017


On 07/10/17 10:01, Sven Barth via fpc-pascal wrote:
> Am 07.10.2017 10:57 schrieb <pascalX at piments.com 
> <mailto: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
> 

PS.  with my current set up, if I specify -Twin64  fpc uses the cross 
compiler I built from trunk 3.1.1 , if I build native ( without -T )  it 
uses the distro 3.0.2

What is happening there if all versions handle all platforms. ;?

thx




More information about the fpc-pascal mailing list