From owner-svn-src-head@FreeBSD.ORG Sun Mar 3 13:43:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1B02D52A; Sun, 3 Mar 2013 13:43:18 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) by mx1.freebsd.org (Postfix) with ESMTP id D7A617EE; Sun, 3 Mar 2013 13:43:17 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 341833592DA; Sun, 3 Mar 2013 14:43:15 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id 1ECBA2848C; Sun, 3 Mar 2013 14:43:15 +0100 (CET) Date: Sun, 3 Mar 2013 14:43:14 +0100 From: Jilles Tjoelker To: "Pedro F. Giffuni" Subject: Re: svn commit: r247683 - head/lib/libedit Message-ID: <20130303134314.GA21318@stack.nl> References: <201303030211.r232B4RR039202@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201303030211.r232B4RR039202@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Mar 2013 13:43:18 -0000 On Sun, Mar 03, 2013 at 02:11:04AM +0000, Pedro F. Giffuni wrote: > Author: pfg > Date: Sun Mar 3 02:11:03 2013 > New Revision: 247683 > URL: http://svnweb.freebsd.org/changeset/base/247683 > Log: > libedit does not need to be linked with ncurses > libedit uses the terminfo headers but doesn't really need > to be linked with ncurses. > Discussed with: christos@NetBSD > MFC after; 3 days > Modified: > head/lib/libedit/Makefile > Modified: head/lib/libedit/Makefile > ============================================================================== > --- head/lib/libedit/Makefile Sun Mar 3 01:36:31 2013 (r247682) > +++ head/lib/libedit/Makefile Sun Mar 3 02:11:03 2013 (r247683) > @@ -11,7 +11,6 @@ OSRCS= chared.c common.c el.c emacs.c fc > parse.c prompt.c read.c refresh.c search.c sig.c term.c tty.c vi.c > > DPADD= ${LIBNCURSES} > -LDADD= -lncurses > > MAN= editline.3 editrc.5 > This is wrong. libedit.so uses symbols such as tgetent from libcurses.so, so it should be linked to libcurses.so. These symbols are easily visible in the output of objdump -T /lib/libedit.so.7 because they are unversioned. There is not much breakage because most applications using libedit explicitly link to libcurses, since that is required for static linking. For dynamic linking it is really a case of overlinking, particularly because libedit completely abstracts away libcurses from the application's point of view (in other words, the application need not call libcurses itself). More subtle breakage will result if libcurses.so starts using versioned symbols and libedit.so uses a symbol with more than one version, as rtld will then give it the oldest version where libedit.so expects a newer version. Perhaps we should add -Wl,--no-undefined to SOLINKOPTS in bsd.lib.mk with the exception of libraries that deliberately have undefined symbols (for example, to be supplied by the application). -- Jilles Tjoelker