ScarletNX builds for 64-bit IBM Z Linux (s390x), z13 and later. It is a secondary architecture: CI doesn't build it, and support is the code and the preset below. No IBM Z machine has run it yet; Building says what ran under qemu-user.
The linux-s390x-cross preset cross-builds with Clang and LLD against a system root of the architecture, as
MIPS64's does. gnu-cross's buildroot
(s390x-ibm-linux-gnu.tar.xz) is one: glibc in s390x-ibm-linux-gnu/sysroot, and GCC's runtime beside it, which
Clang takes from the folder SNX_GCC_TOOLCHAIN names.
root=/path/to/s390x-ibm-linux-gnu
export SNX_SYSROOT=$root/s390x-ibm-linux-gnu/sysroot SNX_GCC_TOOLCHAIN=$root
cmake --preset linux-s390x-cross
cmake --build --preset linux-s390x-cross
ctest --preset linux-s390x-cross
The tests run under qemu-s390x with the sysroot as -L, and the ones that start a program of the target need a
binfmt_misc handler for it, as MIPS64's do.
The test suite of this build has not been run under qemu-user yet.
cmake/cross.cmake). Before it Clang makes the runtime library's 128-bit shifts calls to
libgcc's __ashlti3 and __lshrti3, and a module links no library to have them.__int128 is 8-byte aligned, which makes it a libatomic call
(snx_cas128 in src/common/cpu/aarch64/helpers/integer.c, src/common/runtime/cas128.c).brasl, PLT32DBL), an address (larl, PC32DBL) and
a GOT slot (GOTENT) reach any module, so its linker (link_elf.c, the relocations in elf_object.c) needs no
veneers, and its GOT and dynamic relocations are x86-64's kind (R_390_RELATIVE). Its .hash has 64-bit words,
as s390x's loaders read it (glibc's Elf_Symndx).HOST_MACHINE in
code_loader.c), so s390x runs only the code the AOT recompiler found, as RISC-V, LoongArch and MIPS64 do. The
back end makes the code such a loader would load; the loader would need s390x's relocations, already in
elf_object.c, and stubs for calls beyond 4 GiB.Made from docs/hosts/s390x.md at 69237645142c. GPL-3.0-or-later.