X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 756F5329DB3 for ; Thu, 23 Sep 2004 16:41:33 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 71349-02 for ; Thu, 23 Sep 2004 15:41:30 +0000 (GMT) Received: from trolak.mydnsbox2.com (ns1.mydnsbox2.com [207.44.142.118]) by svr1.postgresql.org (Postfix) with ESMTP id 528FB329D27 for ; Thu, 23 Sep 2004 16:41:29 +0100 (BST) Received: from dunslane.net (cpe-024-211-141-025.nc.rr.com [24.211.141.25]) (authenticated (0 bits)) by trolak.mydnsbox2.com (8.11.6/8.11.6) with ESMTP id i8NFneL02332; Thu, 23 Sep 2004 10:49:40 -0500 Message-ID: <4152EE9C.1080006@dunslane.net> Date: Thu, 23 Sep 2004 11:41:16 -0400 From: Andrew Dunstan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040116 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Peter Eisentraut , Thomas Hallgren , pgsql-hackers@postgresql.org Subject: Re: Use of zlib References: <200409231412.29763.peter_e@gmx.net> <26037.1095950934@sss.pgh.pa.us> In-Reply-To: <26037.1095950934@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/728 X-Sequence-Number: 59294 Tom Lane wrote: >Peter Eisentraut 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