[fpc-devel] Re. z370 Cross Compilation, Pass 2 of ....

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sun Sep 1 15:00:11 CEST 2013

Sven Barth wrote:

> If someone wants to port the compiler to a new target processor it is 
> advisable to look whether there exists an OS that is already supported 
> by FPC, because then "only" the code generator and the CPU specific 
> parts of the RTL need to be implemented while the remaining RTL can be 
> reused which simplifies the first steps of the port. Otherwise you'd 
> need to implement the code generator and a more or less complete RTL.
> So as Linux seems to be available at least for some variants of the CPU 
> I would strongly suggest to target Linux first and other OSes later.
> Also the compile process of FPC is roughly this:
> - for each used unit:
>     - parse the unit and generate a node tree for each 
> procedure/function/method (basically platform independant)
>     - generate a CPU specific linear assembler representation of each 
> node tree (this representation is independant of the specific assembler 
> used)
>     - if an external assembler (e.g. GNU as) is used: convert the 
> assembler lists to assembler files
>     - call the assembler (internal assemblers work on the assembler 
> lists directly) to generate the object file
> - for external linkers (e.g. GNU ld): write a linkscript to instrument 
> the external linker
> - call the linker (internal linkers work directly on the in memory 
> information the compiler has gathered)

Presumably that implies that it's not feasible to have an internal 
assembler followed by a standard platform-specific linker. The reason I 
highlight this combination is that I've had no success finding a free 
assembler other than GNU as (gas) which covers all development 
platforms, in particular "The free Tachyon Legacy Assembler is available 
for MVS 3.8 and Linux/390" which obviously makes it NBG for the initial 
stages of development on x86 Linux or Windows.

One of the links I posted earlier demonstrates that GCC is generally 
tailored to suit the prevalent assembler on each operating system 
(Linux, MUSIC/SP, CMS or whatever). That obviously doesn't imply that 
the macro packages that serious assembler programmers would expect are 

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-devel mailing list