[fpc-devel] LinkLib Issues In Lazarus and in FPC-2.0.2
Daniël Mantione
daniel.mantione at freepascal.org
Mon Jul 17 14:03:35 CEST 2006
Op Mon, 17 Jul 2006, schreef Jonas Maebe:
> There's nothing C-specific about libraries, nor about the *config scripts. At
> most it would be linker-specific.
There is, those scripts mainly exist because a C compiler cannot determine
the dependencies of a library. I.e. if you like libgtk you must also link
libglib.
We don't need this in Pascal, the compiler can perfectly determine the
dependencies by checking the used units. So the primary reason for this
cruft is void in Pascal.
> > There simply should be no reason
> > why you want such complexity. A library has a name, you link to it by
> > name, basta.
>
> A library also exist in at least multiple locations, versions (both
> ABI-compatible and -incompatible with previous versions) and implementations
> (e.g. a native Mac OS X GTK and an X-based one).
I don't see how *_config guards you against this:
* In case of a version change it will simply return the new version. The
.so symlink does this as well. If the new version is incompatible with
the old one, bad luck.
* It doesn't guard you against ABI changes, because that it determined
at the compiler level. I.e. there is no way to make cdecl code using a
register calling convention by using a linker option.
It helps for locations, but we already have a well adequate solution for
that: Putting the location in fpc.cfg.
Daniël
More information about the fpc-devel
mailing list