Re: Use of zlib

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Thomas Hallgren <thhal(at)mailblocks(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use of zlib
Date: 2004-09-23 15:41:16
Message-ID: 4152EE9C.1080006@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>Peter Eisentraut <peter_e(at)gmx(dot)net> 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joe Conway 2004-09-23 15:56:15 Re: SQL-Invoked Procedures for 8.1
Previous Message Tom Lane 2004-09-23 14:54:01 Re: SQL-Invoked Procedures for 8.1