qemu-user-static for sparc32plus : bash: fork: Invalid argument On Debian x86-64 host system I setup a sparc chroot using: host $ mkdir sparc host $ sudo debootstrap --arch=sparc --foreign wheezy sparc http://ftp.au.debian.org/debian host $ sudo cp ~/Git/qemu/sparc32plus-linux-user/qemu-sparc32plus sparc/usr/bin/qemu-sparc32plus-static host $ LANG=C sudo chroot sparc/ /usr/bin/qemu-sparc32plus-static /bin/bash When I then run the second stage of debootstrap I get: target $ /debootstrap/debootstrap --second-stage bash: fork: Invalid argument The above procedures works perfectly for armhf. This is with current git HEAD (commit 93b6599734f81328ee3d608f57667742cafeea72). This is due to QEMU sparc32plus-linux-user not being compiled with NPTL support. Dillon Amburgey wrote: > This is due to QEMU sparc32plus-linux-user not being compiled with NPTL > support. I just check, and NPTL is enabled. I also did this on the binary I compiled: $ strings /usr/bin/qemu-sparc32plus-static | grep nptl ../nptl/sysdeps/pthread/createthread.c ../nptl/pthread_mutex_lock.c nptl-init.c ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c which suggests that it has been compiled with NPTL. What I mean is that QEMU isn't compiled with guest support for NPTL on every architecture. If you look in the configure script around line 3900, you'll see some architectures have target_nptl="yes" while others (including sparc) do not. Unfortunately it looks like the code isn't complete for sparc support, so it isn't a simple matter of enabling it in the configure script. The reason you get "bash: fork: Invalid argument" is because glibc makes a call to clone() with NPTL arguments that aren't supported. This bug should be fixed by a combination of: * the enable-NPTL-everywhere patchset: http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg02614.html * a fix for pipe() on sparc: http://lists.nongnu.org/archive/html/qemu-devel/2013-07/msg01072.html which I hope will make it into QEMU 1.6. This was fixed years ago...