Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 Jan 2012 14:52:00 -0800
From:      Oleksandr Tymoshenko <gonzo@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   Re: add 'ldd' to cross-tools ?
Message-ID:  <4F04D810.60304@freebsd.org>
In-Reply-To: <20120104222315.GA73613@onelab2.iet.unipi.it>
References:  <20120104222315.GA73613@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On 04/01/2012 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 ?

AFAIK ldd can't be used as a cross-tool. It sets some env
variables for loader (e.g. ld-elf.so), calls execve
or dlopen and relies on ld.so to print all the required data.
You might get away with it on amd64/i386 host-target pair
but it's not going to work for i386/arm or i386/mips pair.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F04D810.60304>