On 3/14/12 11:32 PM, Bryan Kadzban wrote:
> It *almost* looks like sysroot is the equivalent of a DESTDIR install,
> where all the libs are installed into<sysroot prefix>/whatever/path,
> but ask for /whatever/path at runtime (e.g. when ld.so is looking for
> DT_NEEDED entries, or in DT_RPATH entries in libs themselves, or when
> the new compiler is run and it tries to find includes) -- is that
> accurate, or not really?

Yes, it's like that. If you configure sysroot to be /mnt/lfs then by 
default gcc will look in /mnt/lfs/usr/include, etc. for system headers 
and so on. But in the proposed method, because we've also swapped out 
all hard coded instances of /usr and /lib to be /tools and /tools/lib, 
then sysroot is actually configured for /mnt/lfs/tools/include etc.

Which is all good, it's just enough to get our libc running and then we 
build a native compiler and linker that looks in /tools and not 
/mnt/lfs/tools

> (I assume your home directory on quantum still has the current proposed
> diffs?)

Yes. http://linuxfromscratch.org/~jhuntwork/sysroot/

> <possibly not-well-founded opinions below...>
>
> If upstream does endorse sysroot as the way all cross compilers should
> be built, I'm not sure I buy that argument.  (But that might just be
> because it's different.  :-/)  I'm also not sure if they actually do;
> I've heard both this and its opposite asserted.

It's true, we aren't building a full cross compiler, nor am I proposing 
we make full advantage of what sysroot is intended for (although it is 
conceivable to cross build your entire system and bypass chapter 5 
completely, I think CLFS has done this). However, upstream has provided 
the functionality, and their devs have evaluated our cross->native build 
method and said 'use sysroot'. Greg says I'm hanging on to this fact 
'doggedly', but I think it's an important consideration. And I disagree 
that our needs are so foreign to toolchain devs - they may not have the 
same goals and motivation as we do, but they will definitely understand 
what we are trying to achieve and are therefore some of the best people 
to offer technical opinions.

> If I understand what it is, then I think sysroot is a good idea for real
> cross compilation, where the host can't execute binaries built for the
> target, because you'll need a different ld.so.  But we're not doing
> that, either, except possibly when converting from a 32-bit system under
> a 32-bit kernel, to a 64-bit system (either multilib or pure64); the old
> kernel won't load the new binaries.

No, we're not - but we are trying to keep anything from the host 'out'. 
We go to great lengths to make sure that the toolchain is kept 'clean' 
from the host system and from what I've seen, this is the best way to do it.

JH
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to