Skip to content

Commit

Permalink
Add mips64-unknown-linux-muslabi64 and mips64el-unknown-linux-muslabi…
Browse files Browse the repository at this point in the history
…64 support

Fix #503
  • Loading branch information
abcfy2 committed Mar 16, 2022
1 parent ed729e7 commit 2e60cc1
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 45 deletions.
92 changes: 47 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,60 +86,62 @@ jobs:
fail-fast: false
matrix:
include:
- { target: x86_64-apple-darwin, os: macos-latest, cpp: 1, dylib: 1, std: 1, run: 1, deploy: true }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system, deploy: true }
- { target: x86_64-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1, deploy: true }
- { target: x86_64-pc-windows-msvc, os: windows-latest, cpp: 1, std: 1, run: 1, deploy: true }

- { target: aarch64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: arm-unknown-linux-gnueabi, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: i586-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: i686-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system }
- { target: mips-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: mipsel-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: mips64-unknown-linux-gnuabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: mips64el-unknown-linux-gnuabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: powerpc-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: powerpc64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: powerpc64le-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: riscv64gc-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: s390x-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-system }
- { target: sparc64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-system }
- { target: aarch64-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: arm-unknown-linux-musleabihf, os: ubuntu-latest, std: 1, run: 1 }
- { target: arm-unknown-linux-musleabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv5te-unknown-linux-gnueabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv5te-unknown-linux-musleabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv7-unknown-linux-musleabihf, os: ubuntu-latest, std: 1, run: 1 }
- { target: i586-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: i686-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: mips-unknown-linux-musl, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: mipsel-unknown-linux-musl, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: aarch64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: arm-linux-androideabi, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: armv7-linux-androideabi, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: i686-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: x86_64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: x86_64-pc-windows-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: i686-pc-windows-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: x86_64-apple-darwin, os: macos-latest, cpp: 1, dylib: 1, std: 1, run: 1, deploy: true }
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system, deploy: true }
- { target: x86_64-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1, deploy: true }
- { target: x86_64-pc-windows-msvc, os: windows-latest, cpp: 1, std: 1, run: 1, deploy: true }

