Skip to contentSkip to conversation

s390x cross Docker target

PATCH In review Alex Bennée 3 participants 5 messages Feb 27, 2017 – Feb 28, 2017

lore
Share & tools
lore
#0 lore raw

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
#1 lore raw

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).

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.docker
tests/docker/dockerfiles/debian-s390x-cross.docker new file +22 -0
new file mode 100644
index 0000000000..bbb21ed088
@@ -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
Tested-by on v1 1/2
#2 lore raw

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).

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.docker
tests/docker/dockerfiles/debian-s390x-cross.docker new file +7 -0
new file mode 100644
index 0000000000..bbb21ed088
@@ -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-
#3 lore raw

PATCH 2/2 .shippable: add s390x-cross target

In reply to Alex Bennée

Use the new debian-s390x-cross.docker target to cross compile for s390.

---
 .shippable.yml | 2 ++
 1 file changed, 2 insertions(+)
.shippable.yml +2 -0
index 1a1fd7a91d..653bd750fe 100644
@@ -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
Reviewed-by on the v1 series
#4 lore raw
In reply to Alex Bennée
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: