[Lazarus] FPC & Lazarus installation including cross compiling from source

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Tue Mar 27 19:26:31 CEST 2012

Reinier Olislagers wrote:
> On 27-3-2012 17:44, Mattias Gaertner wrote:
>> patspiper <patspiper at gmail.com> hat am 27. März 2012 um 17:17 geschrieben:
>>> This is related to bug 0021580: Feature request: Robust IDE
>> cross-compiling.
>>> With Lazarus 1.0 being closer than ever, and with the availability of
>>> different Linux scripts to compile FPC from source (including cross
>>> compilation), maybe the time has come to have an automated installer
>>> that does all that, including the compilation of the cross binutils.
>> That is one approach. 
>> Another is to use VMs. 
>> VMs are nowadays very easy to setup and they run almost as fast
>> (sometimes even faster) as the host system.
>> Installing/Upgrading all the required libs in a VM is much simpler than
>> setting up these libs cross compiled. 
> Agreed with Mattias.
> I would strongly recommend using VMs as well so that the level of
> complexity/maintenance decreases.
> Linux to Windows can be done, but the other way round is difficult.

I'd introduce some words of caution here, for a number of reasons.

a) Depending on the person who's put it together, the requirements and 
architecture of an OS running in a VM can vary enormously. As a 
particular example, Debian set up for some guest processors requires a 
graphical (xterm) console, but for others can make do with ssh or with 
nothing at all.

b) Performance can vary wildly. That is particularly the case where the 
guest is x86, since Qemu- on which a number of other VM schemes are 
based- increasingly assumes that hardware virtualisation is available 
(i.e. an older Linux kernel with kqemu, or newish hardware and kernel 
with KVM).

c) Library availability etc. is determined by whoever put the guest OS 

It's probably not safe to assume that a developer will be able to build 
natively (i.e. if he wants to compile for an ARM target that he has an 
ARM system) since PC-type boards based on ARM, MIPS and so on are 
comparatively scarce and expensive (this might change when the Raspberry 
Pi is finally available, at least for ARM).

It's only slightly more safe to assume that a developer will be able to 
get an OS of a suitable version working in a VM.

So while native and VM-based systems are certainly significant, I think 
it would be unwise to write off cross-build tools out of hand.

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 Lazarus mailing list