From owner-freebsd-ports@FreeBSD.ORG Tue Feb 21 23:56:16 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 224BC1065670; Tue, 21 Feb 2012 23:56:16 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.10]) by mx1.freebsd.org (Postfix) with ESMTP id AF7228FC1F; Tue, 21 Feb 2012 23:56:15 +0000 (UTC) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.14.5/8.14.5/NETPLEX) with ESMTP id q1LNdaF5036328; Tue, 21 Feb 2012 18:39:36 -0500 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.2.7 (mail.netplex.net [204.213.176.10]); Tue, 21 Feb 2012 18:39:36 -0500 (EST) Date: Tue, 21 Feb 2012 18:39:36 -0500 (EST) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net To: Steve Kargl In-Reply-To: <20120221223251.GA23053@troutmask.apl.washington.edu> Message-ID: References: <20120221182850.GA20768@troutmask.apl.washington.edu> <20120221185754.GL55074@deviant.kiev.zoral.com.ua> <20120221194259.GA21185@troutmask.apl.washington.edu> <4F440E8B.9020306@FreeBSD.org> <20120221220053.GA44386@night.db.net> <20120221223251.GA23053@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Konstantin Belousov , Diane Bruce , freebsd-current@freebsd.org, Dimitry Andric , freebsd-ports@freebsd.org Subject: Re: rtld or lang/gcc cannot find libgcc_s.so.1 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Eischen List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Feb 2012 23:56:16 -0000 On Tue, 21 Feb 2012, Steve Kargl wrote: > On Tue, Feb 21, 2012 at 05:00:53PM -0500, Diane Bruce wrote: >> On Tue, Feb 21, 2012 at 10:37:15PM +0100, Dimitry Andric wrote: >>> On 2012-02-21 20:42, Steve Kargl wrote: >>> ... >>>> Yes, /lib comes before /usr/local/lib/gcc46. I suppose >>>> that this is a heads up for gerald@. lang/gcc is used by >>>> the ports collections to build a large number of other >>>> ports, so others are likely to hit this issue. >> >> Does -rpath not help ? > > I already mentioned that I can add '-rpath /usr/local/lib/gcc46' > to my various projects. I can also build with -static to avoid > rtld. One can also use LD_LIBRARY_PATH. > > The issue seems to be that lang/gcc will be installed after > system start, and 'ldconfig -m' appends new shared libraries > to the hints file. This means that libraries with the same > name but different locations will be found via the order of the > search path in the hints file, and one gets the wrong library. > That is, with the following > > troutmask:root[256] ldconfig -r | grep libgcc_s > 29:-lgcc_s.1 => /lib/libgcc_s.so.1 > 723:-lgcc_s.1 => /usr/local/lib/gcc46/libgcc_s.so.1 > > 29 will be found before 723. While I can work around the > issue, lang/gcc is used by a rather large boatload of ports > during the building process and I suspect that a large > number of FreeBSD users use lang/gcc for their everyday > compiler. The question is how do we, the FreeBSD project, > deal with this issue, so that the general user base does not > get hit with it. > > There are a few solutions: > 1) Set ldconfig_paths in /etc/rc.conf to cause ${PORTSDIR}/lib to > be scanned before /lib and /usr/lib. > 2) Use /etc/ld.so.conf to cause ${PORTSDIR}/lib to be scanned > for /lib and /usr/lib. s/for/before/ ?? > 3) Add a new option to ldconfig to prepend new libraries to > the hints files and fix the ports to use this option instead > of -m. You don't want system binaries that want /lib/libgcc_s.so.1 to use /usr/local/lib/gccXX/libgcc_s.so.1, though. Wouldn't your option 3 do that? > 4) Suggestions from people that are brighter than I. [Not brighter than you, but] o For our system libgcc, use libcc_s.so.1 (or some other name) instead of libgcc_s.so.1? o Change affected ports to use -rpath when building? -- DE