diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1c59d83fe5..dda5338bb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,6 +174,7 @@ jobs: - i686-pc-windows-msvc - i686-unknown-linux-gnu - i686-unknown-linux-musl + - mipsel-unknown-linux-gnu - x86_64-pc-windows-gnu - x86_64-pc-windows-msvc - x86_64-apple-darwin @@ -259,6 +260,9 @@ jobs: - target: i686-unknown-linux-musl host_os: ubuntu-18.04 + - target: mipsel-unknown-linux-gnu + host_os: ubuntu-18.04 + - target: x86_64-pc-windows-gnu host_os: windows-latest diff --git a/build.rs b/build.rs index 64d78b8aa9..84010f43a0 100644 --- a/build.rs +++ b/build.rs @@ -39,13 +39,13 @@ const RING_SRCS: &[(&[&str], &str)] = &[ (&[], "crypto/limbs/limbs.c"), (&[], "crypto/mem.c"), (&[], "crypto/poly1305/poly1305.c"), + (&[], "crypto/curve25519/curve25519.c"), + (&[], "crypto/fipsmodule/ec/ecp_nistz.c"), + (&[], "crypto/fipsmodule/ec/p256.c"), (&[AARCH64, ARM, X86_64, X86], "crypto/crypto.c"), - (&[AARCH64, ARM, X86_64, X86], "crypto/curve25519/curve25519.c"), - (&[AARCH64, ARM, X86_64, X86], "crypto/fipsmodule/ec/ecp_nistz.c"), (&[AARCH64, ARM, X86_64, X86], "crypto/fipsmodule/ec/gfp_p256.c"), (&[AARCH64, ARM, X86_64, X86], "crypto/fipsmodule/ec/gfp_p384.c"), - (&[AARCH64, ARM, X86_64, X86], "crypto/fipsmodule/ec/p256.c"), (&[X86_64, X86], "crypto/cpu-intel.c"), @@ -303,6 +303,10 @@ fn main() { fn ring_build_rs_main() { use std::env; + if env::var("CARGO_CFG_TARGET_ENDIAN").unwrap() == "big" { + panic!("Big-endian targets are not supported yet"); + } + let out_dir = env::var("OUT_DIR").unwrap(); let out_dir = PathBuf::from(out_dir); diff --git a/mk/cargo.sh b/mk/cargo.sh index 85a1cbc385..9a1b16d1af 100755 --- a/mk/cargo.sh +++ b/mk/cargo.sh @@ -20,6 +20,8 @@ IFS=$'\n\t' rustflags_self_contained="-Clink-self-contained=yes -Clinker=rust-lld" qemu_aarch64="qemu-aarch64 -L /usr/aarch64-linux-gnu" qemu_arm="qemu-arm -L /usr/arm-linux-gnueabihf" +qemu_mipsel="qemu-system-mipsel -L /usr/mipsel-linux-gnu" +qemu_mips64el="qemu-system-mips64el -L /usr/mips64el-linux-gnu" # Avoid putting the Android tools in `$PATH` because there are tools in this # directory like `clang` that would conflict with the same-named tools that may @@ -87,6 +89,18 @@ case $target in export AR_i686_unknown_linux_musl=llvm-ar-$llvm_version export CARGO_TARGET_I686_UNKNOWN_LINUX_MUSL_RUSTFLAGS="$rustflags_self_contained" ;; + mipsel-unknown-linux-gnu) + export CC_mipsel_unknown_linux_gnu=mipsel-linux-gnu-gcc + export AR_mipsel_unknown_linux_gnu=mipsel-linux-gnu-gcc-ar + export CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_LINKER=mipsel-linux-gnu-gcc + export CARGO_TARGET_MIPSEL_UNKNOWN_LINUX_GNU_RUNNER="$qemu_mipsel" + ;; + mips64el-unknown-linux-gnuabi64) + export CC_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnu-gcc + export AR_mips64el_unknown_linux_gnuabi64=mips64el-linux-gnu-gcc-ar + export CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_LINKER=mips64el-linux-gnu-gcc + export CARGO_TARGET_MIPS64EL_UNKNOWN_LINUX_GNUABI64_RUNNER="$qemu_mips64el" + ;; x86_64-unknown-linux-musl) export CC_x86_64_unknown_linux_musl=clang-$llvm_version export AR_x86_64_unknown_linux_musl=llvm-ar-$llvm_version diff --git a/mk/install-build-tools.sh b/mk/install-build-tools.sh index db50246e8d..87f2dd1921 100755 --- a/mk/install-build-tools.sh +++ b/mk/install-build-tools.sh @@ -65,6 +65,18 @@ case $target in --target=i686-unknown-linux-musl|--target=x86_64-unknown-linux-musl) use_clang=1 ;; +--target=mipsel-unknown-linux-gnu) + install_packages \ + qemu-user \ + gcc-mipsel-linux-gnu \ + libc6-dev-mipsel-cross + ;; +--target=mips64el-unknown-linux-gnu) + install_packages \ + qemu-user \ + gcc-mips64el-linux-gnu \ + libc6-dev-mips64el-cross + ;; --target=wasm32-unknown-unknown) # The version of wasm-bindgen-cli must match the wasm-bindgen version. wasm_bindgen_version=$(cargo metadata --format-version 1 | jq -r '.packages | map(select( .name == "wasm-bindgen")) | map(.version) | .[0]')