[fpc-pascal] [semi-off-topic] some C questions arising while using h2pas

Jonas Maebe jonas.maebe at elis.ugent.be
Fri Jul 15 23:46:22 CEST 2011


On 15 Jul 2011, at 14:40, Mark Morgan Lloyd wrote:

> I wonder if I could tack a question onto this. When I started looking at SPARC Solaris 10 and Solaris 8 earlier in the year, I found that the linker (which I think was gld) followed symlinks at build time rather than waiting until runtime. This meant that while I was able to build FPC on 10 without significant difficulty, I couldn't move the binaries back to 8: I had to rebuild with a hacked symlink to a temporary copy of one of the standard libraries (possibly libc, I can't remember for certain).
> 
> Is this what one would expect, or is it another ld glitch that might be platform-specific?

It is expected. The logic is:
a) you build the application using a certain set of headers that go with a certain version of the library. Hence, the program should be linked against that particular version of the library
b) you don't want to have to change the build command every time a library gets updated. Hence, there is a symlink with a generic name going to the default version of the library (and on most Linux systems this symlink in fact is only created if you install the -devel version of a package, since it is only required when compiling programs)
c) if a library changes in a way that breaks backwards compatibility as far as the api is concerned, its major version is increased so that applications built against a previous version of the library won't use the newer one and then crash. Also, since the new version has a different name, you can in principle have both the old and the new version installed concurrently so that both old apps and new apps still work (the system however breaks down when a single program uses e.g. libA and libB that in turn depend on respectively libfoo.1.so and libfoo.2.so, because both libfoos will probably have a bunch of symbols in common causing symbol resolution conflicts)


Jonas


More information about the fpc-pascal mailing list