[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#819069: dietlibc: FTBFS on powerpcspe due to missing FPU emulation in library

On 03/27/2016 11:08 PM, John Paul Adrian Glaubitz wrote:
>> [1] Of course, if you know how to properly set up a qemu-based chroot
>>     on amd64, that'd also be sufficient for me. But I did try to
>>     debootstrap with the http://antcom.de/powerpcspe/ repository
>>     according to <https://wiki.debian.org/PowerPCSPEPort>, but
>>     qemu-ppc-static doesn't like it and I get "illegal instruction",
>>     regardless of what binary I try to execute. qemu-ppc-static does
>>     work for the 'powerpc' architecture in that fashion. (I'm using
>>     QEMU 2.5 btw.)
> The reason why that doesn't work is because you need to tell qemu
> to switch the CPU type to e500v2 as it defaults to standard powerpc
> CPU emulation which doesn't support some of the powerpcspe instructions.

Ah, this already helped me. Now I can at least run executables via
qemu-ppc-static if I set the QEMU_CPU=e500v2 environment variable.

Doesn't allow me to actually create a build environment though, because
a LOT of packages required to actually create a root filesystem are not
yet compiled for powerpcspe in the official debian-ports repository.

When using debootstrap --variant=minbase there are a couple of packages
still not compiled yet that are more than essential for debootstrap to
actually work. The most prominent among them:

apt, base-passwd, bash, findutils, gzip, gnupg, insserv, procps, shadow

If you want to try yourself:

# (make sure qemu-user-static is installed)
debootstrap --arch powerpcspe --foreign --variant=minbase \
  --keyring /usr/share/keyrings/debian-archive-keyring.gpg \
  --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg \
  sid ppcspe ftp://ftp.debian-ports.org/debian/
cp /usr/bin/qemu-ppc-static ppcspe/usr/bin/
QEMU_CPU=e500v2 chroot ppcspe /debootstrap/debootstrap \
  --second-stage --verbose --keep-debootstrap-dir

(Also, I'd recommend a different mirror, ftp.debian-ports.org is not
that fast. I've set up a local apt-cacher-ng for this kind of stuff

The first command will fail directly, but if you add --exclude=apt,
it will at least download stuff and claim it's done. But then the
--second-stage command will fail (you'll have to look at
ppcspe/debootstrap/debootstrap.log to see that it fails because zcat
isn't available, and if you fix that by copying the amd64 version of
zcat into the chroot together with the required libraries, other
things start to go wrong because of missing packages).

> You can try the following to boot qemu in system mode with e500v2
> emulation:
> qemu-system-ppc -cpu e500v2 -M mpc8544ds -enable-kvm -m 2047 -bios
> ./u-boot.e500 -nographic -kernel ./uImage-kvm-guest -drive
> file=debian_ppcspe.img,index=0,if=virtio -net nic,vlan=0,model=e1000
> -net user,vlan=0 -append "rw root=/dev/vda1"

Unfortunately, that doesn't help me without a proper rootfs. :(

> I will get back to you once I have obtained both a filesystem image
> as well as a usable kernel. But creating the image should be possible
> with vmdebootstrap at least: https://wiki.debian.org/vmdebootstrap

vmdebootstrap uses debootstrap internally, so see above.

Anyway, I'm going to have to wait until I'm either able to create
a powerpcspe chroot for building things or you have a rootfs image
available. (rootfs is actually sufficient, I can just unpack that
and use it as a chroot, I don't really need a kernel now.)


Attachment: signature.asc
Description: OpenPGP digital signature

Reply to: