chroot'd toolchain & gnu libc issue? (was Re: Proper use of libtool under buildroot?)

Peter S. Mazinger ps.m at gmx.net
Mon Dec 12 09:27:15 UTC 2005


On Mon, 12 Dec 2005, Marcus Crafter wrote:

> 
> >> The only thing is once I chroot into the new environment, all of the
> >> build related tools from the toolchain don't work because it seems
> >> that they are linked to libc.so.6 (GNU libc?) which doesn't exist in
> >> the uclibc root environment right?
> >
> > you can't chroot into staging_dir, because those are really linked
> > against host libs (that is the cross-compiler toolchain), you have to
> > create the minimal dev env for target (binutils/gcc/uclibc and so on,
> > like flex,bison,m4) as well and chroot there
> 
> It wasn't the staging_dir that I tried this in, it was the root dir,  
> ie.  buildroot/buid_i386/root.
> 
> In the buildroot 'make menuconfig' options I selected '[*] native  
> toolchain in the target filesystem' (the help for this option says  
> 'If you want the target system to be able to run binutils/gcc and  
> compile native code, say Y here'), and that's how I checked the gcc/ 
> ld, etc that was in my root build area and saw the behaviour below.
> 
> I thought from the description above that this particular package  
> option would build a native gcc/ld for the root area which I could  
> use to chroot into and build further applications - I haven't checked  
> the makefiles just yet but perhaps it simply copies the cross  
> compilation tool chain in to the root area rather than buliding a  
> fresh one (?). Not sure.
> 
> Is this what you mean by creating a minimal dev environment for the  
> target? Or am I still a bit confused and should be looking to do this  
> another way? ie. manually?
> 
> Hope to hear from you soon.

something is really wrong then, those files shouldn't depend on host libc

try to use readelf -d instead of ldd

> >> eg:
> >>
> >> bellagio[/home/crafterm/workspace/new/buildroot/build_i386]:121>sudo
> >> chroot root
> >> bellagio[/]:1>cd /usr/bin
> >> bellagio[/usr/bin]:2>./i386-linux-uclibc-gcc
> >> bash: ./i386-linux-uclibc-gcc: No such file or directory
> >> bellagio[/usr/bin]:3>ldd ./i386-linux-uclibc-gcc
> >>          libc.so.6 => not found (0x00000000)
> >>          /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
> >> bellagio[/usr/bin]:4>ldd ld
> >>          libc.so.6 => not found (0x00000000)
> >>          /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x00000000)
> >> bellagio[/usr/bin]:5>
> >>
> >> Have I perhaps built the toolchain incorrectly? Shouldn't they be
> >> linked against the uclibc libc shared library?

they should

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list