Package: fakechroot Version: 2.14-1 Severity: normal Hi,
we've been experimenting with using fakechroot on amd64 for an armel chroot (to build an armel root filesystem for an embeded device as user). And we found 3 problems: 1) /lib/ld-linux.so.3 not found The armel binaries use a different ld.so which is only found INSIDE the chroot. The exec call (kernel actually) only looks OUTSIDE the chroot. So it tries to find the armel ld.so on the amd64 system and fails. What it should do is to call '$CHROOT/lib/ld-linux.so.3 arg[0] arg[1] ...'. This would involve parsing the elf file to extract the ld.so string and prefixing it with the chroot path. This would also solve the problem of incompatibilities between the system ld.so and the chroot libs. 2) LD_PRELOAD=libfakechroot.so fails By default LD_LIBRARY_PATH in a chroot will be set to (from memory) /usr/lib/fakechroot:/usr/lib32/fakechroot:$CHROOT/lib:$CHROOT/usr/lib Now the problem is that /usr/lib/fakechroot/libfakechroot.so is amd64 and /usr/lib32/fakechroot/libfakechroot.so is i386. But what we need is armel, specifically $CHROOT/usr/lib/fakechroot/libfakechroot.so from the libfakechroot installed in the chroot. What I propose is to parse LD_LIBRARY_PATH and to add each entry again but prefixed with $CHROOT. 3) LD_LIBRARY_PATH is hardcoded to the native and biarch architecture When executing an armel binary the armel libfakechroot.so can not be loaded because the LD_LIBRARY_PATH is too narrow. The fakechroot binary hardcodes the path to /usr/lib/fakechroot:/usr/lib32/fakechroot (or equivalent for other archs). Since my system is setup for armel binaries too it shuld also include /usr/arm-linux-gnueabi/lib/fakechroot. In general it should parse /etc/ld.so.conf and for each dir it should check $DIR/fakechroot. Alternatively (and for future multiarch packages) the fakechroot package could drop a file in /etc/fakechroot/<arch>.conf listing the directory to add to LD_LIBRARY_PATH. Installing fakechroot:armel would then add the armel library dir. But that would be less flexible. There is already another bugreport that fakechroot should parse $CHROOT/etc/ld.so.conf when chrooting so option 1 would result in some reusable code. It could then also add $CHROOT/$DIR/fakechroot to LD_LIBRARY_PATH in the same pass. That would solve problem 2 in a better way I think. MfG Goswin PS: debian/rules should use dh $@ --parallel -- System Information: Debian Release: squeeze/sid APT prefers unstable APT policy: (666, 'unstable'), (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-debian-xen-1 (SMP w/4 CPU cores) Locale: LANG=C, LC_CTYPE=de_DE (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/dash Versions of packages fakechroot depends on: ii libc6 2.11.2-5 Embedded GNU C Library: Shared lib fakechroot recommends no packages. Versions of packages fakechroot suggests: ii libc6-i386 2.11.2-5 Embedded GNU C Library: 32-bit sha -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org