diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7bad2ca92c7..8c0b01a731a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -93,12 +93,12 @@ jobs: - tokio-no-features - tokio-with-net -# # Try cross compiling -# - template: ci/azure-cross-compile.yml -# parameters: -# name: cross_32bit_linux -# target: i686-unknown-linux-gnu -# +# Try cross compiling +- template: ci/azure-cross-compile.yml + parameters: + name: cross + rust: $(nightly) + # # This represents the minimum Rust version supported by # # Tokio. Updating this should be done in a dedicated PR and # # cannot be greater than two 0.x releases prior to the @@ -127,6 +127,6 @@ jobs: - test_linux - test_features # - test_nightly -# - cross_32bit_linux + - cross # - minrust # - tsan diff --git a/ci/azure-cross-compile.yml b/ci/azure-cross-compile.yml index 8c2553c726d..f0e83f03162 100644 --- a/ci/azure-cross-compile.yml +++ b/ci/azure-cross-compile.yml @@ -1,27 +1,41 @@ jobs: - job: ${{ parameters.name }} displayName: ${{ parameters.displayName }} + strategy: + matrix: + i686: + vmImage: ubuntu-16.04 + target: i686-unknown-linux-gnu + powerpc: + vmImage: ubuntu-16.04 + target: powerpc-unknown-linux-gnu + powerpc64: + vmImage: ubuntu-16.04 + target: powerpc64-unknown-linux-gnu + mips: + vmImage: ubuntu-16.04 + target: mips-unknown-linux-gnu pool: - vmImage: ubuntu-16.04 + vmImage: $(vmImage) steps: - template: azure-install-rust.yml parameters: - rust_version: stable + rust_version: ${{ parameters.rust }} - script: sudo apt-get update - displayName: "apt-get update" + displayName: apt-get update - script: sudo apt-get install gcc-multilib - displayName: "Install gcc-multilib" + displayName: Install gcc-multilib - - script: rustup target add ${{ parameters.target }} - displayName: "Add target" + - script: cargo install cross + displayName: Install cross # Always patch - template: azure-patch-crates.yml - - script: cargo check --all --exclude tokio-tls --target ${{ parameters.target }} + - script: cross check --all --exclude tokio-tls --target $(target) displayName: Check source - - script: cargo check --tests --all --exclude tokio-tls --target ${{ parameters.target }} - displayName: Check tests + # - script: cross check --tests --all --exclude tokio-tls --target $(target) + # displayName: Check tests diff --git a/tokio-timer/src/atomic.rs b/tokio-timer/src/atomic.rs index 3ec7b2f8919..6a592edb4aa 100644 --- a/tokio-timer/src/atomic.rs +++ b/tokio-timer/src/atomic.rs @@ -4,12 +4,15 @@ pub(crate) use self::imp::AtomicU64; -#[cfg(target_pointer_width = "64")] +// `AtomicU64` can only be used on targets with `target_has_atomic` is 64 or greater. +// Once `cfg_target_has_atomic` feature is stable, we can replace it with +// `#[cfg(target_has_atomic = "64")]`. +#[cfg(not(any(target_arch = "mips", target_arch = "powerpc")))] mod imp { pub(crate) use std::sync::atomic::AtomicU64; } -#[cfg(not(target_pointer_width = "64"))] +#[cfg(any(target_arch = "mips", target_arch = "powerpc"))] mod imp { use std::sync::atomic::Ordering; use std::sync::Mutex;