Skip to content

Instantly share code, notes, and snippets.

@taiki-e
Last active December 9, 2022 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taiki-e/3c7891e8c5f5e0cbcb44d7396aabfe10 to your computer and use it in GitHub Desktop.
Save taiki-e/3c7891e8c5f5e0cbcb44d7396aabfe10 to your computer and use it in GitHub Desktop.
#!/bin/bash
# SPDX-License-Identifier: Apache-2.0 OR MIT
set -euo pipefail
IFS=$'\n\t'
for target in $(rustc --print target-list); do
cfgs=$(rustc --print cfg --target "${target}")
if ! grep <<<"${cfgs}" -q "target_has_atomic=\"64\""; then
# target doesn't has `Atomic{i,U}64`
continue
fi
if grep <<<"${cfgs}" -q "target_has_atomic_equal_alignment=\"64\""; then
# `Atomic{i,U}64` and `{i,u}64` has the same alignment
continue
fi
if rustup target list | grep -Eq "^${target}( |$)"; then
echo "${target}"
else
echo "${target} (tier 3)"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment