MIPS64

ScarletNX builds for 64-bit MIPS Linux, MIPS64 Release 2 and later with the n64 ABI, big-endian (mips64) and little-endian (mips64el). It is a secondary architecture: CI builds neither, and support is the code and the presets below. No MIPS machine has run it yet; Building says what ran under qemu-user.

Building

The linux-mips64-cross and linux-mips64el-cross presets cross-build with Clang against a system root of the architecture, as PowerPC64's do (PowerPC64), and link with the target's GNU ld. gnu-cross's buildroots (mips64-unknown-linux-gnu.tar.xz, mips64el-unknown-linux-gnu.tar.xz) are one: glibc in <triple>/sysroot, and beside it GNU ld and GCC's runtime (crt files, libgcc, libstdc++), which Clang takes from the folder SNX_GCC_TOOLCHAIN names (CMAKE_C_COMPILER_EXTERNAL_TOOLCHAIN, which cmake/cross.cmake passes on to FFmpeg's, OpenSSL's and the runtime library's compiles as --gcc-toolchain). Their libgcc.a has absolute .eh_frame pointers, which LLD refuses in a position-independent program and GNU ld makes relative.

root=/path/to/mips64el-unknown-linux-gnu
export SNX_SYSROOT=$root/mips64el-unknown-linux-gnu/sysroot SNX_GCC_TOOLCHAIN=$root
cmake --preset linux-mips64el-cross
cmake --build --preset linux-mips64el-cross
ctest --preset linux-mips64el-cross

mips64 in place of mips64el builds the big-endian one. The tests run under qemu-mips64 or qemu-mips64el (CMAKE_CROSSCOMPILING_EMULATOR), with the sysroot as -L; the ones that start a program of the target themselves (a Python driver, a fork and exec) need the kernel to run it through qemu too, a binfmt_misc handler, which Linux 6.7 and later let a user namespace of its own register without root.

The test suite of this build has not been run under qemu-user yet.

What differs from the other hosts


Made from docs/hosts/mips64.md at 69237645142c. GPL-3.0-or-later.