play-with-docker: qemu-user not detecting binary format

The test script in 1138-4EB/test-qemu statically cross-compiles a Hello World C program inside a ubuntu:18.04 container and then executes it in a different container with qemu-user. It works as expected in Ubuntu and Fedora hosts (x86_64), and produces the following last two lines:

Hello world!
Hello world!

However, in play-with-docker, this is the result:

bash: ./main: cannot execute binary file: Exec format error
Hello world!

The difference between the two calls to the executable is:

./main; \
qemu-aarch64 ./main

I’d like prepending qemu-aarch64 not to be required, because this is just a stripped down version of a problem produced when trying to cross-compile libelf (where adding it is not so straighforward).

Is there any additional tweak or argument required in play-with-docker for it work?

Just in case it might be relevant, the same error occurs in travis-ci: https://travis-ci.com/1138-4EB/test-qemu/builds/77530556

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

Is it possible to execute PWD in ones own infraestructure with less restrictive permissions?

yes

Does it make any sense to execute register.sh in the hosts where PWD is going to be running, but before PWD is actually executed?

No, we’re not going to do it in PWD servers.