[fpc-pascal] Bootstrapping FPC for x86_64

Graeme Geldenhuys graemeg.lists at gmail.com
Mon Nov 24 11:26:18 CET 2008

On Mon, Nov 24, 2008 at 12:13 PM, Joost van der Sluis <joost at cnoc.nl> wrote:
> Op maandag 24-11-2008 om 12:04 uur [tijdzone +0200], schreef Graeme
>> 1)  I see it's generating a i386 compiler and not a x86_64 compiler???
>>  Maybe that's because I copied my 32bit FPC 2.2.3 directory to the
>> 64bit server?
> No, that's because you used a 32-bit start-compiler

That's what I meant... :-)

>> 2) No idea what the error means. I do have a /usr/lib/crti.o file. But
>> maybe that's due to the server being 64bit and FPC is generating a
>> 32bit executable.
> Indeed. Run 'file /usr/lib/crti.o' and you'll see


>> 3) Can I bootstrap a 64bit FPC without any previous FPC compiler?  I
>> don't want to download 35MB's FPC 2.2.2 just to recompile 2.2.3
> You only need the file 'ppcx64' or you have to cross-compile. But
> cross-compiling from 32bit to 64bit is a bit hard, and if I remember
> correctly even not possible for all versions of fpc.

Based on (1)'s answer, using a 32bit start compiler I thought I would
try my hand at cross-compiling which I have never done before.  :-)

After a few attemps using the following command line, I noticed it
keeps looking for the cross-compler versions of 'as' and 'ld'.  eg;
'x86_64-linux-as'  I knew that the standard 'as' command is the
correct one, because I'm on the 64bit system. I created a bin
directory in my $HOME and added it to $PATH. I then created symlinks
to resolve the new cross-compiler binutils names.

make CPU_TARGET=x86_64 OS_TARGET=linux
FPC=/home/graemeg/programming/ppc386 cycle

After running the above command, I finally ended up with a 'ppx86'
executable.  I'll now try and build the whole FPC with that.  :-)
Lets hope all goes well!

  - Graeme -

fpGUI - a cross-platform Free Pascal GUI toolkit

More information about the fpc-pascal mailing list