Tom Lane wrote:
Peter Eisentraut <[EMAIL PROTECTED]> writes:
Am Donnerstag, 23. September 2004 13:02 schrieb Thomas Hallgren:
From what I can understand from the documentation, the only utility in
PostgreSQL that actually uses zlib is pg_dump? If so, why is the
postgres process linked with -lz?
Because we are too lazy to fine-tune the build system for cases like this.
I was just reading about a linker option (--as-needed or something like that) that exists in more recent versions of the GNU linker. It means "only link the libraries actually referenced". Applying this or local equivalent where available would seem like a fairly painless way to solve the problem, at least on some platforms.
I agree that trying to keep track of the set of libraries really needed
for each executable would be a hopeless task, but if we can make the
linker fix it for us ...
Only in version 2.15, which as you say is fairly new. And people who don't use GNU ld won't get it anyway. The docs ( http://sources.redhat.com/binutils/docs-2.15/ld/Options.html#Options ) say:
|--as-needed|
|--no-as-needed| This option affects ELF DT_NEEDED tags for dynamic libraries mentioned on the command line after the |--as-needed| option. Normally, the linker will add a DT_NEEDED tag for each dynamic library mentioned on the command line, regardless of whether the library is actually needed. |--as-needed| causes DT_NEEDED tags to only be emitted for libraries that satisfy some reference from regular objects. |--no-as-needed| restores the default behaviour.
I'm not sure I understand why keeping track of what we need for each executable is such a difficult task, though. I count 23 executables and a handful of libraries. Is this such a herculean task?
cheers
andrew
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly