On Tue, Mar 4, 2008 at 9:24 AM, Ross Nesbitt
<[EMAIL PROTECTED]> wrote:
>
>  when i run /tools/bin/gcc --version in the chroot env i get the following:
>
>  bash: /tools/bin/gcc: No such file or directory
>
>  when i exit chroot and then run /tools/bin/gcc --version as root of the host 
> i get the following:

The "No such file or directory" is a red herring. The problem is that
/tools/bin/gcc has been compiled to use the dynamic linker at
/lib/ld-linux.so.2 when it should have been compiled to use the one in
/tools. You can see this by running "readelf -l /tools/bin/gcc | grep
interpreter", it will say /lib/ld-linux.so.2. So, when you enter the
chroot, /lib/ld-linux-so.2 doesn't exist yet, gcc can't run, and the
error is interpreted as "No such file or directory". When you're
outside the chroot, it is using your host's dynamic linker in /lib.

This problem occurs when the Ch. 5 toolchain adjustment hasn't been
done correctly. So, everything from "Adjusting the toolchain" until
after gcc-pass2 is installed is using the wrong dynamic linker. The
most correct way to fix this would be to redo Ch. 5. The quick fix is
just to make a symlink from /lib/ld-linux.so.2 to
/tools/lib/ld-linux.so.2 in the chroot. It will get wiped out after
you install Ch. 6 glibc, but it should allow gcc to run.

--
Dan
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-support
FAQ: http://www.linuxfromscratch.org/lfs/faq.html
Unsubscribe: See the above information page

Reply via email to