From owner-freebsd-questions@FreeBSD.ORG Fri Oct 24 02:10:42 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 D78111065670 for ; Fri, 24 Oct 2008 02:10:42 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.231]) by mx1.freebsd.org (Postfix) with ESMTP id A64608FC1A for ; Fri, 24 Oct 2008 02:10:42 +0000 (UTC) (envelope-from pisymbol@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so590463rvf.43 for ; Thu, 23 Oct 2008 19:10:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=l+QcWZdOnhI+DWem+pykPzisXowHsouuP3b7HJJRpws=; b=NWkvNYPq9uvnzG8V4fpDuCsIU1T64h0ZbZPGjHo3QBv+C1zymfnnnh8At+pU7ET+Wg +xflOGs8UiS3MCB8ekFdT22qzKZZ1aHltwoDy8E7XA2doBXviikgKFdHrD+EbLie7L+n iJj+S8ydC+9q+Rxbj7TIksl3dK2Uo7EkddtCk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=I3k1Y3m+yFBr+RDrvEqfYEKOc71NZkzlVZuBALakCAug36cSOkB3fzb7yQzwvG+B4w E3NKRYMLlFIuAV/awhqmQI0gPcXRS3l1MxUDjjFpL+YAWDdgnp5ewZ4QuF6XBie26912 upAHARC7qrKSMZe8S4bL4bnS7NtukMzOuPvJQ= Received: by 10.140.139.3 with SMTP id m3mr828088rvd.44.1224814242116; Thu, 23 Oct 2008 19:10:42 -0700 (PDT) Received: by 10.141.43.14 with HTTP; Thu, 23 Oct 2008 19:10:42 -0700 (PDT) Message-ID: <3c0b01820810231910u59f97cecg8b01f391a9b353f3@mail.gmail.com> Date: Thu, 23 Oct 2008 22:10:42 -0400 From: "Alexander Sack" To: "=?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?=" In-Reply-To: <3c0b01820810231848r3e3e297cl3dc9bf1d0edcd588@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3c0b01820810231731s1b4d4659j7d1df8bf4abb229c@mail.gmail.com> <86hc72x0nx.fsf@ds4.des.no> <86d4hqwzur.fsf@ds4.des.no> <3c0b01820810231848r3e3e297cl3dc9bf1d0edcd588@mail.gmail.com> Cc: FreeBSD Hackers , freebsd-questions@freebsd.org Subject: Re: Why does adding /usr/lib32 to LD_LIBRARY_PATH break 64-bit binaries? 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, 24 Oct 2008 02:10:43 -0000 Alright, well I found some weirdness: [root@hagen ~]# export LD_LIBRARY_PATH=/usr/bin:/usr/lib:/usr/lib32:/usr/lib64 [root@hagen ~]# LD_DEBUG=1 ls /libexec/ld-elf.so.1 is initialized, base address = 0x800506000 RTLD dynamic = 0x80062ad78 RTLD pltgot = 0x0 processing main program's program header Filling in DT_DEBUG entry lm_init("(null)") loading LD_PRELOAD libraries loading needed objects Searching for "libutil.so.5" Trying "/usr/bin/libutil.so.5" Trying "/usr/lib/libutil.so.5" Trying "/usr/lib32/libutil.so.5" loading "/usr/lib32/libutil.so.5" /libexec/ld-elf.so.1: /usr/lib32/libutil.so.5: unsupported file layout That's because libutil.so.5 does not exist in /usr/lib only in /lib. The /usr/lib directory has: [root@hagen ~]# ls -l /usr/lib/libutil* -r--r--r-- 1 root wheel 100518 Aug 21 2007 /usr/lib/libutil.a lrwxrwxrwx 1 root wheel 17 Sep 11 11:44 /usr/lib/libutil.so -> /lib/libutil.so.5 -r--r--r-- 1 root wheel 103846 Aug 21 2007 /usr/lib/libutil_p.a So rtld is looking for major number 5 of libutil, without the standard /lib in my LD_LIBRARY_PATH it searches /usr/lib, doesn't find it but: [root@hagen ~]# ls -l /usr/lib32/libutil* -r--r--r-- 1 root wheel 65274 Aug 21 2007 /usr/lib32/libutil.a lrwxrwxrwx 1 root wheel 12 Sep 11 11:45 /usr/lib32/libutil.so -> libutil.so.5 -r--r--r-- 1 root wheel 46872 Aug 21 2007 /usr/lib32/libutil.so.5 -r--r--r-- 1 root wheel 66918 Aug 21 2007 /usr/lib32/libutil_p.a And whalah, I'm broke since there is a libutil.so.5 in there. So my question to anyone out there, WHY does /usr/lib32 contain major numbers but /usr/lib does not? This seems like a bug to me (FreeBSD 7.0-RELEASE is the same) or at least a dubious design decision. Thanks! -aps