This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to build a cross-ld that behaves like a native ld?


On Friday 27 January 2006 05:20 pm, Daniel Jacobowitz wrote:
> On Fri, Jan 27, 2006 at 05:10:09PM -0500, Jon Ringle wrote:
> > Let me try to explain some background in a nutshell (more info at
> > http://scratchbox.org):
> >
> > scratchbox provides a chroot environment that gives you enough tools to
> > cross build a system from source. It wraps the execution of binaries so
> > that they are run either by CPU emulation (QEMU) or marshalling to a
> > target device if the binary is not a native one (I believe this is done
> > via binfmt_misc). When you first create a scratchbox you effectively have
> > an empty / directory. So, when the cross toolchain is used at first, the
> > linker needs to search the target library path as specified in
> > --with-sysroot. However, as I start to build things and populate the
> > chroot'd /lib and /usr/lib, I also need the toolchain to search these as
> > well.
>
> The one doesn't follow from the other.
>
> Is the toolchain you're building supposed to run on the host, targeting
> the scratchbox setup, or within an "unpopulated" chroot as a target
> (emulated/remote executed) binary?  If the former, I can't see why it
> should target /lib; if the latter, I can't see why it should target
> /path/to/box/lib.

The toolchain runs on the host and targets a foreign cpu (armv5b in my case), 
but the toolchain is executed inside of the scratchbox. Because scratchbox 
provides a mechanism to execute the target binaries from the host, configure 
scripts also believe that they are running in a native environment. 
scratchbox also initially has /lib and /usr/lib unpopulated so that I can 
populate them with target libs that I build with the toolchain. The toolchain 
provides a set of target libs for "bootstrapping" purposes 
in /scratchbox/compilers/mytoolchain/mytarget/lib/ which is derived from 
--with-sysroot. I really need my ld to search both. And also obey all the 
rules that a native ld would do in regards to LD_LIBRARY_PATH 
and /etc/ld.so.conf as well.

Jon


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]