From owner-freebsd-questions@FreeBSD.ORG Fri Jul 11 12:08:13 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 151661065679 for ; Fri, 11 Jul 2008 12:08:13 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (rachie.is-a-geek.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id ED3268FC20 for ; Fri, 11 Jul 2008 12:08:12 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id 0F23A1CD94; Fri, 11 Jul 2008 04:08:12 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org, unga888@yahoo.com Date: Fri, 11 Jul 2008 14:08:10 +0200 User-Agent: KMail/1.9.7 References: <310032.41745.qm@web57009.mail.re3.yahoo.com> In-Reply-To: <310032.41745.qm@web57009.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807111408.11050.fbsd.questions@rachie.is-a-geek.net> Cc: Subject: Re: Library mapping question X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 12:08:13 -0000 On Friday 11 July 2008 10:22:21 Unga wrote: > Hi all > > I have same name libraries in two different locations, eg. > /usr/lib/libXXX.so and /usr/local/lib/libXXX.so. They were created using > same sources and the same compiler. > > The app1 is linked with /usr/lib/libXXX.so and app2 is linked with > /usr/local/lib/libXXX.so. > > When app2 is run, the dynamic linker (ld-elf.so.1) finds /usr/lib/libXXX.so > first and ends up with following error: undefined reference to `_myxxx' > > This is not an issue with Linux's dynamic linker but it seems FreeBSD's > function look up is very specific. I cannot change the dynamic linker's > search path, then app1 fails. > > How do I get the app2 to refer to /usr/local/lib/libXXX.so? > > In FreeBSD, is there a way to instruct the dynamic linker (ld-elf.so.1) to > continue to search for the same library name in different locations? > > What are the other possible options? The best option is to bump version number of the shared library with the more functions. FreeBSD doesn't link with .so, it links with .so.$VERSION. It would be easier to help you though, if we wouldn't be talking about libXXX but the actual libraries. Maybe it can be done by adding small changes to the port that installs /usr/local/lib/libXXX.so (if this isn't your own library). -- Mel Problem with today's modular software: they start with the modules and never get to the software part.