- { target: aarch64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: arm-unknown-linux-gnueabi, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: arm-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: armv7-unknown-linux-gnueabihf, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: i586-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: i686-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: native qemu-user qemu-system }
- { target: mips-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: mipsel-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: mips64-unknown-linux-gnuabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: mips64el-unknown-linux-gnuabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: mips64-unknown-linux-muslabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1 }
- { target: mips64el-unknown-linux-muslabi64, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: powerpc-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: powerpc64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: powerpc64le-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-user qemu-system }
- { target: riscv64gc-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: s390x-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-system }
- { target: sparc64-unknown-linux-gnu, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1, run: 1, runners: qemu-system }
- { target: aarch64-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: arm-unknown-linux-musleabihf, os: ubuntu-latest, std: 1, run: 1 }
- { target: arm-unknown-linux-musleabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv5te-unknown-linux-gnueabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv5te-unknown-linux-musleabi, os: ubuntu-latest, std: 1, run: 1 }
- { target: armv7-unknown-linux-musleabihf, os: ubuntu-latest, std: 1, run: 1 }
- { target: i586-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: i686-unknown-linux-musl, os: ubuntu-latest, std: 1, run: 1 }
- { target: mips-unknown-linux-musl, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: mipsel-unknown-linux-musl, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: aarch64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: arm-linux-androideabi, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: armv7-linux-androideabi, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: i686-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: x86_64-linux-android, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: x86_64-pc-windows-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
- { target: i686-pc-windows-gnu, os: ubuntu-latest, cpp: 1, std: 1, run: 1 }
# Disabled, see #396
#-{ target: x86_64-unknown-dragonfly, os: ubuntu-latest, cpp: 1, dylib: 1 }
- { target: i686-unknown-freebsd, os: ubuntu-latest, dylib: 1, std: 1 }
- { target: x86_64-unknown-freebsd, os: ubuntu-latest, dylib: 1, std: 1 }
- { target: x86_64-unknown-netbsd, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1 }
- { target: i686-unknown-freebsd, os: ubuntu-latest, dylib: 1, std: 1 }
- { target: x86_64-unknown-freebsd, os: ubuntu-latest, dylib: 1, std: 1 }
- { target: x86_64-unknown-netbsd, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1 }
# Disabled, see #534
#-{ target: sparcv9-sun-solaris, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1 }
#-{ target: x86_64-sun-solaris, os: ubuntu-latest, cpp: 1, dylib: 1, std: 1 }
# Disabled, see #634
#-{ target: asmjs-unknown-emscripten, os: ubuntu-latest, std: 1, run: 1 }
# `cargo run` fails with an assertion error (https://github.com/rust-lang/cargo/issues/4689) on `wasm32-unknown-emscripten`.
#-{ target: wasm32-unknown-emscripten, os: ubuntu-latest, std: 1 }
- { target: thumbv6m-none-eabi, os: ubuntu-latest, std: 1 }
- { target: thumbv7em-none-eabi, os: ubuntu-latest, std: 1 }
- { target: thumbv7em-none-eabihf, os: ubuntu-latest, std: 1 }
- { target: thumbv7m-none-eabi, os: ubuntu-latest, std: 1 }
- { target: thumbv6m-none-eabi, os: ubuntu-latest, std: 1 }
- { target: thumbv7em-none-eabi, os: ubuntu-latest, std: 1 }
- { target: thumbv7em-none-eabihf, os: ubuntu-latest, std: 1 }
- { target: thumbv7m-none-eabi, os: ubuntu-latest, std: 1 }

steps:
- uses: actions/checkout@v3
Expand Down
30 changes: 30 additions & 0 deletions docker/Dockerfile.mips64-unknown-linux-muslabi64
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:18.04

COPY common.sh lib.sh /
RUN /common.sh

COPY cmake.sh /
RUN /cmake.sh

COPY xargo.sh /
RUN /xargo.sh

COPY qemu.sh /
RUN /qemu.sh mips64

COPY musl.sh /
RUN /musl.sh \
TARGET=mips64-linux-muslsf \
"COMMON_CONFIG += -with-arch=mips64r2"

# This allows qemu run dynamic linked binaries
RUN ln -sf \
/usr/local/mips64-linux-muslsf/lib/libc.so \
/usr/local/mips64-linux-muslsf/lib/ld-musl-mips64-sf.so.1
ENV QEMU_LD_PREFIX=/usr/local/mips64-linux-muslsf

ENV CARGO_TARGET_MIPS64_UNKNOWN_LINUX_MUSLABI64_LINKER=mips64-linux-muslsf-gcc \
CARGO_TARGET_MIPS64_UNKNOWN_LINUX_MUSLABI64_RUNNER=qemu-mips64 \
CC_mips64_unknown_linux_muslabi64=mips64-linux-muslsf-gcc \
CXX_mips64_unknown_linux_muslabi64=mips64-linux-muslsf-g++ \
RUST_TEST_THREADS=1
30 changes: 30 additions & 0 deletions docker/Dockerfile.mips64el-unknown-linux-muslabi64
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:18.04

COPY common.sh lib.sh /
RUN /common.sh

COPY cmake.sh /
RUN /cmake.sh

COPY xargo.sh /
RUN /xargo.sh

COPY qemu.sh /
RUN /qemu.sh mips64el

COPY musl.sh /
RUN /musl.sh \
TARGET=mips64el-linux-muslsf \
"COMMON_CONFIG += -with-arch=mips64"

# This allows qemu run dynamic linked binaries
RUN ln -sf \
/usr/local/mips64el-linux-muslsf/lib/libc.so \
/usr/local/mips64el-linux-muslsf/lib/ld-musl-mips64el-sf.so.1
ENV QEMU_LD_PREFIX=/usr/local/mips64el-linux-muslsf

ENV CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_MUSLABI64_LINKER=mips64el-linux-muslsf-gcc \
CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_MUSLABI64_RUNNER=qemu-mips64el \
CC_mips64el_unknown_linux_muslabi64=mips64el-linux-muslsf-gcc \
CXX_mips64el_unknown_linux_muslabi64=mips64el-linux-muslsf-g++ \
RUST_TEST_THREADS=1

0 comments on commit 2e60cc1

Please sign in to comment.