[fpc-pascal]how much work is proting fpc

Florian Klaempfl F.Klaempfl at gmx.de
Fri Sep 3 10:10:33 CEST 2004

Peter Vreman wrote:

>>At first: Don't get me wrong and expect anything, I'm only curious.
>>That said:
>>How much work would it be to port fpc to another processor?
>>Same for another OS?
>>Maybe some of the experienced folks can give a short sketch in a few
>>sentences of the process of porting.
> Porting fpc to another processor dependents on the processor. It is
> difficult to give an exact idea. The sparc was started as third port, but
> in the meanwhile the arm and amd64 are already finished. Things like
> instructionset, alignment and calling conventions are the main parts of
> the porting work. This is all using linux as the OS, since that includes
> the less effort to port the RTL to another CPU.
> To give a little indication of the time needed, porting the codegenerator
> part will take about 2 months of work when you already know how the
> compiler internals. This is only filling the already existing framework
> and not needing any fundamental changes.
> Example from the sparc is that it also needs fundamental changes to fix
> alignment issues and support the calling conventions better. Then
> everything takes a lot more time.

As a basic estimation you can take the code size of the processor 
dependend directories in fpc/compiler. A simply port to another 
processor is between 5k and 10k lines of code.

> Porting fpc to another OS ask marco or olle. They did the last OS portings.

Porting to a different OS can be very easy or quite hard. It depends how 
close the new OS is to existing ones. E.g. Classic MacOS is very hard 
because it's very different to existing OSes. MacOS X was pretty easy 
because MacOSX is a BSD unix.

More information about the fpc-pascal mailing list