Re: Use of zlib - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Use of zlib
Date
Msg-id 4152EE9C.1080006@dunslane.net
Whole thread Raw
In response to Re: Use of zlib  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Use of zlib  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:

>Peter Eisentraut <peter_e@gmx.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
commandline, regardless of whether the   library is actually needed. |--as-needed| causes DT_NEEDED tags to   only be
emittedfor 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: SQL-Invoked Procedures for 8.1
Next
From: Joe Conway
Date:
Subject: Re: SQL-Invoked Procedures for 8.1