[fpc-devel] Building compiler, rtl, host, target... (cross compiling)

Sven Barth pascaldragon at googlemail.com
Fri Apr 8 11:29:09 CEST 2011


Am 07.04.2011 09:37, schrieb Skybuck Flying:
> (Side question: can an RTL actually be a runtime library instead of
> being compiled into applications ?)
>

Runtime packages are yet a todo and not implemented.

> However for the application which it is trying to compile needs to run
> on a different platform and thus
> the application needs to either be linked to that platform RTL or it
> needs to have that platform RTL embedded into it.
>
> And that's what free pascal more or less seems to do... it embeds "a
> target platform RTL" into the application that it tries to compile.
>

Because that RTL is just Pascal code as well and the to-be-compiled 
application uses that units and thus they need to be compiled in. Simple 
as that.

>> Every compiler can compile the RTL for its target, as well as other
>> applications.
>
> No the compiler cannot compile the RTL for it's target because the
> compiler does not have
> the assembly yet to output the RTL ?

Yes, the compiler can compile the RTL for its target if the compiler is 
configured for the same CPU as the target has.

>
> So at the very minimum the compiler needs to produce assembler output
> and for that it needs
> some kind of internal assembler-outputter ;)

A compiler always needs to output assembler at the end (in one form or 
the other...), that the use of a compiler.

Regards,
Sven



More information about the fpc-devel mailing list