target-ppc/linux-user: NPTL support
Quoted 5 lines
Quoted 3 lines · Laurent Vivier
Quoted 2 lines
chroot#
/bin/uname
bash:/bin/uname: No such file or directory
Quoted 8 lines
Quoted 2 lines
Did you configure
binfmt_misckernel module to load PPC binaries with qemu-ppc ?Yes:
$ cat /proc/sys/fs/binfmt_misc/qemu-ppc enabled interpreter /usr/bin/qemu-ppc
so qemu must be located at /usr/bin/ not / under your chrooted filesystem.
Quoted 4 lines
flags:
offset 0
magic7f454c4601020100000000000000000000020014
mask fffffffffffffffffffffffffffffffffbffffff
Laurent
Signature · 3 lines
--------------------- [email protected] --------------------- "Tout ce qui est impossible reste à accomplir" Jules Verne "Things are only impossible until they're not" Jean-Luc Picard
Quoted 5 lines · Laurent Vivier
Quoted 3 lines
$ cat /proc/sys/fs/binfmt_misc/qemu-ppc enabled interpreter /usr/bin/qemu-ppcso qemu must be located at
/usr/bin/not / under your chrooted filesystem.
Ah, wow.
So it was a bug on my side, now it works!
OTOH, there is an other odd error. Here is a sample test program:
#include <stdio.h>
#include <sys/stat.h>
int main()
{
struct stat buf;
if (stat("usr/bin/ls", &buf)) {
printf("not found\n");
} else {
printf("found\n");
}
return 0;
}host$ ppc-frugalware-linux-gcc hello2.c -o hello2
host$ file hello2
hello2: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.4.3, not stripped
host$ ./hello2
found
host$ sudo chroot .
chroot:/# ./hello2
not found
chroot:/# grep usr hello2.c
if (stat("usr/bin/ls", &buf)) {
chroot:/# ls usr/bin/ls
usr/bin/lsIs it a bug that stat() does not found what ls does, or have I missed something? :)
Thanks.
PS: Just in case somebody wants to play with it, here is the PPC chroot tarball I'm using:
http://ftp.frugalware.org/pub/frugalware/frugalware-1.0-iso/fwchroot-1.0-ppc.tar.bz2