[fpc-devel] Porting FPC to IBM zArch
Sven Barth
pascaldragon at googlemail.com
Wed Jul 24 14:19:09 CEST 2013
Am 24.07.2013 14:12, schrieb Bernd Oppolzer:
> Sorry, I'm sure, this is a very basic question,
> just to speed up things a little ...
>
> when I run the compiler on Windows on my test sources,
> everythings works fine.
>
> Now I wanted to build executables for OS/2 and Linux-386,
> just to learn more about cross-compile. But the installed compiler-exe
> (which came with Lazarus) only supports the win32 target.
>
> The compiler message is as follows:
>
> C:\fpc_test>ppc386 -Tos2 pasform.pas
> Free Pascal Compiler version 2.6.2 [2013/06/09] for i386
> Copyright (c) 1993-2012 by Florian Klaempfl and others
> Target OS: OS/2
> Compiling pasform.pas
> Fatal: Can't find unit system used by PASFORM
> Fatal: Compilation aborted
>
> Same goes for -Tlinux
>
> Of course, I have to build a new compiler. Or: do I misinterpret
> the error message?
>
> I downloaded the development tree using svn.
>
> What is the easiest way to build a new compiler, and:
> will it be possible to build a compiler that is able to build
> different targets at the same time?
>
The problem is not the compiler. Each compiler can compile for each
target of the supported platform. E.g. an i386-win32 compiler can also
compile for i386-os2 and i386-linux. It can not however compile for e.g.
x86_64-win64 or powerpc-linux.
What is not provided by default for other targets is the RTL (and FCL
and packages) which the compiler needs to compile programs. These you
need to create by yourself, but for this you'll also need the according
binutils and depending on the target platform and your program also
libraries from the platform (e.g. when you compile for Linux systems).
Cross compiling for different combinations is described here:
http://wiki.freepascal.org/Cross_compiling
In the simplest cases the approach mentioned for Win32 -> Win64 is
sufficient, but you should also take a look at the BuildFAQ:
http://wiki.freepascal.org/buildfaq
Regards,
Sven
More information about the fpc-devel
mailing list