From owner-freebsd-current@FreeBSD.ORG Wed Jan 4 22:30:27 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B193A106564A for ; Wed, 4 Jan 2012 22:30:27 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7D8E08FC15 for ; Wed, 4 Jan 2012 22:30:27 +0000 (UTC) Received: by obbwd18 with SMTP id wd18so21116603obb.13 for ; Wed, 04 Jan 2012 14:30:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ntukfB7EeSya/pqQ77XdKrckSg1yqGssMB6oJRIBPG0=; b=xz8pi3YONE8KLBuUISc8FgsyfTZ8M946trnFtLU6Bww2jxwt1BvGrCs/LVD77A8hBy AMTW0FoGkcvuYZRhLNcvAPZZn/B44oiy/c4yeMtNoWDNKW4FeMqIaqyIkG6MOedAlK98 9OuNFZHNe3qi8x7ts4ac2TtJ/bEciGj0ocW8U= MIME-Version: 1.0 Received: by 10.182.193.99 with SMTP id hn3mr49280003obc.61.1325716227045; Wed, 04 Jan 2012 14:30:27 -0800 (PST) Received: by 10.182.152.6 with HTTP; Wed, 4 Jan 2012 14:30:27 -0800 (PST) In-Reply-To: <20120104222955.GA73868@onelab2.iet.unipi.it> References: <20120104222315.GA73613@onelab2.iet.unipi.it> <20120104222955.GA73868@onelab2.iet.unipi.it> Date: Wed, 4 Jan 2012 14:30:27 -0800 Message-ID: From: Garrett Cooper To: Luigi Rizzo Content-Type: text/plain; charset=ISO-8859-1 Cc: current@freebsd.org Subject: Re: add 'ldd' to cross-tools ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 22:30:27 -0000 On Wed, Jan 4, 2012 at 2:29 PM, Luigi Rizzo wrote: > On Wed, Jan 04, 2012 at 02:10:36PM -0800, Garrett Cooper wrote: >> On Wed, Jan 4, 2012 at 2:23 PM, Luigi Rizzo wrote: >> > Hi, >> > in doing cross-builds of picobsd, i found i need a cross-version >> > of "ldd" so i can run it on the host to detect which shared libraries >> > are used by binaries on the target architecture >> > (for amd64->i386 there is a partial workaround, but don't know >> > if it works in other cases) >> > >> > Is there any concern in adding usr.bin/ldd to the list of cross-tools >> > in Makefile.inc1 ? It is a small program and should not increase >> > the build time in any significant way. >> > >> > Otherwise, does anyone know the magic to build a cross-arch >> > version of a program in the FreeBSD source tree ? >> >> objdump IMO is a lot easier to parse and it's already built via cross-tools: >> >> $ objdump -x `which tar` | awk '$1 == "NEEDED" { print $2 }' >> libarchive.so.5 >> libbz2.so.4 >> libz.so.6 >> liblzma.so.5 >> libbsdxml.so.4 >> libcrypto.so.6 >> libc.so.7 > > wonderful, thanks! Np! The only gap with both of these tools is that you have to watch out for dl_open'ed binaries as they won't show up in ldd/objdump -x. If I could figure out how to detect these with a command line tool, I would be set for life :). Thanks, -Garrett