Skip to content

Commit

Permalink
Handle min-atomic-width in no_atomic.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 28, 2023
1 parent 6871c00 commit 56397a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ci/no_atomic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ for target in $(rustc --print target-list); do
res=$(jq <<<"${target_spec}" -r 'select(."atomic-cas" == false)')
[[ -z "${res}" ]] || no_atomic_cas+=("${target}")
max_atomic_width=$(jq <<<"${target_spec}" -r '."max-atomic-width"')
min_atomic_width=$(jq <<<"${target_spec}" -r '."min-atomic-width"')
case "${max_atomic_width}" in
# It is not clear exactly what `"max-atomic-width" == null` means, but they
# actually seem to have the same max-atomic-width as the target-pointer-width.
Expand All @@ -35,6 +36,10 @@ for target in $(rustc --print target-list); do
# There is no `"max-atomic-width" == 16` or `"max-atomic-width" == 8` targets.
*) exit 1 ;;
esac
case "${min_atomic_width}" in
8 | null) ;;
*) no_atomic+=("${target}") ;;
esac
done

cat >"${file}" <<EOF
Expand Down
3 changes: 3 additions & 0 deletions no_atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const NO_ATOMIC_64: &[&str] = &[
"armv5te-unknown-linux-musleabi",
"armv5te-unknown-linux-uclibceabi",
"armv6k-nintendo-3ds",
"armv7-sony-vita-newlibeabihf",
"armv7r-none-eabi",
"armv7r-none-eabihf",
"avr-unknown-gnu-atmega328",
Expand Down Expand Up @@ -74,6 +75,8 @@ const NO_ATOMIC_64: &[&str] = &[
#[allow(dead_code)] // Only crossbeam-utils uses this.
const NO_ATOMIC: &[&str] = &[
"avr-unknown-gnu-atmega328",
"bpfeb-unknown-none",
"bpfel-unknown-none",
"mipsel-sony-psx",
"msp430-none-elf",
"riscv32i-unknown-none-elf",
Expand Down

0 comments on commit 56397a1

Please sign in to comment.