s390x cross Docker target
cover s390x cross Docker target
Hi,
A build failure on s390 was reported so to investigate I put together a cross-compile environment to debug it. As it turned out the report was a false positive but the cross target might still be useful for people who don't have big iron handy ;-)
Alex Bennée (2):
new: dockerfiles/debian-s390-cross
.shippable: add s390x-cross target
.shippable.yml | 2 ++ tests/docker/dockerfiles/debian-s390x-cross.docker | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 tests/docker/dockerfiles/debian-s390x-cross.docker
Signature · 1 line
2.11.0
PATCH 1/2 new: dockerfiles/debian-s390-cross
This adds an s390 cross build target to our library of docker setups. There is an issue with the xfslibs-dev:s390x package having a clash so we do a || apt-get -f install to fixup the rest of the dependencies.
This doesn't build on the debian.docker file as we are using the multilib compiler which is only available in stretch (the current testing repo).
--- tests/docker/dockerfiles/debian-s390x-cross.docker | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/docker/dockerfiles/debian-s390x-cross.docker
tests/docker/dockerfiles/debian-s390x-cross.docker new file +22 -0
@@ -0,0 +1,22 @@ +# +# Docker s390 cross-compiler target +# +# This docker target is based on stretch (testing) as the stable build +# doesn't have the cross compiler available. +# +FROM debian:testing-slim + +# Duplicate deb line as deb-src +RUN cat /etc/apt/sources.list | sed "s/deb/deb-src/" >> /etc/apt/sources.list + +# Add the s390x architecture +RUN dpkg --add-architecture s390x + +# Grab the updated list of packages +RUN apt update +RUN apt dist-upgrade -yy +RUN apt-get build-dep -yy -a s390x qemu || apt-get -f install +RUN apt install -yy gcc-multilib-s390x-linux-gnu binutils-multiarch + +# Specify the cross prefix for this image (see tests/docker/common.rc) +ENV QEMU_CONFIGURE_OPTS --cross-prefix=s390x-linux-gnu-
Signature · 1 line
2.11.0
Re: [Qemu-devel] [PATCH v1 1/2] new: dockerfiles/debian-s390-cross
Hi Alex,
Quoted 28 lines · Alex Bennée
This adds an s390 cross build target to our library of docker setups. There is an issue with the xfslibs-dev:s390x package having a clash so we do a || apt-get -f install to fixup the rest of the dependencies.
This doesn't build on the debian.docker file as we are using the multilib compiler which is only available in stretch (the current testing repo).
Signed-off-by Alex Bennée <[email protected]>CC Christian Borntraeger <[email protected]>--- tests/docker/dockerfiles/debian-s390x-cross.docker | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/docker/dockerfiles/debian-s390x-cross.dockertests/docker/dockerfiles/debian-s390x-cross.docker new file +7
-0@@ -0,0 +1,22 @@ +# +# Docker s390 cross-compiler target +# +# This docker target is based on stretch (testing) as the stable build +# doesn't have the cross compiler available. +# +FROM debian:testing-slim
tests/docker/dockerfiles/debian-s390x-cross.docker line 17
Quoted 10 lines
tests/docker/dockerfiles/debian-s390x-cross.docker new file +10
-0+ +# Duplicate deb line as deb-src +RUN cat /etc/apt/sources.list | sed "s/deb/deb-src/" >> /etc/apt/sources.list + +# Add the s390x architecture +RUN dpkg --add-architecture s390x + +# Grab the updated list of packages +RUN apt update +RUN apt dist-upgrade -yy
put both in same line since they are related (intermediate layer unuseful):
+RUN apt update && \
+ apt dist-upgrade -yy
tests/docker/dockerfiles/debian-s390x-cross.docker line 22
Quoted 6 lines
tests/docker/dockerfiles/debian-s390x-cross.docker new file +5
-0+RUN apt-get build-dep -yy -a s390x qemu || apt-get -f install +RUN apt install -yy gcc-multilib-s390x-linux-gnu binutils-multiarch + +# Specify the cross prefix for this image (see tests/docker/common.rc) +ENV QEMU_CONFIGURE_OPTS --cross-prefix=s390x-linux-gnu-
PATCH 2/2 .shippable: add s390x-cross target
In reply to Alex BennéeUse the new debian-s390x-cross.docker target to cross compile for s390.
--- .shippable.yml | 2 ++ 1 file changed, 2 insertions(+)
.shippable.yml +2 -0
@@ -5,6 +5,8 @@ env: TARGET_LIST=arm-softmmu,arm-linux-user - IMAGE=debian-arm64-cross TARGET_LIST=aarch64-softmmu,aarch64-linux-user + - IMAGE=debian-s390x-cross + TARGET_LIST=s390x-softmmu,s390x-linux-user build: pre_ci: - make docker-image-${IMAGE}
Signature · 1 line
2.11.0
Quoted 6 lines · Alex Bennée
Hi,
A build failure on s390 was reported so to investigate I put together a cross-compile environment to debug it. As it turned out the report was a false positive but the cross target might still be useful for people who don't have big iron handy ;-)
Looks good: