[fpc-pascal]gnu binutils cross compiler/linker for linux from windows

Marco van de Voort marcov at stack.nl
Sat Jun 28 15:48:47 CEST 2003

> I want to create a pascal compiler which can cross compile for linux from windows.
> ( So I can develop server programs on windows and then later run then on linux server's )
> It seems there are 2 pascal compilers which might be able to do that:
> 1. free pascal.
> 2. gnu pascal.
> I am trying to get free pascal working as a cross compiler.

FPC has in principle a compiler per architecture. So for
Windows/x86->linux/x86 you don't need a separate crosscompiler.
> I have been told by a user of free pascal that I need a cross compiler and
> a cross linker also websites say that.

You also need FPC cross libraries. However these can be made using the
compiler and source of the normal FPC distribution.

(recompile with make all OS_TARGET=<target> in the top level and
cross-binutils set with -FD option or in the path.

If you link to non-FPC libraries (or use FPC libraries that do, like the GTK
headers) you'll also need the suitable Linux libs on your windows machine.
> It also seems that gnu binutils 2.14 contain a cross compiler and a cross
> linker ? ( or what is a cross assembler ? )

cross assembler and linker.

> So I need to compile/link/build the gnu binutils. ( I think?: working on
> windows and compiling for linux )
Maybe you can download them somewhere.

> I already tried compiling gnu binutils the simple way:
> ./configure

This will probably become something like

./configure -target=<platform to compiler for>

> I'll try and post this same message to the free pascal mailing list as
> well.
> What I am trying to do seems rather complex... I have almost no experience
> with linux !

I think there are win32 cross-binutils for the usual targets available on
the net somewhere. I think that'd be easier than setting up an gcc environment
to compile them corss.

More information about the fpc-pascal mailing list