@@ -249,7 +249,7 @@ fn main() {
249
249
// (Since Rust 1.78, Windows (except Windows 7) targets also enable CMPXCHG16B, but
250
250
// this branch is only used on pre-1.69 that cmpxchg16b_target_feature is unstable.)
251
251
// Script to get builtin targets that support CMPXCHG16B by default:
252
- // $ (for target in $(rustc -- print target-list | grep -E '^ x86_64'); do rustc --print cfg --target "${target}" | grep -Fq '"cmpxchg16b"' && printf '%s\n' "${target}"; done)
252
+ // $ (for target in $(rustc -Z unstable-options -- print all- target-specs-json | jq -r '. | to_entries[] | if .value.arch == " x86_64" then .key else empty end '); do rustc --print cfg --target "${target}" | grep -Fq '"cmpxchg16b"' && printf '%s\n' "${target}"; done)
253
253
let is_apple = env:: var ( "CARGO_CFG_TARGET_VENDOR" ) . unwrap_or_default ( ) == "apple" ;
254
254
let cmpxchg16b = is_apple;
255
255
// LLVM recognizes this also as cx16 target feature: https://godbolt.org/z/KM3jz616j
@@ -271,8 +271,8 @@ fn main() {
271
271
// https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/AArch64/AArch64Processors.td#L1203
272
272
// https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/AArch64/AArch64Processors.td#L865
273
273
// Script to get builtin targets that support FEAT_LSE/FEAT_LSE2 by default:
274
- // $ (for target in $(rustc -- print target-list | grep -E '^aarch64|^arm64 '); do rustc --print cfg --target "${target}" | grep -Fq '"lse"' && printf '%s\n' "${target}"; done)
275
- // $ (for target in $(rustc -- print target-list | grep -E '^aarch64|^arm64 '); do rustc --print cfg --target "${target}" | grep -Fq '"lse2"' && printf '%s\n' "${target}"; done)
274
+ // $ (for target in $(rustc -Z unstable-options -- print all- target-specs-json | jq -r '. | to_entries[] | if .value.arch == "aarch64" or .value.arch == "arm64ec" then .key else empty end '); do rustc --print cfg --target "${target}" | grep -Fq '"lse"' && printf '%s\n' "${target}"; done)
275
+ // $ (for target in $(rustc -Z unstable-options -- print all- target-specs-json | jq -r '. | to_entries[] | if .value.arch == "aarch64" or .value.arch == "arm64ec" then .key else empty end '); do rustc --print cfg --target "${target}" | grep -Fq '"lse2"' && printf '%s\n' "${target}"; done)
276
276
let is_macos = target_os == "macos" ;
277
277
let mut lse = is_macos;
278
278
target_feature_fallback ( "lse2" , is_macos) ;
0 commit comments