Skip to content

Commit fc83e01

Browse files
authoredNov 23, 2022
chore: add tokio_no_atomic_u64 cfg (tokio-rs#5226)
1 parent 3a5f7b7 commit fc83e01

File tree

3 files changed

+75
-12
lines changed

3 files changed

+75
-12
lines changed
 

‎.github/workflows/ci.yml

+21
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- asan
4545
- cross-check
4646
- cross-test
47+
- no-atomic-u64
4748
- features
4849
- minrust
4950
- minimal-versions
@@ -288,6 +289,26 @@ jobs:
288289
env:
289290
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_ipv6
290291

292+
# See https://github.com/tokio-rs/tokio/issues/5187
293+
no-atomic-u64:
294+
name: Test i686-unknown-linux-gnu without AtomicU64
295+
runs-on: ubuntu-latest
296+
steps:
297+
- uses: actions/checkout@v3
298+
- name: Install Rust ${{ env.rust_nightly }}
299+
uses: actions-rs/toolchain@v1
300+
with:
301+
toolchain: ${{ env.rust_nightly }}
302+
components: rust-src
303+
override: true
304+
# Install linker and libraries for i686-unknown-linux-gnu
305+
- uses: taiki-e/setup-cross-toolchain-action@v1
306+
with:
307+
target: i686-unknown-linux-gnu
308+
- run: cargo test -Zbuild-std --target target-specs/i686-unknown-linux-gnu.json -p tokio --all-features
309+
env:
310+
RUSTFLAGS: --cfg tokio_unstable -Dwarnings --cfg tokio_no_atomic_u64
311+
291312
features:
292313
name: features
293314
runs-on: ubuntu-latest
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"arch": "x86",
3+
"cpu": "pentium4",
4+
"crt-static-respected": true,
5+
"data-layout": "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-f64:32:64-f80:32-n8:16:32-S128",
6+
"dynamic-linking": true,
7+
"env": "gnu",
8+
"has-rpath": true,
9+
"has-thread-local": true,
10+
"llvm-target": "i686-unknown-linux-gnu",
11+
"max-atomic-width": 32,
12+
"os": "linux",
13+
"position-independent-executables": true,
14+
"pre-link-args": {
15+
"gcc": [
16+
"-m32"
17+
]
18+
},
19+
"relro-level": "full",
20+
"stack-probes": {
21+
"kind": "inline-or-call",
22+
"min-llvm-version-for-inline": [
23+
16,
24+
0,
25+
0
26+
]
27+
},
28+
"supported-sanitizers": [
29+
"address"
30+
],
31+
"supported-split-debuginfo": [
32+
"packed",
33+
"unpacked",
34+
"off"
35+
],
36+
"target-family": [
37+
"unix"
38+
],
39+
"target-pointer-width": "32"
40+
}

‎tokio/src/macros/cfg.rs

+14-12
Original file line numberDiff line numberDiff line change
@@ -462,12 +462,13 @@ macro_rules! cfg_has_atomic_u64 {
462462
($($item:item)*) => {
463463
$(
464464
#[cfg(not(any(
465-
target_arch = "arm",
466-
target_arch = "mips",
467-
target_arch = "powerpc",
468-
target_arch = "riscv32",
469-
tokio_wasm
470-
)))]
465+
target_arch = "arm",
466+
target_arch = "mips",
467+
target_arch = "powerpc",
468+
target_arch = "riscv32",
469+
tokio_wasm,
470+
tokio_no_atomic_u64,
471+
)))]
471472
$item
472473
)*
473474
}
@@ -477,12 +478,13 @@ macro_rules! cfg_not_has_atomic_u64 {
477478
($($item:item)*) => {
478479
$(
479480
#[cfg(any(
480-
target_arch = "arm",
481-
target_arch = "mips",
482-
target_arch = "powerpc",
483-
target_arch = "riscv32",
484-
tokio_wasm
485-
))]
481+
target_arch = "arm",
482+
target_arch = "mips",
483+
target_arch = "powerpc",
484+
target_arch = "riscv32",
485+
tokio_wasm,
486+
tokio_no_atomic_u64,
487+
))]
486488
$item
487489
)*
488490
}

0 commit comments

Comments
 (0)