From owner-freebsd-hackers Thu Apr 25 4: 1:17 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141]) by hub.freebsd.org (Postfix) with ESMTP id 84A2637B41E for ; Thu, 25 Apr 2002 04:01:11 -0700 (PDT) Received: from k7.mavetju.org (topaz.mdcc.cx [212.204.230.141]) by topaz.mdcc.cx (Postfix) with ESMTP id 5463C2B83B for ; Thu, 25 Apr 2002 13:01:05 +0200 (CEST) Received: by k7.mavetju.org (Postfix, from userid 1001) id 3250348A; Thu, 25 Apr 2002 21:02:02 +1000 (EST) Date: Thu, 25 Apr 2002 21:02:02 +1000 From: Edwin Groothuis To: freebsd-hackers@freebsd.org Subject: missing libraries, and how to find them. Message-ID: <20020425210202.A49377@k7.mavetju.org> Mail-Followup-To: Edwin Groothuis , freebsd-hackers@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Greetings, Last night I had troubles running glade because in an earlier stage this week I had to upgrade libfreetype from so.6 to so.9. Running ldd on it did work a little bit, I found out that it couldn't find a libfreetype.so.6 (which I already knew :-), but couldn't tell me where it was coming from: [~] edwin@k7>ldd `which glade` /usr/X11R6/bin/glade: [...] libfreetype.so.6 => Not found I recompiled it, again the message: Shared object "libfreetype.so.6" not found. It must have been one of the other libraries. Unfortunatly glade uses all the gnome-libraries, so I had to recompile all of them... At the end, it was gtkhtml which was holding the old libfreetype.so.6, but it had cost me the whole evening to find out. Why didn't ldd tell me which lib it was which was failing? With this idea in mind I've submitted PR bin/37448: [PATCH] ldd/rtld support for more information of linked libraries. It patches ldd.c and rtld.c to understand the -s option (that parameter is also used under Solaris I've been told). With this option it does display the name of the program/library ldd is displayed (so not only the first occurance) and the libs being looked for: [~] edwin@k7>ldd -s `which glade` /usr/X11R6/bin/glade: /usr/X11R6/bin/glade libintl.so.2 => /usr/local/lib/libintl.so.2 (0x2812b000) libgda-common.so.0 => /usr/X11R6/lib/libgda-common.so.0 (0x28132000) [...] /usr/local/lib/libintl.so.2 libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x28d4b000) libc.so.4 => /usr/lib/libc.so.4 (0x28e1f000) /usr/X11R6/lib/libgda-common.so.0 libgthread12.so.3 => /usr/local/lib/libgthread12.so.3 (0x28167000) libgconf-1.so.1 => /usr/X11R6/lib/libgconf-1.so.1 (0x2844e000) libbonobo.so.2 => /usr/X11R6/lib/libbonobo.so.2 (0x284f4000) [...] Yes it will output much more data (281 lines for ldd -s glade vs 48 for ldd glade), but at least it gives you the ability to see what libraries are used by the program and its libraries. I hope somebody considers this a usefull patch and wants to commit it. The patch itself is against a 4.5 system (but not that difficult, it was more a matter of finding out where to put it). Thanks, Edwin -- Edwin Groothuis | Personal website: http://www.MavEtJu.org edwin@mavetju.org | Interested in MUDs? Visit Fatal Dimensions: bash$ :(){ :|:&};: | http://www.FatalDimensions.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message