[fpc-pascal] cross compiling enigma

Sam Liddicott sam at liddicott.com
Sat Dec 8 19:26:45 CET 2007

Sam Liddicott wrote:
> * Marco van de Voort wrote, On 07/12/07 08:20:
>>> I'm modifying the lazarus packaging scripts to make building debs of 
>>> lazarus, fpc and cross-fpc variants simpler than it is. (Cross is not 
>>> simple right now)
>>> I've read the buildfaq (thanks Marco) and various fpc build scripts but 
>>> am still puzzled in this respect:
>>> Why does:
>>> $ cd fpc
>>> $make clean all OS_TARGET=win32  FPC=/usr/bin/ppc386
>>> make:
>>> ./compiler/ppc386.exe
>>> I thought I was building a cross-compiler, not cross-compiling one - or 
>>> is it a side effect of building the rtl etc?
>> The thing you are missing (read buildfaq better :-) is that FPC doesn't have
>> to be cross for platforms on the same architecture.
> :-(
> I used 386-win32 for testing the script because FPC-SVN won't compile
> for arm-wince - I'll try a ppc build for the test then.
> So... because the makefile knew it was compiling for the same
> architecture it decided that I wasn't building an fpc cross compiler
> but cross building an fpc compiler? That's a bit unexpectedly clever...
So... this time:
$ make clean all CPU_TARGET=powerpc OS_TARGET=linux FPC=/usr/bin/ppc386

And, just like before, it has created a load of powerpc binaries:

$ file /tmp/fpc_patchdir/fpc_build/usr/bin/postw32
/tmp/fpc_patchdir/fpc_build/usr/bin/postw32: ELF 32-bit MSB executable,
PowerPC or cisco 4500, version 1 (SYSV), statically linked, stripped

So I'm still puzzled that the recipe for creating a cross compiler is
actually cross-compiling a compiler and cross-compiling the tools.

Of course,  compiler/ppcrossppc was created, but it seems as a precursor
to creating all the powerpc binaries.

So I still think I'm doing it wrong; was my make command line correct to
produce an fpc instance that will cross-compile for powerpc-linux?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20071208/71dd570b/attachment.html>

More information about the fpc-pascal mailing list