[oe] cross and staging directories

Richard Purdie rpurdie at rpsys.net
Mon Sep 24 08:51:02 UTC 2007


Hi,

On Mon, 2007-09-24 at 08:38 +0200, Detlef Vollmann wrote:
> Richard Purdie wrote:
> > I've been experimenting a bit in Poky to find out exactly why we need
> > the cross directory.
> > 
> > The motivation for this is the load of files we duplicate in both,
> > particularly linux-libc-headers, headers from glibc-initial, glibc and
> > glibc-intermediate and libs from glibc and glibc-intermediate.
>
> So your idea is to omit the cross directory and install the
> cross compiler inside staging?
> Or to keep the cross compiler in cross, but install the libraries
> in staging only?

Initially, I want to leave the compiler in cross but install libraries
and headers into staging only which is what the patch did.

Whether we can improve things further than that remains to be seen - one
step at a time :).

> Some files are linked in directly from fix places relative to the
> gcc binary.  So if gcc is in cross and you call it with
> '/path-to-cross/bin/powerpc-angstrom-linux-gcc -v hello.c'
> you'll see something like
> /path-to-cross/bin/../libexec/gcc/powerpc-angstrom-linux/4.1.1/collect2 ... \
>  /path-to-cross/bin/../lib/gcc/powerpc-angstrom-linux/4.1.1/crtend.o \
>  /path-to-cross/bin/../lib/gcc/powerpc-angstrom-linux/4.1.1/../../../../powerpc-angstrom-linux/lib/crtn.o
> 
> If you move the compiler somewhere else, only 'path-to-cross' changes,
> but the rest keeps the same.
> 
> So, files like crtsavres.o and crtend.o are taken from
> 'path-to-cross/lib/gcc/powerpc-angstrom-linux/4.1.1'
> while crti.o is taken from
> 'path-to-cross/powerpc-angstrom-linux/lib'
> 
> So, if you install the cross-gcc into staging/bin, everything is fine.
> But if you install the cross-gcc into staging/i686-linux/bin,
> crti.o isn't found anymore.

I understand that. For now I've worked around this by symlinking cross
to staging which to me is neater than having two copies of all these
libs/headers installed (and makes the builds faster and more space
efficient).

In the future I'd prefer to see the symlink removed and the staging
inc/lib paths added into the compiler's default search paths in some
other way. The most promising looking approach for this is to use the
sysroot support since that passes from the compiler to the linker and
binutils and would "just work".

I think this step makes sense regardless of whether we choose sysroot or
not though.

Regards,

Richard





More information about the Openembedded-devel mailing list