X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E28C4DAED8; Tue, 22 Nov 2005 05:58:00 -0400 (AST) 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 63066-08; Tue, 22 Nov 2005 09:57:59 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from svana.org (svana.org [203.20.62.76]) by svr1.postgresql.org (Postfix) with ESMTP id BBA8ADAEF6; Tue, 22 Nov 2005 05:57:55 -0400 (AST) Received: from kleptog by svana.org with local (Exim 3.35 #1 (Debian)) id 1EeUuJ-0003RA-00; Tue, 22 Nov 2005 20:57:47 +1100 Date: Tue, 22 Nov 2005 10:57:47 +0100 From: Martijn van Oosterhout To: Zeugswetter Andreas DCP SD Cc: Seneca Cunningham , pgsql-hackers@postgresql.org, pgsql-ports@postgresql.org, pgsql-patches@postgresql.org Subject: Re: [HACKERS] Should libedit be preferred to libreadline? Message-ID: <20051122095747.GA12548@svana.org> Reply-To: Martijn van Oosterhout References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NzB8fVQJ5HfG6fxh" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-PGP-Key-ID: Length=1024; ID=0x0DC67BE6 X-PGP-Key-Fingerprint: 295F A899 A81A 156D B522 48A7 6394 F08A 0DC6 7BE6 X-PGP-Key-URL: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[AWL=0.000] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/144 X-Sequence-Number: 17893 --NzB8fVQJ5HfG6fxh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 22, 2005 at 10:07:15AM +0100, Zeugswetter Andreas DCP SD wrote: > PS: I'd prefer if readline was only linked where it is needed, namely in > psql. The problem as stated is that people don't want to maintain lists of libraries as needed by each program, so we link all of them. Since it seems to always be the same few libraries that cause us problems, maybe a simpler approach would be to, in the Makefile, use filter-out to exclude libraries you *know* aren't needed. Like in the Makefile we put: postgres: $(OBJS) $(CC) $(CFLAGS) $(LDFLAGS) $(export_dynamic) $^ $(filter-out -lread= line -ledit, $(LIBS)) -o $@ So instead of maintaining lists of what each binary needs, we can maintain a few lists of what certain binaries *don't* need. Actually, I think the backend is the only thing important enough to worry about this, although if readline is exporting memcpy that it's quite possible other binaries might be affected. Maybe create a BACKEND_LIBS which contains a shorter list. Even the GCC --as-needed flag can't save you from libs exporting functions they shouldn't... Have a nice day, --=20 Martijn van Oosterhout http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them. --NzB8fVQJ5HfG6fxh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQFDguuaIB7bNG8LQkwRAsB2AJ9BapJbwQg4u2ZT/knffJ8cq1oYYQCfSVsE K7vT72E7ZXfJh2P17XlEUjM= =dZdS -----END PGP SIGNATURE----- --NzB8fVQJ5HfG6fxh--