pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: Thomas Hallgren <thhal@mailblocks.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Use of zlib
Date: Thu, 23 Sep 2004 11:41:16 -0400
Message-ID: <4152EE9C.1080006@dunslane.net> (raw)
In-Reply-To: <26037.1095950934@sss.pgh.pa.us>
References: <ciuafp$n4u$1@sea.gmane.org>
	<200409231412.29763.peter_e@gmx.net>
	<26037.1095950934@sss.pgh.pa.us>



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 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




view thread (14+ messages)  latest in thread

Message-ID: <4152EE9C.1080006@dunslane.net>
Permalink:  ../4152EE9C.1080006@dunslane.net/
Also on:    postgresql.org/message-id/4152EE9C.1080006@dunslane.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andrew@dunslane.net, tgl@sss.pgh.pa.us, peter_e@gmx.net, thhal@mailblocks.com
  Subject: Re: Use of zlib
  In-Reply-To: <4152EE9C.1080006@dunslane.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox