Package: qemu-user-binfmt
Version: 1:2.1+dfsg-12+deb8u1

This likely affects all releases and other architectures.

I was helping a user on IRC #debian who was having problems completing the 
build of a PPC64LE chroot on amd64.

The specific problem was early failure of "/debootstrap/debootstrap 
--second-stage" with:

/sbin/ldconfig.real: Syntax error: "(" unexpected

Using strace I eventually noticed that the ELF header of "/sbin/ldconfg.real" did not 
match the magic defined in "/usr/share/binfmts/qemu-ppc64le".

The specific issue appears to be that "ldconfig.real" is statically linked and 
byte offset 0x07 is 0x03, which doesn't match the binfmt magic.

"debian/binfmt-update-in" currently contains:

ppc64le_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00'
ppc64le_mask='\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00'

but it should have mask byte offset 0x07 = 0xfc:

ppc64le_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00'
ppc64le_mask='\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00'

                                           ^^^


A manual workaround:

# copy this to /usr/share/binfmts/qemu-ppc64le
# install it using "sudo update-binfmts --import qemu-ppc64le
package qemu-user-static
interpreter /usr/bin/qemu-ppc64le-static
credentials yes
offset 0
magic \x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15\x00
mask 
\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\x00


--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to