[lazarus] Clean build from nothing

Marco van de Voort marcov at stack.nl
Wed Jun 25 10:49:17 EDT 2003


> I think the point was that the libs are so. (shared object). Whereas fpc is
> static. (please correct me if I'm wrong!)

Ok. No, FPC is not entirely static, but the shared library provisions (see
ppc386 -? option -CD -XD) are spartan, and a bit problematic because of
the fact that PIC misses.

This is known, but the reason is not that we dislike shared linking, but
that there are certain assumptions in the codegenerator which are quite hard
to change in the 1.0.x branch, which limit the ability to implement full
blown shared linking. 

They are scheduled for the major next version (the 1.1 branch, whatever the
release number will be), where the codegenerator is rewritten because
of multiple processor support. PIC should be possible now in 1.1, but is not
yet implemented.

I do think that keeping the binaries static in principle is the way to go
for FPC, since most people will do that. But the shared RTL+FCL etc will
only increase the distro by about a MB, and that will be compressed, so I
think that when implemented, 1.1.x default FPC installs can generated shared
linked programs.

Personally I think there will be three libraries. 

1. rtl, 
2. some units + fcl,
3. rest of packages.

but there hasn't been discussion yet about this.

> If you have many fpc programs each will have it's own copy of the library
> in memory. This probably hasn't become an issue since most often you only
> use one or two fpc programs at a time, but what happens when you have a
> large app that uses litereally thousands of instances of a fpc program.

Then it depends what you want. Memory or speed. Loading files that are
shared linked is slower.

> Does that mean that there is thousands of instances of the same code in
> memory?  The kernel will be so busy swaping out processes that nothing
> would get done.

It can happen yes. But it is a per machine decision, depending on load, the
programs in question etc.

P.s. maybe it is wise to move this thread to fpc-devel?






More information about the Lazarus mailing list