LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (http://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   in chroot compiled programs do not work in chroot (http://www.linuxquestions.org/questions/linux-from-scratch-13/in-chroot-compiled-programs-do-not-work-in-chroot-801259/)

graphit 04-10-2010 04:51 PM

in chroot compiled programs do not work in chroot
 
Hallo,
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
Code:

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

(localedef as an example)

It is definitly there:
Code:

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:
Code:

$ /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 06:20 PM

Hi,

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

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 04: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:
Code:

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 10:02 PM.