Developing for s390x architecture

Endianness

Linux on IBM Z runs on the s390x architecture. Unlike x86, the s390x architecture is big-endian. Many open source projects only test against little-endian systems, so there may be endian-related bugs lurking. For example, in the Ruby implementation of Protocol Buffers, we fixed a handful of big-endian bugs.

VM provisioning

There are several ways to develop for s390x. You can use:

  • A LinuxONE virtual server.
  • QEMU to emulate s390x.

    Use the following commands to spin up an emulated s390x virtual machine with Docker:

    docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
    docker run --rm -it s390x/ubuntu bash
    

Note that the QEMU virtual machine is usually slower than a LinuxONE machine.

Bazel

Bazel is needed by a number of Google projects, such as Protocol Buffers. When compiling from source, you might run into these fatal compiler warnings. There is a workaround to disable those warnings. In addition, IBM posted these instructions.

Omnibus build image

To build Omnibus GitLab for s390x, you can use this Dockerfile template. Generate the Dockerfile with:

./docker/scripts/generate-dockerfile docker/Dockerfile_debian_10_s390x.erb