-   Linux From Scratch (
-   -   in chroot compiled programs do not work in chroot (

graphit 04-10-2010 03:51 PM

in chroot compiled programs do not work in chroot
I just ran into a problem after installing glibc in chapter 6.9 (LFS6.6 x86_64).
All the programs, compiled so far after chrooting (really only the compiled ones) refuse to run, each printing the output

root:/# localedef
bash: /usr/bin/localedef: No such file or directory

(localedef as an example)

It is definitly there:

root:/# ls -l /usr/bin
total 2080
-rwxr-xr-x 1 root root    3388 Apr 10 08:14 catchsegv
-rwxr-xr-x 1 root root  74108 Apr 10 08:14 gencat
-rwxr-xr-x 1 root root  46989 Apr 10 08:14 getconf
-rwxr-xr-x 1 root root  68605 Apr 10 08:14 getent
-rwxr-xr-x 1 root root  213291 Apr 10 08:14 iconv
-rwxr-xr-x 1 root root    5659 Apr 10 08:14 ldd
-rwxr-xr-x 1 root root  110451 Apr 10 08:14 locale
-rwxr-xr-x 1 root root 1240773 Apr 10 08:14 localedef
-rwxr-xr-x 1 root root    6473 Apr 10 08:14 mtrace
-rwxr-xr-x 1 root root  26247 Apr 10 08:14 pcprofiledump
lrwxrwxrwx 1 root root      15 Apr  6 15:28 perl -> /tools/bin/perl
-rwxr-xr-x 1 root root  222827 Apr 10 08:14 rpcgen
-rwxr-xr-x 1 root root  71398 Apr 10 08:14 sprof
-rwxr-xr-x 1 root root    7131 Apr 10 08:14 tzselect
-rwxr-xr-x 1 root root    5320 Apr 10 08:14 xtrace

The complete amount of toolchain-programs is doing their jobs quite well (also in chroot), so I do not think I completely failed in compiling gcc in chapter 5.10, as they seem to be host independent.
In addition to this the compilation of glibc worked without any problems (except the posix/annexc test)

When used from the host-distribution they run quite well:

$ /media/LFS/usr/bin/localedef
»localedef --help« oder »localedef --usage« gibt weitere Informationen.

I do not know how to get around this, although I am quite sure the problem is the dynamic linker.

I am looking forward to your answers!:)
Thanks for all replies!

crts 04-10-2010 05:20 PM


did you make sure that in your chroot environment you have a symlink lib64 -> lib? Also post the output of

ldd $LFS/usr/bin/localedef
readelf -a $LFS/usr/bin/localedef | grep interpreter

You can also execute the above commands in your chroot environment but then you will have to ommit the $LFS variable.

graphit 04-11-2010 03:04 AM

OK, the problem was much simpler than I thought:
The dynamic linker was not in place.

The reason for this:
I am using the DESTDIR method for installing programs, and when copying the files from $FAKEROOT to / I lost all the /lib64 and /usr/lib64 files because of this:

root:/# cp -r /usr/pkglog/fakeroot/lib64 /
cp: cannot overwrite non-directory `/lib64' with directory `/usr/pkglog/fakeroot/lib64'

Thank you very much, all is working now!

All times are GMT -5. The time now is 09:57 AM.