Skip to main content

rustc_target/spec/
mod.rs

1// ignore-tidy-filelength
2//! [Flexible target specification.](https://github.com/rust-lang/rfcs/pull/131)
3//!
4//! Rust targets a wide variety of usecases, and in the interest of flexibility,
5//! allows new target tuples to be defined in configuration files. Most users
6//! will not need to care about these, but this is invaluable when porting Rust
7//! to a new platform, and allows for an unprecedented level of control over how
8//! the compiler works.
9//!
10//! # Using targets and target.json
11//!
12//! Invoking "rustc --target=${TUPLE}" will result in rustc initiating the [`Target::search`] by
13//! - checking if "$TUPLE" is a complete path to a json (ending with ".json") and loading if so
14//! - checking builtin targets for "${TUPLE}"
15//! - checking directories in "${RUST_TARGET_PATH}" for "${TUPLE}.json"
16//! - checking for "${RUSTC_SYSROOT}/lib/rustlib/${TUPLE}/target.json"
17//!
18//! Code will then be compiled using the first discovered target spec.
19//!
20//! # Defining a new target
21//!
22//! Targets are defined using a struct which additionally has serialization to and from [JSON].
23//! The `Target` struct in this module loosely corresponds with the format the JSON takes.
24//! We usually try to make the fields equivalent but we have given up on a 1:1 correspondence
25//! between the JSON and the actual structure itself.
26//!
27//! Some fields are required in every target spec, and they should be embedded in Target directly.
28//! Optional keys are in TargetOptions, but Target derefs to it, for no practical difference.
29//! Most notable is the "data-layout" field which specifies Rust's notion of sizes and alignments
30//! for several key types, such as f64, pointers, and so on.
31//!
32//! At one point we felt `-C` options should override the target's settings, like in C compilers,
33//! but that was an essentially-unmarked route for making code incorrect and Rust unsound.
34//! Confronted with programmers who prefer a compiler with a good UX instead of a lethal weapon,
35//! we have almost-entirely recanted that notion, though we hope "target modifiers" will offer
36//! a way to have a decent UX yet still extend the necessary compiler controls, without
37//! requiring a new target spec for each and every single possible target micro-variant.
38//!
39//! [JSON]: https://json.org
40
41use core::result::Result;
42use std::borrow::Cow;
43use std::collections::BTreeMap;
44use std::fmt;
45use std::hash::Hash;
46use std::ops::{Deref, DerefMut};
47use std::path::{Path, PathBuf};
48use std::str::FromStr;
49
50use rustc_abi::{
51    Align, CVariadicStatus, CanonAbi, Endian, ExternAbi, Integer, Size, TargetDataLayout,
52    TargetDataLayoutError,
53};
54use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
55use rustc_error_messages::{DiagArgValue, IntoDiagArg, into_diag_arg_using_display};
56use rustc_macros::{BlobDecodable, Decodable, Encodable, StableHash};
57use rustc_span::{Symbol, kw, sym};
58use serde_json::Value;
59use tracing::debug;
60
61use crate::json::{Json, ToJson};
62use crate::spec::crt_objects::CrtObjects;
63
64pub mod crt_objects;
65
66mod abi_map;
67mod base;
68mod json;
69mod tuple;
70
71pub use abi_map::{AbiMap, AbiMapping};
72pub use base::apple;
73pub use base::avr::ef_avr_arch;
74pub use json::json_schema;
75pub use tuple::TargetTuple;
76
77/// Linker is called through a C/C++ compiler.
78#[derive(#[automatically_derived]
impl ::core::clone::Clone for Cc {
    #[inline]
    fn clone(&self) -> Cc { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Cc { }Copy, #[automatically_derived]
impl ::core::fmt::Debug for Cc {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self { Cc::Yes => "Yes", Cc::No => "No", })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Cc {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for Cc {
    #[inline]
    fn cmp(&self, other: &Cc) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
impl ::core::cmp::PartialEq for Cc {
    #[inline]
    fn eq(&self, other: &Cc) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for Cc {
    #[inline]
    fn partial_cmp(&self, other: &Cc)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}PartialOrd)]
79pub enum Cc {
80    Yes,
81    No,
82}
83
84/// Linker is LLD.
85#[derive(#[automatically_derived]
impl ::core::clone::Clone for Lld {
    #[inline]
    fn clone(&self) -> Lld { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for Lld { }Copy, #[automatically_derived]
impl ::core::fmt::Debug for Lld {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self { Lld::Yes => "Yes", Lld::No => "No", })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for Lld {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for Lld {
    #[inline]
    fn cmp(&self, other: &Lld) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}Ord, #[automatically_derived]
impl ::core::cmp::PartialEq for Lld {
    #[inline]
    fn eq(&self, other: &Lld) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for Lld {
    #[inline]
    fn partial_cmp(&self, other: &Lld)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}PartialOrd)]
86pub enum Lld {
87    Yes,
88    No,
89}
90
91/// All linkers have some kinds of command line interfaces and rustc needs to know which commands
92/// to use with each of them. So we cluster all such interfaces into a (somewhat arbitrary) number
93/// of classes that we call "linker flavors".
94///
95/// Technically, it's not even necessary, we can nearly always infer the flavor from linker name
96/// and target properties like `is_like_windows`/`is_like_darwin`/etc. However, the PRs originally
97/// introducing `-Clinker-flavor` (#40018 and friends) were aiming to reduce this kind of inference
98/// and provide something certain and explicitly specified instead, and that design goal is still
99/// relevant now.
100///
101/// The second goal is to keep the number of flavors to the minimum if possible.
102/// LLD somewhat forces our hand here because that linker is self-sufficient only if its executable
103/// (`argv[0]`) is named in specific way, otherwise it doesn't work and requires a
104/// `-flavor LLD_FLAVOR` argument to choose which logic to use. Our shipped `rust-lld` in
105/// particular is not named in such specific way, so it needs the flavor option, so we make our
106/// linker flavors sufficiently fine-grained to satisfy LLD without inferring its flavor from other
107/// target properties, in accordance with the first design goal.
108///
109/// The first component of the flavor is tightly coupled with the compilation target,
110/// while the `Cc` and `Lld` flags can vary within the same target.
111#[derive(#[automatically_derived]
impl ::core::clone::Clone for LinkerFlavor {
    #[inline]
    fn clone(&self) -> LinkerFlavor {
        let _: ::core::clone::AssertParamIsClone<Cc>;
        let _: ::core::clone::AssertParamIsClone<Lld>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for LinkerFlavor { }Copy, #[automatically_derived]
impl ::core::fmt::Debug for LinkerFlavor {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            LinkerFlavor::Gnu(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Gnu",
                    __self_0, &__self_1),
            LinkerFlavor::Darwin(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Darwin",
                    __self_0, &__self_1),
            LinkerFlavor::WasmLld(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "WasmLld", &__self_0),
            LinkerFlavor::Unix(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Unix",
                    &__self_0),
            LinkerFlavor::Msvc(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Msvc",
                    &__self_0),
            LinkerFlavor::EmCc =>
                ::core::fmt::Formatter::write_str(f, "EmCc"),
            LinkerFlavor::Bpf => ::core::fmt::Formatter::write_str(f, "Bpf"),
            LinkerFlavor::Llbc =>
                ::core::fmt::Formatter::write_str(f, "Llbc"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for LinkerFlavor {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Cc>;
        let _: ::core::cmp::AssertParamIsEq<Lld>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for LinkerFlavor {
    #[inline]
    fn cmp(&self, other: &LinkerFlavor) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (LinkerFlavor::Gnu(__self_0, __self_1),
                        LinkerFlavor::Gnu(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (LinkerFlavor::Darwin(__self_0, __self_1),
                        LinkerFlavor::Darwin(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (LinkerFlavor::WasmLld(__self_0),
                        LinkerFlavor::WasmLld(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (LinkerFlavor::Unix(__self_0), LinkerFlavor::Unix(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (LinkerFlavor::Msvc(__self_0), LinkerFlavor::Msvc(__arg1_0))
                        => ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::cmp::PartialEq for LinkerFlavor {
    #[inline]
    fn eq(&self, other: &LinkerFlavor) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (LinkerFlavor::Gnu(__self_0, __self_1),
                    LinkerFlavor::Gnu(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (LinkerFlavor::Darwin(__self_0, __self_1),
                    LinkerFlavor::Darwin(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (LinkerFlavor::WasmLld(__self_0),
                    LinkerFlavor::WasmLld(__arg1_0)) => __self_0 == __arg1_0,
                (LinkerFlavor::Unix(__self_0), LinkerFlavor::Unix(__arg1_0))
                    => __self_0 == __arg1_0,
                (LinkerFlavor::Msvc(__self_0), LinkerFlavor::Msvc(__arg1_0))
                    => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for LinkerFlavor {
    #[inline]
    fn partial_cmp(&self, other: &LinkerFlavor)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}PartialOrd)]
112pub enum LinkerFlavor {
113    /// Unix-like linker with GNU extensions (both naked and compiler-wrapped forms).
114    /// Besides similar "default" Linux/BSD linkers this also includes Windows/GNU linker,
115    /// which is somewhat different because it doesn't produce ELFs.
116    Gnu(Cc, Lld),
117    /// Unix-like linker for Apple targets (both naked and compiler-wrapped forms).
118    /// Extracted from the "umbrella" `Unix` flavor due to its corresponding LLD flavor.
119    Darwin(Cc, Lld),
120    /// Unix-like linker for Wasm targets (both naked and compiler-wrapped forms).
121    /// Extracted from the "umbrella" `Unix` flavor due to its corresponding LLD flavor.
122    /// Non-LLD version does not exist, so the lld flag is currently hardcoded here.
123    WasmLld(Cc),
124    /// Basic Unix-like linker for "any other Unix" targets (Solaris/illumos, L4Re, MSP430, etc),
125    /// possibly with non-GNU extensions (both naked and compiler-wrapped forms).
126    /// LLD doesn't support any of these.
127    Unix(Cc),
128    /// MSVC-style linker for Windows and UEFI, LLD supports it.
129    Msvc(Lld),
130    /// Emscripten Compiler Frontend, a wrapper around `WasmLld(Cc::Yes)` that has a different
131    /// interface and produces some additional JavaScript output.
132    EmCc,
133    // Below: other linker-like tools with unique interfaces for exotic targets.
134    /// Linker tool for BPF.
135    Bpf,
136    /// LLVM bitcode linker that can be used as a `self-contained` linker
137    Llbc,
138}
139
140/// Linker flavors available externally through command line (`-Clinker-flavor`)
141/// or json target specifications.
142/// This set has accumulated historically, and contains both (stable and unstable) legacy values, as
143/// well as modern ones matching the internal linker flavors (`LinkerFlavor`).
144#[derive(#[automatically_derived]
impl ::core::clone::Clone for LinkerFlavorCli {
    #[inline]
    fn clone(&self) -> LinkerFlavorCli {
        let _: ::core::clone::AssertParamIsClone<Cc>;
        let _: ::core::clone::AssertParamIsClone<Lld>;
        let _: ::core::clone::AssertParamIsClone<LldFlavor>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for LinkerFlavorCli { }Copy, #[automatically_derived]
impl ::core::fmt::Debug for LinkerFlavorCli {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            LinkerFlavorCli::Gnu(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Gnu",
                    __self_0, &__self_1),
            LinkerFlavorCli::Darwin(__self_0, __self_1) =>
                ::core::fmt::Formatter::debug_tuple_field2_finish(f, "Darwin",
                    __self_0, &__self_1),
            LinkerFlavorCli::WasmLld(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "WasmLld", &__self_0),
            LinkerFlavorCli::Unix(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Unix",
                    &__self_0),
            LinkerFlavorCli::Msvc(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Msvc",
                    &__self_0),
            LinkerFlavorCli::EmCc =>
                ::core::fmt::Formatter::write_str(f, "EmCc"),
            LinkerFlavorCli::Bpf =>
                ::core::fmt::Formatter::write_str(f, "Bpf"),
            LinkerFlavorCli::Llbc =>
                ::core::fmt::Formatter::write_str(f, "Llbc"),
            LinkerFlavorCli::Gcc =>
                ::core::fmt::Formatter::write_str(f, "Gcc"),
            LinkerFlavorCli::Ld => ::core::fmt::Formatter::write_str(f, "Ld"),
            LinkerFlavorCli::Lld(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Lld",
                    &__self_0),
            LinkerFlavorCli::Em => ::core::fmt::Formatter::write_str(f, "Em"),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::Eq for LinkerFlavorCli {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Cc>;
        let _: ::core::cmp::AssertParamIsEq<Lld>;
        let _: ::core::cmp::AssertParamIsEq<LldFlavor>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::Ord for LinkerFlavorCli {
    #[inline]
    fn cmp(&self, other: &LinkerFlavorCli) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (LinkerFlavorCli::Gnu(__self_0, __self_1),
                        LinkerFlavorCli::Gnu(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (LinkerFlavorCli::Darwin(__self_0, __self_1),
                        LinkerFlavorCli::Darwin(__arg1_0, __arg1_1)) =>
                        match ::core::cmp::Ord::cmp(__self_0, __arg1_0) {
                            ::core::cmp::Ordering::Equal =>
                                ::core::cmp::Ord::cmp(__self_1, __arg1_1),
                            cmp => cmp,
                        },
                    (LinkerFlavorCli::WasmLld(__self_0),
                        LinkerFlavorCli::WasmLld(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (LinkerFlavorCli::Unix(__self_0),
                        LinkerFlavorCli::Unix(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (LinkerFlavorCli::Msvc(__self_0),
                        LinkerFlavorCli::Msvc(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (LinkerFlavorCli::Lld(__self_0),
                        LinkerFlavorCli::Lld(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord, #[automatically_derived]
impl ::core::cmp::PartialEq for LinkerFlavorCli {
    #[inline]
    fn eq(&self, other: &LinkerFlavorCli) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (LinkerFlavorCli::Gnu(__self_0, __self_1),
                    LinkerFlavorCli::Gnu(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (LinkerFlavorCli::Darwin(__self_0, __self_1),
                    LinkerFlavorCli::Darwin(__arg1_0, __arg1_1)) =>
                    __self_0 == __arg1_0 && __self_1 == __arg1_1,
                (LinkerFlavorCli::WasmLld(__self_0),
                    LinkerFlavorCli::WasmLld(__arg1_0)) => __self_0 == __arg1_0,
                (LinkerFlavorCli::Unix(__self_0),
                    LinkerFlavorCli::Unix(__arg1_0)) => __self_0 == __arg1_0,
                (LinkerFlavorCli::Msvc(__self_0),
                    LinkerFlavorCli::Msvc(__arg1_0)) => __self_0 == __arg1_0,
                (LinkerFlavorCli::Lld(__self_0),
                    LinkerFlavorCli::Lld(__arg1_0)) => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::PartialOrd for LinkerFlavorCli {
    #[inline]
    fn partial_cmp(&self, other: &LinkerFlavorCli)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}PartialOrd)]
145pub enum LinkerFlavorCli {
146    // Modern (unstable) flavors, with direct counterparts in `LinkerFlavor`.
147    Gnu(Cc, Lld),
148    Darwin(Cc, Lld),
149    WasmLld(Cc),
150    Unix(Cc),
151    // Note: `Msvc(Lld::No)` is also a stable value.
152    Msvc(Lld),
153    EmCc,
154    Bpf,
155    Llbc,
156
157    // Legacy stable values
158    Gcc,
159    Ld,
160    Lld(LldFlavor),
161    Em,
162}
163
164impl LinkerFlavorCli {
165    /// Returns whether this `-C linker-flavor` option is one of the unstable values.
166    pub fn is_unstable(&self) -> bool {
167        match self {
168            LinkerFlavorCli::Gnu(..)
169            | LinkerFlavorCli::Darwin(..)
170            | LinkerFlavorCli::WasmLld(..)
171            | LinkerFlavorCli::Unix(..)
172            | LinkerFlavorCli::Msvc(Lld::Yes)
173            | LinkerFlavorCli::EmCc
174            | LinkerFlavorCli::Bpf
175            | LinkerFlavorCli::Llbc => true,
176            LinkerFlavorCli::Gcc
177            | LinkerFlavorCli::Ld
178            | LinkerFlavorCli::Lld(..)
179            | LinkerFlavorCli::Msvc(Lld::No)
180            | LinkerFlavorCli::Em => false,
181        }
182    }
183}
184
185#[automatically_derived]
impl ::core::clone::Clone for LldFlavor {
    #[inline]
    fn clone(&self) -> LldFlavor { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for LldFlavor { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for LldFlavor { }
#[automatically_derived]
impl ::core::cmp::PartialEq for LldFlavor {
    #[inline]
    fn eq(&self, other: &LldFlavor) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for LldFlavor {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for LldFlavor {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for LldFlavor {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                LldFlavor::Wasm => "Wasm",
                LldFlavor::Ld64 => "Ld64",
                LldFlavor::Ld => "Ld",
                LldFlavor::Link => "Link",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for LldFlavor {
    #[inline]
    fn partial_cmp(&self, other: &LldFlavor)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for LldFlavor {
    #[inline]
    fn cmp(&self, other: &LldFlavor) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for LldFlavor {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "wasm" => Self::Wasm,
                "darwin" => Self::Ld64,
                "gnu" => Self::Ld,
                "link" => Self::Link,
                _ => {
                    let all =
                        ["\'wasm\'", "\'darwin\'", "\'gnu\'",
                                    "\'link\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "LLD flavor", s, all))
                                }));
                }
            })
    }
}
impl LldFlavor {
    pub const ALL: &'static [LldFlavor] =
        &[LldFlavor::Wasm, LldFlavor::Ld64, LldFlavor::Ld, LldFlavor::Link];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Wasm => "wasm",
            Self::Ld64 => "darwin",
            Self::Ld => "gnu",
            Self::Link => "link",
        }
    }
}
impl crate::json::ToJson for LldFlavor {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for LldFlavor {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for LldFlavor {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
186    pub enum LldFlavor {
187        Wasm = "wasm",
188        Ld64 = "darwin",
189        Ld = "gnu",
190        Link = "link",
191    }
192
193    parse_error_type = "LLD flavor";
194}
195
196impl LinkerFlavor {
197    /// At this point the target's reference linker flavor doesn't yet exist and we need to infer
198    /// it. The inference always succeeds and gives some result, and we don't report any flavor
199    /// incompatibility errors for json target specs. The CLI flavor is used as the main source
200    /// of truth, other flags are used in case of ambiguities.
201    fn from_cli_json(cli: LinkerFlavorCli, lld_flavor: LldFlavor, is_gnu: bool) -> LinkerFlavor {
202        match cli {
203            LinkerFlavorCli::Gnu(cc, lld) => LinkerFlavor::Gnu(cc, lld),
204            LinkerFlavorCli::Darwin(cc, lld) => LinkerFlavor::Darwin(cc, lld),
205            LinkerFlavorCli::WasmLld(cc) => LinkerFlavor::WasmLld(cc),
206            LinkerFlavorCli::Unix(cc) => LinkerFlavor::Unix(cc),
207            LinkerFlavorCli::Msvc(lld) => LinkerFlavor::Msvc(lld),
208            LinkerFlavorCli::EmCc => LinkerFlavor::EmCc,
209            LinkerFlavorCli::Bpf => LinkerFlavor::Bpf,
210            LinkerFlavorCli::Llbc => LinkerFlavor::Llbc,
211
212            // Below: legacy stable values
213            LinkerFlavorCli::Gcc => match lld_flavor {
214                LldFlavor::Ld if is_gnu => LinkerFlavor::Gnu(Cc::Yes, Lld::No),
215                LldFlavor::Ld64 => LinkerFlavor::Darwin(Cc::Yes, Lld::No),
216                LldFlavor::Wasm => LinkerFlavor::WasmLld(Cc::Yes),
217                LldFlavor::Ld | LldFlavor::Link => LinkerFlavor::Unix(Cc::Yes),
218            },
219            LinkerFlavorCli::Ld => match lld_flavor {
220                LldFlavor::Ld if is_gnu => LinkerFlavor::Gnu(Cc::No, Lld::No),
221                LldFlavor::Ld64 => LinkerFlavor::Darwin(Cc::No, Lld::No),
222                LldFlavor::Ld | LldFlavor::Wasm | LldFlavor::Link => LinkerFlavor::Unix(Cc::No),
223            },
224            LinkerFlavorCli::Lld(LldFlavor::Ld) => LinkerFlavor::Gnu(Cc::No, Lld::Yes),
225            LinkerFlavorCli::Lld(LldFlavor::Ld64) => LinkerFlavor::Darwin(Cc::No, Lld::Yes),
226            LinkerFlavorCli::Lld(LldFlavor::Wasm) => LinkerFlavor::WasmLld(Cc::No),
227            LinkerFlavorCli::Lld(LldFlavor::Link) => LinkerFlavor::Msvc(Lld::Yes),
228            LinkerFlavorCli::Em => LinkerFlavor::EmCc,
229        }
230    }
231
232    /// Returns the corresponding backwards-compatible CLI flavor.
233    fn to_cli(self) -> LinkerFlavorCli {
234        match self {
235            LinkerFlavor::Gnu(Cc::Yes, _)
236            | LinkerFlavor::Darwin(Cc::Yes, _)
237            | LinkerFlavor::WasmLld(Cc::Yes)
238            | LinkerFlavor::Unix(Cc::Yes) => LinkerFlavorCli::Gcc,
239            LinkerFlavor::Gnu(_, Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Ld),
240            LinkerFlavor::Darwin(_, Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Ld64),
241            LinkerFlavor::WasmLld(..) => LinkerFlavorCli::Lld(LldFlavor::Wasm),
242            LinkerFlavor::Gnu(..) | LinkerFlavor::Darwin(..) | LinkerFlavor::Unix(..) => {
243                LinkerFlavorCli::Ld
244            }
245            LinkerFlavor::Msvc(Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Link),
246            LinkerFlavor::Msvc(..) => LinkerFlavorCli::Msvc(Lld::No),
247            LinkerFlavor::EmCc => LinkerFlavorCli::Em,
248            LinkerFlavor::Bpf => LinkerFlavorCli::Bpf,
249            LinkerFlavor::Llbc => LinkerFlavorCli::Llbc,
250        }
251    }
252
253    /// Returns the modern CLI flavor that is the counterpart of this flavor.
254    fn to_cli_counterpart(self) -> LinkerFlavorCli {
255        match self {
256            LinkerFlavor::Gnu(cc, lld) => LinkerFlavorCli::Gnu(cc, lld),
257            LinkerFlavor::Darwin(cc, lld) => LinkerFlavorCli::Darwin(cc, lld),
258            LinkerFlavor::WasmLld(cc) => LinkerFlavorCli::WasmLld(cc),
259            LinkerFlavor::Unix(cc) => LinkerFlavorCli::Unix(cc),
260            LinkerFlavor::Msvc(lld) => LinkerFlavorCli::Msvc(lld),
261            LinkerFlavor::EmCc => LinkerFlavorCli::EmCc,
262            LinkerFlavor::Bpf => LinkerFlavorCli::Bpf,
263            LinkerFlavor::Llbc => LinkerFlavorCli::Llbc,
264        }
265    }
266
267    fn infer_cli_hints(cli: LinkerFlavorCli) -> (Option<Cc>, Option<Lld>) {
268        match cli {
269            LinkerFlavorCli::Gnu(cc, lld) | LinkerFlavorCli::Darwin(cc, lld) => {
270                (Some(cc), Some(lld))
271            }
272            LinkerFlavorCli::WasmLld(cc) => (Some(cc), Some(Lld::Yes)),
273            LinkerFlavorCli::Unix(cc) => (Some(cc), None),
274            LinkerFlavorCli::Msvc(lld) => (Some(Cc::No), Some(lld)),
275            LinkerFlavorCli::EmCc => (Some(Cc::Yes), Some(Lld::Yes)),
276            LinkerFlavorCli::Bpf => (None, None),
277            LinkerFlavorCli::Llbc => (None, None),
278
279            // Below: legacy stable values
280            LinkerFlavorCli::Gcc => (Some(Cc::Yes), None),
281            LinkerFlavorCli::Ld => (Some(Cc::No), Some(Lld::No)),
282            LinkerFlavorCli::Lld(_) => (Some(Cc::No), Some(Lld::Yes)),
283            LinkerFlavorCli::Em => (Some(Cc::Yes), Some(Lld::Yes)),
284        }
285    }
286
287    fn infer_linker_hints(linker_stem: &str) -> Result<Self, (Option<Cc>, Option<Lld>)> {
288        // Remove any version postfix.
289        let stem = linker_stem
290            .rsplit_once('-')
291            .and_then(|(lhs, rhs)| rhs.chars().all(char::is_numeric).then_some(lhs))
292            .unwrap_or(linker_stem);
293
294        if stem == "llvm-bitcode-linker" {
295            Ok(Self::Llbc)
296        } else if stem == "emcc" // GCC/Clang can have an optional target prefix.
297            || stem == "gcc"
298            || stem.ends_with("-gcc")
299            || stem == "g++"
300            || stem.ends_with("-g++")
301            || stem == "clang"
302            || stem.ends_with("-clang")
303            || stem == "clang++"
304            || stem.ends_with("-clang++")
305        {
306            Err((Some(Cc::Yes), Some(Lld::No)))
307        } else if stem == "wasm-ld"
308            || stem.ends_with("-wasm-ld")
309            || stem == "ld.lld"
310            || stem == "lld"
311            || stem == "rust-lld"
312            || stem == "lld-link"
313        {
314            Err((Some(Cc::No), Some(Lld::Yes)))
315        } else if stem == "ld" || stem.ends_with("-ld") || stem == "link" {
316            Err((Some(Cc::No), Some(Lld::No)))
317        } else {
318            Err((None, None))
319        }
320    }
321
322    fn with_hints(self, (cc_hint, lld_hint): (Option<Cc>, Option<Lld>)) -> LinkerFlavor {
323        match self {
324            LinkerFlavor::Gnu(cc, lld) => {
325                LinkerFlavor::Gnu(cc_hint.unwrap_or(cc), lld_hint.unwrap_or(lld))
326            }
327            LinkerFlavor::Darwin(cc, lld) => {
328                LinkerFlavor::Darwin(cc_hint.unwrap_or(cc), lld_hint.unwrap_or(lld))
329            }
330            LinkerFlavor::WasmLld(cc) => LinkerFlavor::WasmLld(cc_hint.unwrap_or(cc)),
331            LinkerFlavor::Unix(cc) => LinkerFlavor::Unix(cc_hint.unwrap_or(cc)),
332            LinkerFlavor::Msvc(lld) => LinkerFlavor::Msvc(lld_hint.unwrap_or(lld)),
333            LinkerFlavor::EmCc | LinkerFlavor::Bpf | LinkerFlavor::Llbc => self,
334        }
335    }
336
337    pub fn with_cli_hints(self, cli: LinkerFlavorCli) -> LinkerFlavor {
338        self.with_hints(LinkerFlavor::infer_cli_hints(cli))
339    }
340
341    pub fn with_linker_hints(self, linker_stem: &str) -> LinkerFlavor {
342        match LinkerFlavor::infer_linker_hints(linker_stem) {
343            Ok(linker_flavor) => linker_flavor,
344            Err(hints) => self.with_hints(hints),
345        }
346    }
347
348    pub fn check_compatibility(self, cli: LinkerFlavorCli) -> Option<String> {
349        let compatible = |cli| {
350            // The CLI flavor should be compatible with the target if:
351            match (self, cli) {
352                // they are counterparts: they have the same principal flavor.
353                (LinkerFlavor::Gnu(..), LinkerFlavorCli::Gnu(..))
354                | (LinkerFlavor::Darwin(..), LinkerFlavorCli::Darwin(..))
355                | (LinkerFlavor::WasmLld(..), LinkerFlavorCli::WasmLld(..))
356                | (LinkerFlavor::Unix(..), LinkerFlavorCli::Unix(..))
357                | (LinkerFlavor::Msvc(..), LinkerFlavorCli::Msvc(..))
358                | (LinkerFlavor::EmCc, LinkerFlavorCli::EmCc)
359                | (LinkerFlavor::Bpf, LinkerFlavorCli::Bpf)
360                | (LinkerFlavor::Llbc, LinkerFlavorCli::Llbc) => return true,
361                _ => {}
362            }
363
364            // 3. or, the flavor is legacy and survives this roundtrip.
365            cli == self.with_cli_hints(cli).to_cli()
366        };
367        (!compatible(cli)).then(|| {
368            LinkerFlavorCli::all()
369                .iter()
370                .filter(|cli| compatible(**cli))
371                .map(|cli| cli.desc())
372                .intersperse(", ")
373                .collect()
374        })
375    }
376
377    pub fn lld_flavor(self) -> LldFlavor {
378        match self {
379            LinkerFlavor::Gnu(..)
380            | LinkerFlavor::Unix(..)
381            | LinkerFlavor::EmCc
382            | LinkerFlavor::Bpf
383            | LinkerFlavor::Llbc => LldFlavor::Ld,
384            LinkerFlavor::Darwin(..) => LldFlavor::Ld64,
385            LinkerFlavor::WasmLld(..) => LldFlavor::Wasm,
386            LinkerFlavor::Msvc(..) => LldFlavor::Link,
387        }
388    }
389
390    pub fn is_gnu(self) -> bool {
391        #[allow(non_exhaustive_omitted_patterns)] match self {
    LinkerFlavor::Gnu(..) => true,
    _ => false,
}matches!(self, LinkerFlavor::Gnu(..))
392    }
393
394    /// Returns whether the flavor uses the `lld` linker.
395    pub fn uses_lld(self) -> bool {
396        // Exhaustive match in case new flavors are added in the future.
397        match self {
398            LinkerFlavor::Gnu(_, Lld::Yes)
399            | LinkerFlavor::Darwin(_, Lld::Yes)
400            | LinkerFlavor::WasmLld(..)
401            | LinkerFlavor::EmCc
402            | LinkerFlavor::Msvc(Lld::Yes) => true,
403            LinkerFlavor::Gnu(..)
404            | LinkerFlavor::Darwin(..)
405            | LinkerFlavor::Msvc(_)
406            | LinkerFlavor::Unix(_)
407            | LinkerFlavor::Bpf
408            | LinkerFlavor::Llbc => false,
409        }
410    }
411
412    /// Returns whether the flavor calls the linker via a C/C++ compiler.
413    pub fn uses_cc(self) -> bool {
414        // Exhaustive match in case new flavors are added in the future.
415        match self {
416            LinkerFlavor::Gnu(Cc::Yes, _)
417            | LinkerFlavor::Darwin(Cc::Yes, _)
418            | LinkerFlavor::WasmLld(Cc::Yes)
419            | LinkerFlavor::Unix(Cc::Yes)
420            | LinkerFlavor::EmCc => true,
421            LinkerFlavor::Gnu(..)
422            | LinkerFlavor::Darwin(..)
423            | LinkerFlavor::WasmLld(_)
424            | LinkerFlavor::Msvc(_)
425            | LinkerFlavor::Unix(_)
426            | LinkerFlavor::Bpf
427            | LinkerFlavor::Llbc => false,
428        }
429    }
430
431    /// For flavors with an `Lld` component, ensure it's enabled. Otherwise, returns the given
432    /// flavor unmodified.
433    pub fn with_lld_enabled(self) -> LinkerFlavor {
434        match self {
435            LinkerFlavor::Gnu(cc, Lld::No) => LinkerFlavor::Gnu(cc, Lld::Yes),
436            LinkerFlavor::Darwin(cc, Lld::No) => LinkerFlavor::Darwin(cc, Lld::Yes),
437            LinkerFlavor::Msvc(Lld::No) => LinkerFlavor::Msvc(Lld::Yes),
438            _ => self,
439        }
440    }
441
442    /// For flavors with an `Lld` component, ensure it's disabled. Otherwise, returns the given
443    /// flavor unmodified.
444    pub fn with_lld_disabled(self) -> LinkerFlavor {
445        match self {
446            LinkerFlavor::Gnu(cc, Lld::Yes) => LinkerFlavor::Gnu(cc, Lld::No),
447            LinkerFlavor::Darwin(cc, Lld::Yes) => LinkerFlavor::Darwin(cc, Lld::No),
448            LinkerFlavor::Msvc(Lld::Yes) => LinkerFlavor::Msvc(Lld::No),
449            _ => self,
450        }
451    }
452}
453
454macro_rules! linker_flavor_cli_impls {
455    ($(($($flavor:tt)*) $string:literal)*) => (
456        impl LinkerFlavorCli {
457            const fn all() -> &'static [LinkerFlavorCli] {
458                &[$($($flavor)*,)*]
459            }
460
461            pub const fn one_of() -> &'static str {
462                concat!("one of: ", $($string, " ",)*)
463            }
464
465            pub fn desc(self) -> &'static str {
466                match self {
467                    $($($flavor)* => $string,)*
468                }
469            }
470        }
471
472        impl FromStr for LinkerFlavorCli {
473            type Err = String;
474
475            fn from_str(s: &str) -> Result<LinkerFlavorCli, Self::Err> {
476                Ok(match s {
477                    $($string => $($flavor)*,)*
478                    _ => return Err(format!("invalid linker flavor, allowed values: {}", Self::one_of())),
479                })
480            }
481        }
482    )
483}
484
485impl LinkerFlavorCli {
    const fn all() -> &'static [LinkerFlavorCli] {
        &[LinkerFlavorCli::Gnu(Cc::No, Lld::No),
                    LinkerFlavorCli::Gnu(Cc::No, Lld::Yes),
                    LinkerFlavorCli::Gnu(Cc::Yes, Lld::No),
                    LinkerFlavorCli::Gnu(Cc::Yes, Lld::Yes),
                    LinkerFlavorCli::Darwin(Cc::No, Lld::No),
                    LinkerFlavorCli::Darwin(Cc::No, Lld::Yes),
                    LinkerFlavorCli::Darwin(Cc::Yes, Lld::No),
                    LinkerFlavorCli::Darwin(Cc::Yes, Lld::Yes),
                    LinkerFlavorCli::WasmLld(Cc::No),
                    LinkerFlavorCli::WasmLld(Cc::Yes),
                    LinkerFlavorCli::Unix(Cc::No),
                    LinkerFlavorCli::Unix(Cc::Yes),
                    LinkerFlavorCli::Msvc(Lld::Yes),
                    LinkerFlavorCli::Msvc(Lld::No), LinkerFlavorCli::EmCc,
                    LinkerFlavorCli::Bpf, LinkerFlavorCli::Llbc,
                    LinkerFlavorCli::Gcc, LinkerFlavorCli::Ld,
                    LinkerFlavorCli::Lld(LldFlavor::Ld),
                    LinkerFlavorCli::Lld(LldFlavor::Ld64),
                    LinkerFlavorCli::Lld(LldFlavor::Link),
                    LinkerFlavorCli::Lld(LldFlavor::Wasm), LinkerFlavorCli::Em]
    }
    pub const fn one_of() -> &'static str {
        "one of: gnu gnu-lld gnu-cc gnu-lld-cc darwin darwin-lld darwin-cc darwin-lld-cc wasm-lld wasm-lld-cc unix unix-cc msvc-lld msvc em-cc bpf llbc gcc ld ld.lld ld64.lld lld-link wasm-ld em "
    }
    pub fn desc(self) -> &'static str {
        match self {
            LinkerFlavorCli::Gnu(Cc::No, Lld::No) => "gnu",
            LinkerFlavorCli::Gnu(Cc::No, Lld::Yes) => "gnu-lld",
            LinkerFlavorCli::Gnu(Cc::Yes, Lld::No) => "gnu-cc",
            LinkerFlavorCli::Gnu(Cc::Yes, Lld::Yes) => "gnu-lld-cc",
            LinkerFlavorCli::Darwin(Cc::No, Lld::No) => "darwin",
            LinkerFlavorCli::Darwin(Cc::No, Lld::Yes) => "darwin-lld",
            LinkerFlavorCli::Darwin(Cc::Yes, Lld::No) => "darwin-cc",
            LinkerFlavorCli::Darwin(Cc::Yes, Lld::Yes) => "darwin-lld-cc",
            LinkerFlavorCli::WasmLld(Cc::No) => "wasm-lld",
            LinkerFlavorCli::WasmLld(Cc::Yes) => "wasm-lld-cc",
            LinkerFlavorCli::Unix(Cc::No) => "unix",
            LinkerFlavorCli::Unix(Cc::Yes) => "unix-cc",
            LinkerFlavorCli::Msvc(Lld::Yes) => "msvc-lld",
            LinkerFlavorCli::Msvc(Lld::No) => "msvc",
            LinkerFlavorCli::EmCc => "em-cc",
            LinkerFlavorCli::Bpf => "bpf",
            LinkerFlavorCli::Llbc => "llbc",
            LinkerFlavorCli::Gcc => "gcc",
            LinkerFlavorCli::Ld => "ld",
            LinkerFlavorCli::Lld(LldFlavor::Ld) => "ld.lld",
            LinkerFlavorCli::Lld(LldFlavor::Ld64) => "ld64.lld",
            LinkerFlavorCli::Lld(LldFlavor::Link) => "lld-link",
            LinkerFlavorCli::Lld(LldFlavor::Wasm) => "wasm-ld",
            LinkerFlavorCli::Em => "em",
        }
    }
}
impl FromStr for LinkerFlavorCli {
    type Err = String;
    fn from_str(s: &str) -> Result<LinkerFlavorCli, Self::Err> {
        Ok(match s {
                "gnu" => LinkerFlavorCli::Gnu(Cc::No, Lld::No),
                "gnu-lld" => LinkerFlavorCli::Gnu(Cc::No, Lld::Yes),
                "gnu-cc" => LinkerFlavorCli::Gnu(Cc::Yes, Lld::No),
                "gnu-lld-cc" => LinkerFlavorCli::Gnu(Cc::Yes, Lld::Yes),
                "darwin" => LinkerFlavorCli::Darwin(Cc::No, Lld::No),
                "darwin-lld" => LinkerFlavorCli::Darwin(Cc::No, Lld::Yes),
                "darwin-cc" => LinkerFlavorCli::Darwin(Cc::Yes, Lld::No),
                "darwin-lld-cc" => LinkerFlavorCli::Darwin(Cc::Yes, Lld::Yes),
                "wasm-lld" => LinkerFlavorCli::WasmLld(Cc::No),
                "wasm-lld-cc" => LinkerFlavorCli::WasmLld(Cc::Yes),
                "unix" => LinkerFlavorCli::Unix(Cc::No),
                "unix-cc" => LinkerFlavorCli::Unix(Cc::Yes),
                "msvc-lld" => LinkerFlavorCli::Msvc(Lld::Yes),
                "msvc" => LinkerFlavorCli::Msvc(Lld::No),
                "em-cc" => LinkerFlavorCli::EmCc,
                "bpf" => LinkerFlavorCli::Bpf,
                "llbc" => LinkerFlavorCli::Llbc,
                "gcc" => LinkerFlavorCli::Gcc,
                "ld" => LinkerFlavorCli::Ld,
                "ld.lld" => LinkerFlavorCli::Lld(LldFlavor::Ld),
                "ld64.lld" => LinkerFlavorCli::Lld(LldFlavor::Ld64),
                "lld-link" => LinkerFlavorCli::Lld(LldFlavor::Link),
                "wasm-ld" => LinkerFlavorCli::Lld(LldFlavor::Wasm),
                "em" => LinkerFlavorCli::Em,
                _ =>
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid linker flavor, allowed values: {0}",
                                            Self::one_of()))
                                })),
            })
    }
}linker_flavor_cli_impls! {
486    (LinkerFlavorCli::Gnu(Cc::No, Lld::No)) "gnu"
487    (LinkerFlavorCli::Gnu(Cc::No, Lld::Yes)) "gnu-lld"
488    (LinkerFlavorCli::Gnu(Cc::Yes, Lld::No)) "gnu-cc"
489    (LinkerFlavorCli::Gnu(Cc::Yes, Lld::Yes)) "gnu-lld-cc"
490    (LinkerFlavorCli::Darwin(Cc::No, Lld::No)) "darwin"
491    (LinkerFlavorCli::Darwin(Cc::No, Lld::Yes)) "darwin-lld"
492    (LinkerFlavorCli::Darwin(Cc::Yes, Lld::No)) "darwin-cc"
493    (LinkerFlavorCli::Darwin(Cc::Yes, Lld::Yes)) "darwin-lld-cc"
494    (LinkerFlavorCli::WasmLld(Cc::No)) "wasm-lld"
495    (LinkerFlavorCli::WasmLld(Cc::Yes)) "wasm-lld-cc"
496    (LinkerFlavorCli::Unix(Cc::No)) "unix"
497    (LinkerFlavorCli::Unix(Cc::Yes)) "unix-cc"
498    (LinkerFlavorCli::Msvc(Lld::Yes)) "msvc-lld"
499    (LinkerFlavorCli::Msvc(Lld::No)) "msvc"
500    (LinkerFlavorCli::EmCc) "em-cc"
501    (LinkerFlavorCli::Bpf) "bpf"
502    (LinkerFlavorCli::Llbc) "llbc"
503
504    // Legacy stable flavors
505    (LinkerFlavorCli::Gcc) "gcc"
506    (LinkerFlavorCli::Ld) "ld"
507    (LinkerFlavorCli::Lld(LldFlavor::Ld)) "ld.lld"
508    (LinkerFlavorCli::Lld(LldFlavor::Ld64)) "ld64.lld"
509    (LinkerFlavorCli::Lld(LldFlavor::Link)) "lld-link"
510    (LinkerFlavorCli::Lld(LldFlavor::Wasm)) "wasm-ld"
511    (LinkerFlavorCli::Em) "em"
512}
513
514impl<'de> serde::Deserialize<'de> for LinkerFlavorCli {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}crate::json::serde_deserialize_from_str!(LinkerFlavorCli);
515impl schemars::JsonSchema for LinkerFlavorCli {
516    fn schema_name() -> std::borrow::Cow<'static, str> {
517        "LinkerFlavor".into()
518    }
519    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
520        let all: Vec<&'static str> =
521            Self::all().iter().map(|flavor| flavor.desc()).collect::<Vec<_>>();
522        <::schemars::Schema as
            ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                let mut object = ::serde_json::Map::new();
                let _ =
                    object.insert(("type").into(),
                        ::serde_json::to_value(&"string").unwrap());
                let _ =
                    object.insert(("enum").into(),
                        ::serde_json::to_value(&all).unwrap());
                object
            })).unwrap()schemars::json_schema! ({
523            "type": "string",
524            "enum": all
525        })
526    }
527}
528
529impl ToJson for LinkerFlavorCli {
530    fn to_json(&self) -> Json {
531        self.desc().to_json()
532    }
533}
534
535/// The different `-Clink-self-contained` options that can be specified in a target spec:
536/// - enabling or disabling in bulk
537/// - some target-specific pieces of inference to determine whether to use self-contained linking
538///   if `-Clink-self-contained` is not specified explicitly (e.g. on musl/mingw)
539/// - explicitly enabling some of the self-contained linking components, e.g. the linker component
540///   to use `rust-lld`
541#[derive(#[automatically_derived]
impl ::core::clone::Clone for LinkSelfContainedDefault {
    #[inline]
    fn clone(&self) -> LinkSelfContainedDefault {
        let _: ::core::clone::AssertParamIsClone<LinkSelfContainedComponents>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for LinkSelfContainedDefault { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for LinkSelfContainedDefault {
    #[inline]
    fn eq(&self, other: &LinkSelfContainedDefault) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (LinkSelfContainedDefault::WithComponents(__self_0),
                    LinkSelfContainedDefault::WithComponents(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::fmt::Debug for LinkSelfContainedDefault {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            LinkSelfContainedDefault::True =>
                ::core::fmt::Formatter::write_str(f, "True"),
            LinkSelfContainedDefault::False =>
                ::core::fmt::Formatter::write_str(f, "False"),
            LinkSelfContainedDefault::InferredForMusl =>
                ::core::fmt::Formatter::write_str(f, "InferredForMusl"),
            LinkSelfContainedDefault::InferredForMingw =>
                ::core::fmt::Formatter::write_str(f, "InferredForMingw"),
            LinkSelfContainedDefault::WithComponents(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "WithComponents", &__self_0),
        }
    }
}Debug)]
542pub enum LinkSelfContainedDefault {
543    /// The target spec explicitly enables self-contained linking.
544    True,
545
546    /// The target spec explicitly disables self-contained linking.
547    False,
548
549    /// The target spec requests that the self-contained mode is inferred, in the context of musl.
550    InferredForMusl,
551
552    /// The target spec requests that the self-contained mode is inferred, in the context of mingw.
553    InferredForMingw,
554
555    /// The target spec explicitly enables a list of self-contained linking components: e.g. for
556    /// targets opting into a subset of components like the CLI's `-C link-self-contained=+linker`.
557    WithComponents(LinkSelfContainedComponents),
558}
559
560/// Parses a backwards-compatible `-Clink-self-contained` option string, without components.
561impl FromStr for LinkSelfContainedDefault {
562    type Err = String;
563
564    fn from_str(s: &str) -> Result<LinkSelfContainedDefault, Self::Err> {
565        Ok(match s {
566            "false" => LinkSelfContainedDefault::False,
567            "true" | "wasm" => LinkSelfContainedDefault::True,
568            "musl" => LinkSelfContainedDefault::InferredForMusl,
569            "mingw" => LinkSelfContainedDefault::InferredForMingw,
570            _ => {
571                return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("\'{0}\' is not a valid `-Clink-self-contained` default. Use \'false\', \'true\', \'wasm\', \'musl\' or \'mingw\'",
                s))
    })format!(
572                    "'{s}' is not a valid `-Clink-self-contained` default. \
573                        Use 'false', 'true', 'wasm', 'musl' or 'mingw'",
574                ));
575            }
576        })
577    }
578}
579
580impl<'de> serde::Deserialize<'de> for LinkSelfContainedDefault {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}crate::json::serde_deserialize_from_str!(LinkSelfContainedDefault);
581impl schemars::JsonSchema for LinkSelfContainedDefault {
582    fn schema_name() -> std::borrow::Cow<'static, str> {
583        "LinkSelfContainedDefault".into()
584    }
585    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
586        <::schemars::Schema as
            ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                let mut object = ::serde_json::Map::new();
                let _ =
                    object.insert(("type").into(),
                        ::serde_json::to_value(&"string").unwrap());
                let _ =
                    object.insert(("enum").into(),
                        ::serde_json::Value::Array(::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
                                    [::serde_json::to_value(&"false").unwrap(),
                                            ::serde_json::to_value(&"true").unwrap(),
                                            ::serde_json::to_value(&"wasm").unwrap(),
                                            ::serde_json::to_value(&"musl").unwrap(),
                                            ::serde_json::to_value(&"mingw").unwrap()]))));
                object
            })).unwrap()schemars::json_schema! ({
587            "type": "string",
588            "enum": ["false", "true", "wasm", "musl", "mingw"]
589        })
590    }
591}
592
593impl ToJson for LinkSelfContainedDefault {
594    fn to_json(&self) -> Json {
595        match *self {
596            LinkSelfContainedDefault::WithComponents(components) => {
597                // Serialize the components in a json object's `components` field, to prepare for a
598                // future where `crt-objects-fallback` is removed from the json specs and
599                // incorporated as a field here.
600                let mut map = BTreeMap::new();
601                map.insert("components", components);
602                map.to_json()
603            }
604
605            // Stable backwards-compatible values
606            LinkSelfContainedDefault::True => "true".to_json(),
607            LinkSelfContainedDefault::False => "false".to_json(),
608            LinkSelfContainedDefault::InferredForMusl => "musl".to_json(),
609            LinkSelfContainedDefault::InferredForMingw => "mingw".to_json(),
610        }
611    }
612}
613
614impl LinkSelfContainedDefault {
615    /// Returns whether the target spec has self-contained linking explicitly disabled. Used to emit
616    /// errors if the user then enables it on the CLI.
617    pub fn is_disabled(self) -> bool {
618        self == LinkSelfContainedDefault::False
619    }
620
621    /// Returns the key to use when serializing the setting to json:
622    /// - individual components in a `link-self-contained` object value
623    /// - the other variants as a backwards-compatible `crt-objects-fallback` string
624    fn json_key(self) -> &'static str {
625        match self {
626            LinkSelfContainedDefault::WithComponents(_) => "link-self-contained",
627            _ => "crt-objects-fallback",
628        }
629    }
630
631    /// Creates a `LinkSelfContainedDefault` enabling the self-contained linker for target specs
632    /// (the equivalent of `-Clink-self-contained=+linker` on the CLI).
633    pub fn with_linker() -> LinkSelfContainedDefault {
634        LinkSelfContainedDefault::WithComponents(LinkSelfContainedComponents::LINKER)
635    }
636}
637
638bitflags::bitflags! {
639    #[derive(#[automatically_derived]
impl ::core::clone::Clone for LinkSelfContainedComponents {
    #[inline]
    fn clone(&self) -> LinkSelfContainedComponents {
        let _:
                ::core::clone::AssertParamIsClone<<LinkSelfContainedComponents
                as ::bitflags::__private::PublicFlags>::Internal>;
        *self
    }
}
impl LinkSelfContainedComponents {
    #[doc = r" CRT objects (e.g. on `windows-gnu`, `musl`, `wasi` targets)"]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const CRT_OBJECTS: Self = Self::from_bits_retain(1 << 0);
    #[doc = r" libc static library (e.g. on `musl`, `wasi` targets)"]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const LIBC: Self = Self::from_bits_retain(1 << 1);
    #[doc =
    r" libgcc/libunwind (e.g. on `windows-gnu`, `fuchsia`, `fortanix`, `gnullvm` targets)"]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const UNWIND: Self = Self::from_bits_retain(1 << 2);
    #[doc =
    r" Linker, dlltool, and their necessary libraries (e.g. on `windows-gnu` and for `rust-lld`)"]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const LINKER: Self = Self::from_bits_retain(1 << 3);
    #[doc = r" Sanitizer runtime libraries"]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SANITIZERS: Self = Self::from_bits_retain(1 << 4);
    #[doc = r" Other MinGW libs and Windows import libs"]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const MINGW: Self = Self::from_bits_retain(1 << 5);
}
impl ::bitflags::Flags for LinkSelfContainedComponents {
    const FLAGS: &'static [::bitflags::Flag<LinkSelfContainedComponents>] =
        &[{

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("CRT_OBJECTS",
                            LinkSelfContainedComponents::CRT_OBJECTS)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("LIBC",
                            LinkSelfContainedComponents::LIBC)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("UNWIND",
                            LinkSelfContainedComponents::UNWIND)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("LINKER",
                            LinkSelfContainedComponents::LINKER)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SANITIZERS",
                            LinkSelfContainedComponents::SANITIZERS)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("MINGW",
                            LinkSelfContainedComponents::MINGW)
                    }];
    type Bits = u8;
    fn bits(&self) -> u8 { LinkSelfContainedComponents::bits(self) }
    fn from_bits_retain(bits: u8) -> LinkSelfContainedComponents {
        LinkSelfContainedComponents::from_bits_retain(bits)
    }
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
    {
        #[repr(transparent)]
        pub struct InternalBitFlags(u8);
        #[automatically_derived]
        #[doc(hidden)]
        unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::clone::Clone for InternalBitFlags {
            #[inline]
            fn clone(&self) -> InternalBitFlags {
                let _: ::core::clone::AssertParamIsClone<u8>;
                *self
            }
        }
        #[automatically_derived]
        impl ::core::marker::Copy for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::marker::StructuralPartialEq for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::cmp::PartialEq for InternalBitFlags {
            #[inline]
            fn eq(&self, other: &InternalBitFlags) -> bool {
                self.0 == other.0
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Eq for InternalBitFlags {
            #[inline]
            #[doc(hidden)]
            #[coverage(off)]
            fn assert_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u8>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &InternalBitFlags)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::option::Option::Some(::core::cmp::Ord::cmp(self,
                        other))
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &InternalBitFlags) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for
            LinkSelfContainedComponents {
            type Primitive = u8;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u8 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&LinkSelfContainedComponents(*self),
                    f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<LinkSelfContainedComponents>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u8> for
            InternalBitFlags {
            fn as_ref(&self) -> &u8 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u8> for
            InternalBitFlags {
            fn from(bits: u8) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u8 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u8 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <LinkSelfContainedComponents as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <LinkSelfContainedComponents as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <LinkSelfContainedComponents as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <LinkSelfContainedComponents as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <LinkSelfContainedComponents as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <LinkSelfContainedComponents as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u8 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u8)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u8) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u8) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "CRT_OBJECTS" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkSelfContainedComponents::CRT_OBJECTS.bits()));
                    }
                };
                ;
                {
                    if name == "LIBC" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkSelfContainedComponents::LIBC.bits()));
                    }
                };
                ;
                {
                    if name == "UNWIND" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkSelfContainedComponents::UNWIND.bits()));
                    }
                };
                ;
                {
                    if name == "LINKER" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkSelfContainedComponents::LINKER.bits()));
                    }
                };
                ;
                {
                    if name == "SANITIZERS" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkSelfContainedComponents::SANITIZERS.bits()));
                    }
                };
                ;
                {
                    if name == "MINGW" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkSelfContainedComponents::MINGW.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u8 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u8 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<LinkSelfContainedComponents> {
                ::bitflags::iter::Iter::__private_const_new(<LinkSelfContainedComponents
                        as ::bitflags::Flags>::FLAGS,
                    LinkSelfContainedComponents::from_bits_retain(self.bits()),
                    LinkSelfContainedComponents::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<LinkSelfContainedComponents> {
                ::bitflags::iter::IterNames::__private_const_new(<LinkSelfContainedComponents
                        as ::bitflags::Flags>::FLAGS,
                    LinkSelfContainedComponents::from_bits_retain(self.bits()),
                    LinkSelfContainedComponents::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = LinkSelfContainedComponents;
            type IntoIter =
                ::bitflags::iter::Iter<LinkSelfContainedComponents>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u8 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl LinkSelfContainedComponents {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u8 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u8)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u8) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u8) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for
            LinkSelfContainedComponents {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for
            LinkSelfContainedComponents {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for
            LinkSelfContainedComponents {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for
            LinkSelfContainedComponents {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for
            LinkSelfContainedComponents {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: LinkSelfContainedComponents) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            LinkSelfContainedComponents {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for
            LinkSelfContainedComponents {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            LinkSelfContainedComponents {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for
            LinkSelfContainedComponents {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            LinkSelfContainedComponents {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for
            LinkSelfContainedComponents {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for
            LinkSelfContainedComponents {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for
            LinkSelfContainedComponents {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<LinkSelfContainedComponents>
            for LinkSelfContainedComponents {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<LinkSelfContainedComponents>
            for LinkSelfContainedComponents {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl LinkSelfContainedComponents {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<LinkSelfContainedComponents> {
                ::bitflags::iter::Iter::__private_const_new(<LinkSelfContainedComponents
                        as ::bitflags::Flags>::FLAGS,
                    LinkSelfContainedComponents::from_bits_retain(self.bits()),
                    LinkSelfContainedComponents::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<LinkSelfContainedComponents> {
                ::bitflags::iter::IterNames::__private_const_new(<LinkSelfContainedComponents
                        as ::bitflags::Flags>::FLAGS,
                    LinkSelfContainedComponents::from_bits_retain(self.bits()),
                    LinkSelfContainedComponents::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            LinkSelfContainedComponents {
            type Item = LinkSelfContainedComponents;
            type IntoIter =
                ::bitflags::iter::Iter<LinkSelfContainedComponents>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };Clone, #[automatically_derived]
impl ::core::marker::Copy for LinkSelfContainedComponents { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for LinkSelfContainedComponents {
    #[inline]
    fn eq(&self, other: &LinkSelfContainedComponents) -> bool {
        self.0 == other.0
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for LinkSelfContainedComponents {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<<LinkSelfContainedComponents as
                ::bitflags::__private::PublicFlags>::Internal>;
    }
}Eq, #[automatically_derived]
impl ::core::default::Default for LinkSelfContainedComponents {
    #[inline]
    fn default() -> LinkSelfContainedComponents {
        LinkSelfContainedComponents(::core::default::Default::default())
    }
}Default)]
640    /// The `-C link-self-contained` components that can individually be enabled or disabled.
641    pub struct LinkSelfContainedComponents: u8 {
642        /// CRT objects (e.g. on `windows-gnu`, `musl`, `wasi` targets)
643        const CRT_OBJECTS = 1 << 0;
644        /// libc static library (e.g. on `musl`, `wasi` targets)
645        const LIBC        = 1 << 1;
646        /// libgcc/libunwind (e.g. on `windows-gnu`, `fuchsia`, `fortanix`, `gnullvm` targets)
647        const UNWIND      = 1 << 2;
648        /// Linker, dlltool, and their necessary libraries (e.g. on `windows-gnu` and for `rust-lld`)
649        const LINKER      = 1 << 3;
650        /// Sanitizer runtime libraries
651        const SANITIZERS  = 1 << 4;
652        /// Other MinGW libs and Windows import libs
653        const MINGW       = 1 << 5;
654    }
655}
656impl ::std::fmt::Debug for LinkSelfContainedComponents {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::bitflags::parser::to_writer(self, f)
    }
}rustc_data_structures::external_bitflags_debug! { LinkSelfContainedComponents }
657
658impl LinkSelfContainedComponents {
659    /// Return the component's name.
660    ///
661    /// Returns `None` if the bitflags aren't a singular component (but a mix of multiple flags).
662    pub fn as_str(self) -> Option<&'static str> {
663        Some(match self {
664            LinkSelfContainedComponents::CRT_OBJECTS => "crto",
665            LinkSelfContainedComponents::LIBC => "libc",
666            LinkSelfContainedComponents::UNWIND => "unwind",
667            LinkSelfContainedComponents::LINKER => "linker",
668            LinkSelfContainedComponents::SANITIZERS => "sanitizers",
669            LinkSelfContainedComponents::MINGW => "mingw",
670            _ => return None,
671        })
672    }
673
674    /// Returns an array of all the components.
675    fn all_components() -> [LinkSelfContainedComponents; 6] {
676        [
677            LinkSelfContainedComponents::CRT_OBJECTS,
678            LinkSelfContainedComponents::LIBC,
679            LinkSelfContainedComponents::UNWIND,
680            LinkSelfContainedComponents::LINKER,
681            LinkSelfContainedComponents::SANITIZERS,
682            LinkSelfContainedComponents::MINGW,
683        ]
684    }
685
686    /// Returns whether at least a component is enabled.
687    pub fn are_any_components_enabled(self) -> bool {
688        !self.is_empty()
689    }
690
691    /// Returns whether `LinkSelfContainedComponents::LINKER` is enabled.
692    pub fn is_linker_enabled(self) -> bool {
693        self.contains(LinkSelfContainedComponents::LINKER)
694    }
695
696    /// Returns whether `LinkSelfContainedComponents::CRT_OBJECTS` is enabled.
697    pub fn is_crt_objects_enabled(self) -> bool {
698        self.contains(LinkSelfContainedComponents::CRT_OBJECTS)
699    }
700}
701
702impl FromStr for LinkSelfContainedComponents {
703    type Err = String;
704
705    /// Parses a single `-Clink-self-contained` well-known component, not a set of flags.
706    fn from_str(s: &str) -> Result<Self, Self::Err> {
707        Ok(match s {
708            "crto" => LinkSelfContainedComponents::CRT_OBJECTS,
709            "libc" => LinkSelfContainedComponents::LIBC,
710            "unwind" => LinkSelfContainedComponents::UNWIND,
711            "linker" => LinkSelfContainedComponents::LINKER,
712            "sanitizers" => LinkSelfContainedComponents::SANITIZERS,
713            "mingw" => LinkSelfContainedComponents::MINGW,
714            _ => {
715                return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("\'{0}\' is not a valid link-self-contained component, expected \'crto\', \'libc\', \'unwind\', \'linker\', \'sanitizers\', \'mingw\'",
                s))
    })format!(
716                    "'{s}' is not a valid link-self-contained component, expected 'crto', 'libc', 'unwind', 'linker', 'sanitizers', 'mingw'"
717                ));
718            }
719        })
720    }
721}
722
723impl<'de> serde::Deserialize<'de> for LinkSelfContainedComponents {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}crate::json::serde_deserialize_from_str!(LinkSelfContainedComponents);
724impl schemars::JsonSchema for LinkSelfContainedComponents {
725    fn schema_name() -> std::borrow::Cow<'static, str> {
726        "LinkSelfContainedComponents".into()
727    }
728    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
729        let all =
730            Self::all_components().iter().map(|component| component.as_str()).collect::<Vec<_>>();
731        <::schemars::Schema as
            ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                let mut object = ::serde_json::Map::new();
                let _ =
                    object.insert(("type").into(),
                        ::serde_json::to_value(&"string").unwrap());
                let _ =
                    object.insert(("enum").into(),
                        ::serde_json::to_value(&all).unwrap());
                ;
                object
            })).unwrap()schemars::json_schema! ({
732            "type": "string",
733            "enum": all,
734        })
735    }
736}
737
738impl ToJson for LinkSelfContainedComponents {
739    fn to_json(&self) -> Json {
740        let components: Vec<_> = Self::all_components()
741            .into_iter()
742            .filter(|c| self.contains(*c))
743            .map(|c| {
744                // We can unwrap because we're iterating over all the known singular components,
745                // not an actual set of flags where `as_str` can fail.
746                c.as_str().unwrap().to_owned()
747            })
748            .collect();
749
750        components.to_json()
751    }
752}
753
754bitflags::bitflags! {
755    /// The `-C linker-features` components that can individually be enabled or disabled.
756    ///
757    /// They are feature flags intended to be a more flexible mechanism than linker flavors, and
758    /// also to prevent a combinatorial explosion of flavors whenever a new linker feature is
759    /// required. These flags are "generic", in the sense that they can work on multiple targets on
760    /// the CLI. Otherwise, one would have to select different linkers flavors for each target.
761    ///
762    /// Here are some examples of the advantages they offer:
763    /// - default feature sets for principal flavors, or for specific targets.
764    /// - flavor-specific features: for example, clang offers automatic cross-linking with
765    ///   `--target`, which gcc-style compilers don't support. The *flavor* is still a C/C++
766    ///   compiler, and we don't need to multiply the number of flavors for this use-case. Instead,
767    ///   we can have a single `+target` feature.
768    /// - umbrella features: for example if clang accumulates more features in the future than just
769    ///   the `+target` above. That could be modeled as `+clang`.
770    /// - niche features for resolving specific issues: for example, on Apple targets the linker
771    ///   flag implementing the `as-needed` native link modifier (#99424) is only possible on
772    ///   sufficiently recent linker versions.
773    /// - still allows for discovery and automation, for example via feature detection. This can be
774    ///   useful in exotic environments/build systems.
775    #[derive(#[automatically_derived]
impl ::core::clone::Clone for LinkerFeatures {
    #[inline]
    fn clone(&self) -> LinkerFeatures {
        let _:
                ::core::clone::AssertParamIsClone<<LinkerFeatures as
                ::bitflags::__private::PublicFlags>::Internal>;
        *self
    }
}
impl LinkerFeatures {
    #[doc =
    r" Invoke the linker via a C/C++ compiler (e.g. on most unix targets)."]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const CC: Self = Self::from_bits_retain(1 << 0);
    #[doc =
    r" Use the lld linker, either the system lld or the self-contained linker `rust-lld`."]
    #[allow(deprecated, non_upper_case_globals,)]
    pub const LLD: Self = Self::from_bits_retain(1 << 1);
}
impl ::bitflags::Flags for LinkerFeatures {
    const FLAGS: &'static [::bitflags::Flag<LinkerFeatures>] =
        &[{

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("CC", LinkerFeatures::CC)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("LLD", LinkerFeatures::LLD)
                    }];
    type Bits = u8;
    fn bits(&self) -> u8 { LinkerFeatures::bits(self) }
    fn from_bits_retain(bits: u8) -> LinkerFeatures {
        LinkerFeatures::from_bits_retain(bits)
    }
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: indexing_slicing, clippy :: same_name_method,
clippy :: iter_without_into_iter,)]
const _: () =
    {
        #[repr(transparent)]
        pub struct InternalBitFlags(u8);
        #[automatically_derived]
        #[doc(hidden)]
        unsafe impl ::core::clone::TrivialClone for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::clone::Clone for InternalBitFlags {
            #[inline]
            fn clone(&self) -> InternalBitFlags {
                let _: ::core::clone::AssertParamIsClone<u8>;
                *self
            }
        }
        #[automatically_derived]
        impl ::core::marker::Copy for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::marker::StructuralPartialEq for InternalBitFlags { }
        #[automatically_derived]
        impl ::core::cmp::PartialEq for InternalBitFlags {
            #[inline]
            fn eq(&self, other: &InternalBitFlags) -> bool {
                self.0 == other.0
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Eq for InternalBitFlags {
            #[inline]
            #[doc(hidden)]
            #[coverage(off)]
            fn assert_fields_are_eq(&self) {
                let _: ::core::cmp::AssertParamIsEq<u8>;
            }
        }
        #[automatically_derived]
        impl ::core::cmp::PartialOrd for InternalBitFlags {
            #[inline]
            fn partial_cmp(&self, other: &InternalBitFlags)
                -> ::core::option::Option<::core::cmp::Ordering> {
                ::core::option::Option::Some(::core::cmp::Ord::cmp(self,
                        other))
            }
        }
        #[automatically_derived]
        impl ::core::cmp::Ord for InternalBitFlags {
            #[inline]
            fn cmp(&self, other: &InternalBitFlags) -> ::core::cmp::Ordering {
                ::core::cmp::Ord::cmp(&self.0, &other.0)
            }
        }
        #[automatically_derived]
        impl ::core::hash::Hash for InternalBitFlags {
            #[inline]
            fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
                ::core::hash::Hash::hash(&self.0, state)
            }
        }
        impl ::bitflags::__private::PublicFlags for LinkerFeatures {
            type Primitive = u8;
            type Internal = InternalBitFlags;
        }
        impl ::bitflags::__private::core::default::Default for
            InternalBitFlags {
            #[inline]
            fn default() -> Self { InternalBitFlags::empty() }
        }
        impl ::bitflags::__private::core::fmt::Debug for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                if self.is_empty() {
                    f.write_fmt(format_args!("{0:#x}",
                            <u8 as ::bitflags::Bits>::EMPTY))
                } else {
                    ::bitflags::__private::core::fmt::Display::fmt(self, f)
                }
            }
        }
        impl ::bitflags::__private::core::fmt::Display for InternalBitFlags {
            fn fmt(&self,
                f: &mut ::bitflags::__private::core::fmt::Formatter<'_>)
                -> ::bitflags::__private::core::fmt::Result {
                ::bitflags::parser::to_writer(&LinkerFeatures(*self), f)
            }
        }
        impl ::bitflags::__private::core::str::FromStr for InternalBitFlags {
            type Err = ::bitflags::parser::ParseError;
            fn from_str(s: &str)
                ->
                    ::bitflags::__private::core::result::Result<Self,
                    Self::Err> {
                ::bitflags::parser::from_str::<LinkerFeatures>(s).map(|flags|
                        flags.0)
            }
        }
        impl ::bitflags::__private::core::convert::AsRef<u8> for
            InternalBitFlags {
            fn as_ref(&self) -> &u8 { &self.0 }
        }
        impl ::bitflags::__private::core::convert::From<u8> for
            InternalBitFlags {
            fn from(bits: u8) -> Self { Self::from_bits_retain(bits) }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl InternalBitFlags {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u8 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u8 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <LinkerFeatures as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <LinkerFeatures as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u8 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u8)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u8) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u8) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "CC" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkerFeatures::CC.bits()));
                    }
                };
                ;
                {
                    if name == "LLD" {
                        return ::bitflags::__private::core::option::Option::Some(Self(LinkerFeatures::LLD.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u8 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u8 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for InternalBitFlags {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for InternalBitFlags {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: InternalBitFlags) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for InternalBitFlags {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for
            InternalBitFlags {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for InternalBitFlags {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for
            InternalBitFlags {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for InternalBitFlags {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for InternalBitFlags
            {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for InternalBitFlags {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<InternalBitFlags> for
            InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<InternalBitFlags>
            for InternalBitFlags {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl InternalBitFlags {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<LinkerFeatures> {
                ::bitflags::iter::Iter::__private_const_new(<LinkerFeatures as
                        ::bitflags::Flags>::FLAGS,
                    LinkerFeatures::from_bits_retain(self.bits()),
                    LinkerFeatures::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<LinkerFeatures> {
                ::bitflags::iter::IterNames::__private_const_new(<LinkerFeatures
                        as ::bitflags::Flags>::FLAGS,
                    LinkerFeatures::from_bits_retain(self.bits()),
                    LinkerFeatures::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            InternalBitFlags {
            type Item = LinkerFeatures;
            type IntoIter = ::bitflags::iter::Iter<LinkerFeatures>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
        impl InternalBitFlags {
            /// Returns a mutable reference to the raw value of the flags currently stored.
            #[inline]
            pub fn bits_mut(&mut self) -> &mut u8 { &mut self.0 }
        }
        #[allow(dead_code, deprecated, unused_attributes)]
        impl LinkerFeatures {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self { Self(InternalBitFlags::empty()) }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self { Self(InternalBitFlags::all()) }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u8 { self.0.bits() }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u8)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_bits(bits) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u8) -> Self {
                Self(InternalBitFlags::from_bits_truncate(bits))
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u8) -> Self {
                Self(InternalBitFlags::from_bits_retain(bits))
            }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                match InternalBitFlags::from_name(name) {
                    ::bitflags::__private::core::option::Option::Some(bits) =>
                        ::bitflags::__private::core::option::Option::Some(Self(bits)),
                    ::bitflags::__private::core::option::Option::None =>
                        ::bitflags::__private::core::option::Option::None,
                }
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool { self.0.is_empty() }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool { self.0.is_all() }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0.intersects(other.0)
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0.contains(other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) { self.0.insert(other.0) }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) { self.0.remove(other.0) }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) { self.0.toggle(other.0) }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                self.0.set(other.0, value)
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0.intersection(other.0))
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0.union(other.0))
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0.difference(other.0))
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0.symmetric_difference(other.0))
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self(self.0.complement())
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for LinkerFeatures {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for LinkerFeatures {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for LinkerFeatures {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for LinkerFeatures {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for LinkerFeatures {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: LinkerFeatures) -> Self {
                self.union(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for LinkerFeatures
            {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for LinkerFeatures {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for LinkerFeatures
            {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for LinkerFeatures {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for LinkerFeatures
            {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for LinkerFeatures {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for LinkerFeatures {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for LinkerFeatures {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<LinkerFeatures> for
            LinkerFeatures {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<LinkerFeatures>
            for LinkerFeatures {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl LinkerFeatures {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self)
                -> ::bitflags::iter::Iter<LinkerFeatures> {
                ::bitflags::iter::Iter::__private_const_new(<LinkerFeatures as
                        ::bitflags::Flags>::FLAGS,
                    LinkerFeatures::from_bits_retain(self.bits()),
                    LinkerFeatures::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<LinkerFeatures> {
                ::bitflags::iter::IterNames::__private_const_new(<LinkerFeatures
                        as ::bitflags::Flags>::FLAGS,
                    LinkerFeatures::from_bits_retain(self.bits()),
                    LinkerFeatures::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for
            LinkerFeatures {
            type Item = LinkerFeatures;
            type IntoIter = ::bitflags::iter::Iter<LinkerFeatures>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };Clone, #[automatically_derived]
impl ::core::marker::Copy for LinkerFeatures { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for LinkerFeatures {
    #[inline]
    fn eq(&self, other: &LinkerFeatures) -> bool { self.0 == other.0 }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for LinkerFeatures {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _:
                ::core::cmp::AssertParamIsEq<<LinkerFeatures as
                ::bitflags::__private::PublicFlags>::Internal>;
    }
}Eq, #[automatically_derived]
impl ::core::default::Default for LinkerFeatures {
    #[inline]
    fn default() -> LinkerFeatures {
        LinkerFeatures(::core::default::Default::default())
    }
}Default)]
776    pub struct LinkerFeatures: u8 {
777        /// Invoke the linker via a C/C++ compiler (e.g. on most unix targets).
778        const CC  = 1 << 0;
779        /// Use the lld linker, either the system lld or the self-contained linker `rust-lld`.
780        const LLD = 1 << 1;
781    }
782}
783impl ::std::fmt::Debug for LinkerFeatures {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::bitflags::parser::to_writer(self, f)
    }
}rustc_data_structures::external_bitflags_debug! { LinkerFeatures }
784
785impl LinkerFeatures {
786    /// Parses a single `-C linker-features` well-known feature, not a set of flags.
787    pub fn from_str(s: &str) -> Option<LinkerFeatures> {
788        Some(match s {
789            "cc" => LinkerFeatures::CC,
790            "lld" => LinkerFeatures::LLD,
791            _ => return None,
792        })
793    }
794
795    /// Return the linker feature name, as would be passed on the CLI.
796    ///
797    /// Returns `None` if the bitflags aren't a singular component (but a mix of multiple flags).
798    pub fn as_str(self) -> Option<&'static str> {
799        Some(match self {
800            LinkerFeatures::CC => "cc",
801            LinkerFeatures::LLD => "lld",
802            _ => return None,
803        })
804    }
805
806    /// Returns whether the `lld` linker feature is enabled.
807    pub fn is_lld_enabled(self) -> bool {
808        self.contains(LinkerFeatures::LLD)
809    }
810
811    /// Returns whether the `cc` linker feature is enabled.
812    pub fn is_cc_enabled(self) -> bool {
813        self.contains(LinkerFeatures::CC)
814    }
815}
816
817#[automatically_derived]
impl ::core::clone::Clone for PanicStrategy {
    #[inline]
    fn clone(&self) -> PanicStrategy { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for PanicStrategy { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for PanicStrategy { }
#[automatically_derived]
impl ::core::cmp::PartialEq for PanicStrategy {
    #[inline]
    fn eq(&self, other: &PanicStrategy) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for PanicStrategy {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for PanicStrategy {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for PanicStrategy {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                PanicStrategy::Unwind => "Unwind",
                PanicStrategy::Abort => "Abort",
                PanicStrategy::ImmediateAbort => "ImmediateAbort",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for PanicStrategy {
    #[inline]
    fn partial_cmp(&self, other: &PanicStrategy)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for PanicStrategy {
    #[inline]
    fn cmp(&self, other: &PanicStrategy) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for PanicStrategy {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        PanicStrategy::Unwind => { 0usize }
                        PanicStrategy::Abort => { 1usize }
                        PanicStrategy::ImmediateAbort => { 2usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    PanicStrategy::Unwind => {}
                    PanicStrategy::Abort => {}
                    PanicStrategy::ImmediateAbort => {}
                }
            }
        }
    };
const _: () =
    {
        impl<__D: ::rustc_span::BlobDecoder> ::rustc_serialize::Decodable<__D>
            for PanicStrategy {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { PanicStrategy::Unwind }
                    1usize => { PanicStrategy::Abort }
                    2usize => { PanicStrategy::ImmediateAbort }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `PanicStrategy`, expected 0..3, actual {0}",
                                n));
                    }
                }
            }
        }
    };
const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            PanicStrategy {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                ::std::mem::discriminant(self).stable_hash(__hcx, __hasher);
                match *self {
                    PanicStrategy::Unwind => {}
                    PanicStrategy::Abort => {}
                    PanicStrategy::ImmediateAbort => {}
                }
            }
        }
    };
impl FromStr for PanicStrategy {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "unwind" => Self::Unwind,
                "abort" => Self::Abort,
                "immediate-abort" => Self::ImmediateAbort,
                _ => {
                    let all =
                        ["\'unwind\'", "\'abort\'",
                                    "\'immediate-abort\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "panic strategy", s, all))
                                }));
                }
            })
    }
}
impl PanicStrategy {
    pub const ALL: &'static [PanicStrategy] =
        &[PanicStrategy::Unwind, PanicStrategy::Abort,
                    PanicStrategy::ImmediateAbort];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Unwind => "unwind",
            Self::Abort => "abort",
            Self::ImmediateAbort => "immediate-abort",
        }
    }
}
impl crate::json::ToJson for PanicStrategy {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for PanicStrategy {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for PanicStrategy {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
818    #[derive(Encodable, BlobDecodable, StableHash)]
819    pub enum PanicStrategy {
820        Unwind = "unwind",
821        Abort = "abort",
822        ImmediateAbort = "immediate-abort",
823    }
824
825    parse_error_type = "panic strategy";
826}
827
828#[derive(#[automatically_derived]
impl ::core::clone::Clone for OnBrokenPipe {
    #[inline]
    fn clone(&self) -> OnBrokenPipe { *self }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for OnBrokenPipe { }Copy, #[automatically_derived]
impl ::core::fmt::Debug for OnBrokenPipe {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                OnBrokenPipe::Default => "Default",
                OnBrokenPipe::Kill => "Kill",
                OnBrokenPipe::Error => "Error",
                OnBrokenPipe::Inherit => "Inherit",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for OnBrokenPipe {
    #[inline]
    fn eq(&self, other: &OnBrokenPipe) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for OnBrokenPipe {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for OnBrokenPipe {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        OnBrokenPipe::Default => { 0usize }
                        OnBrokenPipe::Kill => { 1usize }
                        OnBrokenPipe::Error => { 2usize }
                        OnBrokenPipe::Inherit => { 3usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    OnBrokenPipe::Default => {}
                    OnBrokenPipe::Kill => {}
                    OnBrokenPipe::Error => {}
                    OnBrokenPipe::Inherit => {}
                }
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::BlobDecoder> ::rustc_serialize::Decodable<__D>
            for OnBrokenPipe {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { OnBrokenPipe::Default }
                    1usize => { OnBrokenPipe::Kill }
                    2usize => { OnBrokenPipe::Error }
                    3usize => { OnBrokenPipe::Inherit }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `OnBrokenPipe`, expected 0..4, actual {0}",
                                n));
                    }
                }
            }
        }
    };BlobDecodable, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for OnBrokenPipe
            {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                ::std::mem::discriminant(self).stable_hash(__hcx, __hasher);
                match *self {
                    OnBrokenPipe::Default => {}
                    OnBrokenPipe::Kill => {}
                    OnBrokenPipe::Error => {}
                    OnBrokenPipe::Inherit => {}
                }
            }
        }
    };StableHash)]
829pub enum OnBrokenPipe {
830    Default,
831    Kill,
832    Error,
833    Inherit,
834}
835
836impl PanicStrategy {
837    pub const fn desc_symbol(&self) -> Symbol {
838        match *self {
839            PanicStrategy::Unwind => sym::unwind,
840            PanicStrategy::Abort => sym::abort,
841            PanicStrategy::ImmediateAbort => sym::immediate_abort,
842        }
843    }
844
845    pub fn unwinds(self) -> bool {
846        #[allow(non_exhaustive_omitted_patterns)] match self {
    PanicStrategy::Unwind => true,
    _ => false,
}matches!(self, PanicStrategy::Unwind)
847    }
848}
849
850#[automatically_derived]
impl ::core::clone::Clone for RelroLevel {
    #[inline]
    fn clone(&self) -> RelroLevel { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for RelroLevel { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for RelroLevel { }
#[automatically_derived]
impl ::core::cmp::PartialEq for RelroLevel {
    #[inline]
    fn eq(&self, other: &RelroLevel) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for RelroLevel {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for RelroLevel {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for RelroLevel {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                RelroLevel::Full => "Full",
                RelroLevel::Partial => "Partial",
                RelroLevel::Off => "Off",
                RelroLevel::None => "None",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for RelroLevel {
    #[inline]
    fn partial_cmp(&self, other: &RelroLevel)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for RelroLevel {
    #[inline]
    fn cmp(&self, other: &RelroLevel) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for RelroLevel {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "full" => Self::Full,
                "partial" => Self::Partial,
                "off" => Self::Off,
                "none" => Self::None,
                _ => {
                    let all =
                        ["\'full\'", "\'partial\'", "\'off\'",
                                    "\'none\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "relro level", s, all))
                                }));
                }
            })
    }
}
impl RelroLevel {
    pub const ALL: &'static [RelroLevel] =
        &[RelroLevel::Full, RelroLevel::Partial, RelroLevel::Off,
                    RelroLevel::None];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Full => "full",
            Self::Partial => "partial",
            Self::Off => "off",
            Self::None => "none",
        }
    }
}
impl crate::json::ToJson for RelroLevel {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for RelroLevel {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for RelroLevel {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
851    pub enum RelroLevel {
852        Full = "full",
853        Partial = "partial",
854        Off = "off",
855        None = "none",
856    }
857
858    parse_error_type = "relro level";
859}
860
861impl IntoDiagArg for PanicStrategy {
862    fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> DiagArgValue {
863        DiagArgValue::Str(Cow::Owned(self.desc().to_string()))
864    }
865}
866
867#[automatically_derived]
impl ::core::clone::Clone for SymbolVisibility {
    #[inline]
    fn clone(&self) -> SymbolVisibility { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for SymbolVisibility { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for SymbolVisibility { }
#[automatically_derived]
impl ::core::cmp::PartialEq for SymbolVisibility {
    #[inline]
    fn eq(&self, other: &SymbolVisibility) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for SymbolVisibility {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for SymbolVisibility {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for SymbolVisibility {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                SymbolVisibility::Hidden => "Hidden",
                SymbolVisibility::Protected => "Protected",
                SymbolVisibility::Interposable => "Interposable",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for SymbolVisibility {
    #[inline]
    fn partial_cmp(&self, other: &SymbolVisibility)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for SymbolVisibility {
    #[inline]
    fn cmp(&self, other: &SymbolVisibility) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for SymbolVisibility {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "hidden" => Self::Hidden,
                "protected" => Self::Protected,
                "interposable" => Self::Interposable,
                _ => {
                    let all =
                        ["\'hidden\'", "\'protected\'",
                                    "\'interposable\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "symbol visibility", s, all))
                                }));
                }
            })
    }
}
impl SymbolVisibility {
    pub const ALL: &'static [SymbolVisibility] =
        &[SymbolVisibility::Hidden, SymbolVisibility::Protected,
                    SymbolVisibility::Interposable];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Hidden => "hidden",
            Self::Protected => "protected",
            Self::Interposable => "interposable",
        }
    }
}
impl crate::json::ToJson for SymbolVisibility {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for SymbolVisibility {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for SymbolVisibility {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
868    pub enum SymbolVisibility {
869        Hidden = "hidden",
870        Protected = "protected",
871        Interposable = "interposable",
872    }
873
874    parse_error_type = "symbol visibility";
875}
876
877#[derive(#[automatically_derived]
impl ::core::clone::Clone for SmallDataThresholdSupport {
    #[inline]
    fn clone(&self) -> SmallDataThresholdSupport {
        match self {
            SmallDataThresholdSupport::None =>
                SmallDataThresholdSupport::None,
            SmallDataThresholdSupport::DefaultForArch =>
                SmallDataThresholdSupport::DefaultForArch,
            SmallDataThresholdSupport::LlvmModuleFlag(__self_0) =>
                SmallDataThresholdSupport::LlvmModuleFlag(::core::clone::Clone::clone(__self_0)),
            SmallDataThresholdSupport::LlvmArg(__self_0) =>
                SmallDataThresholdSupport::LlvmArg(::core::clone::Clone::clone(__self_0)),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for SmallDataThresholdSupport {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            SmallDataThresholdSupport::None =>
                ::core::fmt::Formatter::write_str(f, "None"),
            SmallDataThresholdSupport::DefaultForArch =>
                ::core::fmt::Formatter::write_str(f, "DefaultForArch"),
            SmallDataThresholdSupport::LlvmModuleFlag(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LlvmModuleFlag", &__self_0),
            SmallDataThresholdSupport::LlvmArg(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f,
                    "LlvmArg", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for SmallDataThresholdSupport {
    #[inline]
    fn eq(&self, other: &SmallDataThresholdSupport) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (SmallDataThresholdSupport::LlvmModuleFlag(__self_0),
                    SmallDataThresholdSupport::LlvmModuleFlag(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (SmallDataThresholdSupport::LlvmArg(__self_0),
                    SmallDataThresholdSupport::LlvmArg(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::hash::Hash for SmallDataThresholdSupport {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            SmallDataThresholdSupport::LlvmModuleFlag(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            SmallDataThresholdSupport::LlvmArg(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash)]
878pub enum SmallDataThresholdSupport {
879    None,
880    DefaultForArch,
881    LlvmModuleFlag(StaticCow<str>),
882    LlvmArg(StaticCow<str>),
883}
884
885impl FromStr for SmallDataThresholdSupport {
886    type Err = String;
887
888    fn from_str(s: &str) -> Result<Self, Self::Err> {
889        if s == "none" {
890            Ok(Self::None)
891        } else if s == "default-for-arch" {
892            Ok(Self::DefaultForArch)
893        } else if let Some(flag) = s.strip_prefix("llvm-module-flag=") {
894            Ok(Self::LlvmModuleFlag(flag.to_string().into()))
895        } else if let Some(arg) = s.strip_prefix("llvm-arg=") {
896            Ok(Self::LlvmArg(arg.to_string().into()))
897        } else {
898            Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("\'{0}\' is not a valid value for small-data-threshold-support.",
                s))
    })format!("'{s}' is not a valid value for small-data-threshold-support."))
899        }
900    }
901}
902
903impl<'de> serde::Deserialize<'de> for SmallDataThresholdSupport {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}crate::json::serde_deserialize_from_str!(SmallDataThresholdSupport);
904impl schemars::JsonSchema for SmallDataThresholdSupport {
905    fn schema_name() -> std::borrow::Cow<'static, str> {
906        "SmallDataThresholdSupport".into()
907    }
908    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
909        <::schemars::Schema as
            ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                let mut object = ::serde_json::Map::new();
                let _ =
                    object.insert(("type").into(),
                        ::serde_json::to_value(&"string").unwrap());
                let _ =
                    object.insert(("pattern").into(),
                        ::serde_json::to_value(&r#"^none|default-for-arch|llvm-module-flag=.+|llvm-arg=.+$"#).unwrap());
                ;
                object
            })).unwrap()schemars::json_schema! ({
910            "type": "string",
911            "pattern": r#"^none|default-for-arch|llvm-module-flag=.+|llvm-arg=.+$"#,
912        })
913    }
914}
915
916impl ToJson for SmallDataThresholdSupport {
917    fn to_json(&self) -> Value {
918        match self {
919            Self::None => "none".to_json(),
920            Self::DefaultForArch => "default-for-arch".to_json(),
921            Self::LlvmModuleFlag(flag) => ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("llvm-module-flag={0}", flag))
    })format!("llvm-module-flag={flag}").to_json(),
922            Self::LlvmArg(arg) => ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("llvm-arg={0}", arg))
    })format!("llvm-arg={arg}").to_json(),
923        }
924    }
925}
926
927#[automatically_derived]
impl ::core::clone::Clone for MergeFunctions {
    #[inline]
    fn clone(&self) -> MergeFunctions { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for MergeFunctions { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for MergeFunctions { }
#[automatically_derived]
impl ::core::cmp::PartialEq for MergeFunctions {
    #[inline]
    fn eq(&self, other: &MergeFunctions) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for MergeFunctions {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for MergeFunctions {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for MergeFunctions {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                MergeFunctions::Disabled => "Disabled",
                MergeFunctions::Trampolines => "Trampolines",
                MergeFunctions::Aliases => "Aliases",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for MergeFunctions {
    #[inline]
    fn partial_cmp(&self, other: &MergeFunctions)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for MergeFunctions {
    #[inline]
    fn cmp(&self, other: &MergeFunctions) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for MergeFunctions {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "disabled" => Self::Disabled,
                "trampolines" => Self::Trampolines,
                "aliases" => Self::Aliases,
                _ => {
                    let all =
                        ["\'disabled\'", "\'trampolines\'",
                                    "\'aliases\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "value for merge-functions", s, all))
                                }));
                }
            })
    }
}
impl MergeFunctions {
    pub const ALL: &'static [MergeFunctions] =
        &[MergeFunctions::Disabled, MergeFunctions::Trampolines,
                    MergeFunctions::Aliases];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Disabled => "disabled",
            Self::Trampolines => "trampolines",
            Self::Aliases => "aliases",
        }
    }
}
impl crate::json::ToJson for MergeFunctions {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for MergeFunctions {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for MergeFunctions {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
928    pub enum MergeFunctions {
929        Disabled = "disabled",
930        Trampolines = "trampolines",
931        Aliases = "aliases",
932    }
933
934    parse_error_type = "value for merge-functions";
935}
936
937#[automatically_derived]
impl ::core::clone::Clone for RelocModel {
    #[inline]
    fn clone(&self) -> RelocModel { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for RelocModel { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for RelocModel { }
#[automatically_derived]
impl ::core::cmp::PartialEq for RelocModel {
    #[inline]
    fn eq(&self, other: &RelocModel) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for RelocModel {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for RelocModel {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for RelocModel {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                RelocModel::Static => "Static",
                RelocModel::Pic => "Pic",
                RelocModel::Pie => "Pie",
                RelocModel::DynamicNoPic => "DynamicNoPic",
                RelocModel::Ropi => "Ropi",
                RelocModel::Rwpi => "Rwpi",
                RelocModel::RopiRwpi => "RopiRwpi",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for RelocModel {
    #[inline]
    fn partial_cmp(&self, other: &RelocModel)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for RelocModel {
    #[inline]
    fn cmp(&self, other: &RelocModel) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for RelocModel {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "static" => Self::Static,
                "pic" => Self::Pic,
                "pie" => Self::Pie,
                "dynamic-no-pic" => Self::DynamicNoPic,
                "ropi" => Self::Ropi,
                "rwpi" => Self::Rwpi,
                "ropi-rwpi" => Self::RopiRwpi,
                _ => {
                    let all =
                        ["\'static\'", "\'pic\'", "\'pie\'", "\'dynamic-no-pic\'",
                                    "\'ropi\'", "\'rwpi\'", "\'ropi-rwpi\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "relocation model", s, all))
                                }));
                }
            })
    }
}
impl RelocModel {
    pub const ALL: &'static [RelocModel] =
        &[RelocModel::Static, RelocModel::Pic, RelocModel::Pie,
                    RelocModel::DynamicNoPic, RelocModel::Ropi,
                    RelocModel::Rwpi, RelocModel::RopiRwpi];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Static => "static",
            Self::Pic => "pic",
            Self::Pie => "pie",
            Self::DynamicNoPic => "dynamic-no-pic",
            Self::Ropi => "ropi",
            Self::Rwpi => "rwpi",
            Self::RopiRwpi => "ropi-rwpi",
        }
    }
}
impl crate::json::ToJson for RelocModel {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for RelocModel {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for RelocModel {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
938    pub enum RelocModel {
939        Static = "static",
940        Pic = "pic",
941        Pie = "pie",
942        DynamicNoPic = "dynamic-no-pic",
943        Ropi = "ropi",
944        Rwpi = "rwpi",
945        RopiRwpi = "ropi-rwpi",
946    }
947
948    parse_error_type = "relocation model";
949}
950
951impl RelocModel {
952    pub const fn desc_symbol(&self) -> Symbol {
953        match *self {
954            RelocModel::Static => kw::Static,
955            RelocModel::Pic => sym::pic,
956            RelocModel::Pie => sym::pie,
957            RelocModel::DynamicNoPic => sym::dynamic_no_pic,
958            RelocModel::Ropi => sym::ropi,
959            RelocModel::Rwpi => sym::rwpi,
960            RelocModel::RopiRwpi => sym::ropi_rwpi,
961        }
962    }
963}
964
965#[automatically_derived]
impl ::core::clone::Clone for CodeModel {
    #[inline]
    fn clone(&self) -> CodeModel { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for CodeModel { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for CodeModel { }
#[automatically_derived]
impl ::core::cmp::PartialEq for CodeModel {
    #[inline]
    fn eq(&self, other: &CodeModel) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for CodeModel {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for CodeModel {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for CodeModel {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                CodeModel::Tiny => "Tiny",
                CodeModel::Small => "Small",
                CodeModel::Kernel => "Kernel",
                CodeModel::Medium => "Medium",
                CodeModel::Large => "Large",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for CodeModel {
    #[inline]
    fn partial_cmp(&self, other: &CodeModel)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for CodeModel {
    #[inline]
    fn cmp(&self, other: &CodeModel) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for CodeModel {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "tiny" => Self::Tiny,
                "small" => Self::Small,
                "kernel" => Self::Kernel,
                "medium" => Self::Medium,
                "large" => Self::Large,
                _ => {
                    let all =
                        ["\'tiny\'", "\'small\'", "\'kernel\'", "\'medium\'",
                                    "\'large\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "code model", s, all))
                                }));
                }
            })
    }
}
impl CodeModel {
    pub const ALL: &'static [CodeModel] =
        &[CodeModel::Tiny, CodeModel::Small, CodeModel::Kernel,
                    CodeModel::Medium, CodeModel::Large];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Tiny => "tiny",
            Self::Small => "small",
            Self::Kernel => "kernel",
            Self::Medium => "medium",
            Self::Large => "large",
        }
    }
}
impl crate::json::ToJson for CodeModel {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for CodeModel {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for CodeModel {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
966    pub enum CodeModel {
967        Tiny = "tiny",
968        Small = "small",
969        Kernel = "kernel",
970        Medium = "medium",
971        Large = "large",
972    }
973
974    parse_error_type = "code model";
975}
976
977#[automatically_derived]
impl ::core::clone::Clone for FloatAbi {
    #[inline]
    fn clone(&self) -> FloatAbi { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for FloatAbi { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for FloatAbi { }
#[automatically_derived]
impl ::core::cmp::PartialEq for FloatAbi {
    #[inline]
    fn eq(&self, other: &FloatAbi) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for FloatAbi {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for FloatAbi {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for FloatAbi {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                FloatAbi::Soft => "Soft",
                FloatAbi::Hard => "Hard",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for FloatAbi {
    #[inline]
    fn partial_cmp(&self, other: &FloatAbi)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for FloatAbi {
    #[inline]
    fn cmp(&self, other: &FloatAbi) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for FloatAbi {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "soft" => Self::Soft,
                "hard" => Self::Hard,
                _ => {
                    let all = ["\'soft\'", "\'hard\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "float abi", s, all))
                                }));
                }
            })
    }
}
impl FloatAbi {
    pub const ALL: &'static [FloatAbi] = &[FloatAbi::Soft, FloatAbi::Hard];
    pub fn desc(&self) -> &'static str {
        match self { Self::Soft => "soft", Self::Hard => "hard", }
    }
}
impl crate::json::ToJson for FloatAbi {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for FloatAbi {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for FloatAbi {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
978    /// The float ABI setting to be configured in the LLVM target machine.
979    pub enum FloatAbi {
980        Soft = "soft",
981        Hard = "hard",
982    }
983
984    parse_error_type = "float abi";
985}
986
987#[automatically_derived]
impl ::core::clone::Clone for RustcAbi {
    #[inline]
    fn clone(&self) -> RustcAbi { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for RustcAbi { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for RustcAbi { }
#[automatically_derived]
impl ::core::cmp::PartialEq for RustcAbi {
    #[inline]
    fn eq(&self, other: &RustcAbi) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for RustcAbi {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for RustcAbi {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for RustcAbi {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                RustcAbi::X86Sse2 => "X86Sse2",
                RustcAbi::PowerPcSpe => "PowerPcSpe",
                RustcAbi::Softfloat => "Softfloat",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for RustcAbi {
    #[inline]
    fn partial_cmp(&self, other: &RustcAbi)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for RustcAbi {
    #[inline]
    fn cmp(&self, other: &RustcAbi) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for RustcAbi {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "x86-sse2" => Self::X86Sse2,
                "powerpc-spe" => Self::PowerPcSpe,
                "softfloat" => Self::Softfloat,
                _ => {
                    let all =
                        ["\'x86-sse2\'", "\'powerpc-spe\'",
                                    "\'softfloat\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "rustc abi", s, all))
                                }));
                }
            })
    }
}
impl RustcAbi {
    pub const ALL: &'static [RustcAbi] =
        &[RustcAbi::X86Sse2, RustcAbi::PowerPcSpe, RustcAbi::Softfloat];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::X86Sse2 => "x86-sse2",
            Self::PowerPcSpe => "powerpc-spe",
            Self::Softfloat => "softfloat",
        }
    }
}
impl crate::json::ToJson for RustcAbi {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for RustcAbi {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for RustcAbi {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
988    /// The Rustc-specific variant of the ABI used for this target.
989    pub enum RustcAbi {
990        /// On x86-32 only: make use of SSE and SSE2 for ABI purposes.
991        X86Sse2 = "x86-sse2",
992        /// On PowerPC only: build for SPE.
993        PowerPcSpe = "powerpc-spe",
994        /// On x86-32/64, aarch64, and S390x: do not use any FPU or SIMD registers for the ABI.
995        Softfloat = "softfloat",
996    }
997
998    parse_error_type = "rustc abi";
999}
1000
1001#[automatically_derived]
impl ::core::clone::Clone for TlsModel {
    #[inline]
    fn clone(&self) -> TlsModel { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for TlsModel { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for TlsModel { }
#[automatically_derived]
impl ::core::cmp::PartialEq for TlsModel {
    #[inline]
    fn eq(&self, other: &TlsModel) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for TlsModel {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for TlsModel {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for TlsModel {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                TlsModel::GeneralDynamic => "GeneralDynamic",
                TlsModel::LocalDynamic => "LocalDynamic",
                TlsModel::InitialExec => "InitialExec",
                TlsModel::LocalExec => "LocalExec",
                TlsModel::Emulated => "Emulated",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for TlsModel {
    #[inline]
    fn partial_cmp(&self, other: &TlsModel)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for TlsModel {
    #[inline]
    fn cmp(&self, other: &TlsModel) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for TlsModel {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "global-dynamic" => Self::GeneralDynamic,
                "local-dynamic" => Self::LocalDynamic,
                "initial-exec" => Self::InitialExec,
                "local-exec" => Self::LocalExec,
                "emulated" => Self::Emulated,
                _ => {
                    let all =
                        ["\'global-dynamic\'", "\'local-dynamic\'",
                                    "\'initial-exec\'", "\'local-exec\'",
                                    "\'emulated\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "TLS model", s, all))
                                }));
                }
            })
    }
}
impl TlsModel {
    pub const ALL: &'static [TlsModel] =
        &[TlsModel::GeneralDynamic, TlsModel::LocalDynamic,
                    TlsModel::InitialExec, TlsModel::LocalExec,
                    TlsModel::Emulated];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::GeneralDynamic => "global-dynamic",
            Self::LocalDynamic => "local-dynamic",
            Self::InitialExec => "initial-exec",
            Self::LocalExec => "local-exec",
            Self::Emulated => "emulated",
        }
    }
}
impl crate::json::ToJson for TlsModel {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for TlsModel {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for TlsModel {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1002    pub enum TlsModel {
1003        GeneralDynamic = "global-dynamic",
1004        LocalDynamic = "local-dynamic",
1005        InitialExec = "initial-exec",
1006        LocalExec = "local-exec",
1007        Emulated = "emulated",
1008    }
1009
1010    parse_error_type = "TLS model";
1011}
1012
1013#[automatically_derived]
impl ::core::clone::Clone for LinkOutputKind {
    #[inline]
    fn clone(&self) -> LinkOutputKind { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for LinkOutputKind { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for LinkOutputKind { }
#[automatically_derived]
impl ::core::cmp::PartialEq for LinkOutputKind {
    #[inline]
    fn eq(&self, other: &LinkOutputKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for LinkOutputKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for LinkOutputKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for LinkOutputKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                LinkOutputKind::DynamicNoPicExe => "DynamicNoPicExe",
                LinkOutputKind::DynamicPicExe => "DynamicPicExe",
                LinkOutputKind::StaticNoPicExe => "StaticNoPicExe",
                LinkOutputKind::StaticPicExe => "StaticPicExe",
                LinkOutputKind::DynamicDylib => "DynamicDylib",
                LinkOutputKind::StaticDylib => "StaticDylib",
                LinkOutputKind::WasiReactorExe => "WasiReactorExe",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for LinkOutputKind {
    #[inline]
    fn partial_cmp(&self, other: &LinkOutputKind)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for LinkOutputKind {
    #[inline]
    fn cmp(&self, other: &LinkOutputKind) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for LinkOutputKind {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "dynamic-nopic-exe" => Self::DynamicNoPicExe,
                "dynamic-pic-exe" => Self::DynamicPicExe,
                "static-nopic-exe" => Self::StaticNoPicExe,
                "static-pic-exe" => Self::StaticPicExe,
                "dynamic-dylib" => Self::DynamicDylib,
                "static-dylib" => Self::StaticDylib,
                "wasi-reactor-exe" => Self::WasiReactorExe,
                _ => {
                    let all =
                        ["\'dynamic-nopic-exe\'", "\'dynamic-pic-exe\'",
                                    "\'static-nopic-exe\'", "\'static-pic-exe\'",
                                    "\'dynamic-dylib\'", "\'static-dylib\'",
                                    "\'wasi-reactor-exe\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "CRT object kind", s, all))
                                }));
                }
            })
    }
}
impl LinkOutputKind {
    pub const ALL: &'static [LinkOutputKind] =
        &[LinkOutputKind::DynamicNoPicExe, LinkOutputKind::DynamicPicExe,
                    LinkOutputKind::StaticNoPicExe,
                    LinkOutputKind::StaticPicExe, LinkOutputKind::DynamicDylib,
                    LinkOutputKind::StaticDylib,
                    LinkOutputKind::WasiReactorExe];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::DynamicNoPicExe => "dynamic-nopic-exe",
            Self::DynamicPicExe => "dynamic-pic-exe",
            Self::StaticNoPicExe => "static-nopic-exe",
            Self::StaticPicExe => "static-pic-exe",
            Self::DynamicDylib => "dynamic-dylib",
            Self::StaticDylib => "static-dylib",
            Self::WasiReactorExe => "wasi-reactor-exe",
        }
    }
}
impl crate::json::ToJson for LinkOutputKind {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for LinkOutputKind {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for LinkOutputKind {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1014    /// Everything is flattened to a single enum to make the json encoding/decoding less annoying.
1015    pub enum LinkOutputKind {
1016        /// Dynamically linked non position-independent executable.
1017        DynamicNoPicExe = "dynamic-nopic-exe",
1018        /// Dynamically linked position-independent executable.
1019        DynamicPicExe = "dynamic-pic-exe",
1020        /// Statically linked non position-independent executable.
1021        StaticNoPicExe = "static-nopic-exe",
1022        /// Statically linked position-independent executable.
1023        StaticPicExe = "static-pic-exe",
1024        /// Regular dynamic library ("dynamically linked").
1025        DynamicDylib = "dynamic-dylib",
1026        /// Dynamic library with bundled libc ("statically linked").
1027        StaticDylib = "static-dylib",
1028        /// WASI module with a lifetime past the _initialize entry point
1029        WasiReactorExe = "wasi-reactor-exe",
1030    }
1031
1032    parse_error_type = "CRT object kind";
1033}
1034
1035impl LinkOutputKind {
1036    pub fn can_link_dylib(self) -> bool {
1037        match self {
1038            LinkOutputKind::StaticNoPicExe | LinkOutputKind::StaticPicExe => false,
1039            LinkOutputKind::DynamicNoPicExe
1040            | LinkOutputKind::DynamicPicExe
1041            | LinkOutputKind::DynamicDylib
1042            | LinkOutputKind::StaticDylib
1043            | LinkOutputKind::WasiReactorExe => true,
1044        }
1045    }
1046}
1047
1048pub type LinkArgs = BTreeMap<LinkerFlavor, Vec<StaticCow<str>>>;
1049pub type LinkArgsCli = BTreeMap<LinkerFlavorCli, Vec<StaticCow<str>>>;
1050
1051#[automatically_derived]
impl ::core::clone::Clone for DebuginfoKind {
    #[inline]
    fn clone(&self) -> DebuginfoKind { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for DebuginfoKind { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for DebuginfoKind { }
#[automatically_derived]
impl ::core::cmp::PartialEq for DebuginfoKind {
    #[inline]
    fn eq(&self, other: &DebuginfoKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for DebuginfoKind {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for DebuginfoKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for DebuginfoKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                DebuginfoKind::Dwarf => "Dwarf",
                DebuginfoKind::DwarfDsym => "DwarfDsym",
                DebuginfoKind::Pdb => "Pdb",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for DebuginfoKind {
    #[inline]
    fn partial_cmp(&self, other: &DebuginfoKind)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for DebuginfoKind {
    #[inline]
    fn cmp(&self, other: &DebuginfoKind) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
#[automatically_derived]
impl ::core::default::Default for DebuginfoKind {
    #[inline]
    fn default() -> DebuginfoKind { Self::Dwarf }
}
impl FromStr for DebuginfoKind {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "dwarf" => Self::Dwarf,
                "dwarf-dsym" => Self::DwarfDsym,
                "pdb" => Self::Pdb,
                _ => {
                    let all =
                        ["\'dwarf\'", "\'dwarf-dsym\'", "\'pdb\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "debuginfo kind", s, all))
                                }));
                }
            })
    }
}
impl DebuginfoKind {
    pub const ALL: &'static [DebuginfoKind] =
        &[DebuginfoKind::Dwarf, DebuginfoKind::DwarfDsym, DebuginfoKind::Pdb];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Dwarf => "dwarf",
            Self::DwarfDsym => "dwarf-dsym",
            Self::Pdb => "pdb",
        }
    }
}
impl crate::json::ToJson for DebuginfoKind {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for DebuginfoKind {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for DebuginfoKind {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1052    /// Which kind of debuginfo does the target use?
1053    ///
1054    /// Useful in determining whether a target supports Split DWARF (a target with
1055    /// `DebuginfoKind::Dwarf` and supporting `SplitDebuginfo::Unpacked` for example).
1056    #[derive(Default)]
1057    pub enum DebuginfoKind {
1058        /// DWARF debuginfo (such as that used on `x86_64_unknown_linux_gnu`).
1059        #[default]
1060        Dwarf = "dwarf",
1061        /// DWARF debuginfo in dSYM files (such as on Apple platforms).
1062        DwarfDsym = "dwarf-dsym",
1063        /// Program database files (such as on Windows).
1064        Pdb = "pdb",
1065    }
1066
1067    parse_error_type = "debuginfo kind";
1068}
1069
1070#[automatically_derived]
impl ::core::clone::Clone for SplitDebuginfo {
    #[inline]
    fn clone(&self) -> SplitDebuginfo { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for SplitDebuginfo { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for SplitDebuginfo { }
#[automatically_derived]
impl ::core::cmp::PartialEq for SplitDebuginfo {
    #[inline]
    fn eq(&self, other: &SplitDebuginfo) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for SplitDebuginfo {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for SplitDebuginfo {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for SplitDebuginfo {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                SplitDebuginfo::Off => "Off",
                SplitDebuginfo::Packed => "Packed",
                SplitDebuginfo::Unpacked => "Unpacked",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for SplitDebuginfo {
    #[inline]
    fn partial_cmp(&self, other: &SplitDebuginfo)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for SplitDebuginfo {
    #[inline]
    fn cmp(&self, other: &SplitDebuginfo) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
#[automatically_derived]
impl ::core::default::Default for SplitDebuginfo {
    #[inline]
    fn default() -> SplitDebuginfo { Self::Off }
}
const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for SplitDebuginfo {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        SplitDebuginfo::Off => { 0usize }
                        SplitDebuginfo::Packed => { 1usize }
                        SplitDebuginfo::Unpacked => { 2usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    SplitDebuginfo::Off => {}
                    SplitDebuginfo::Packed => {}
                    SplitDebuginfo::Unpacked => {}
                }
            }
        }
    };
const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for SplitDebuginfo {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { SplitDebuginfo::Off }
                    1usize => { SplitDebuginfo::Packed }
                    2usize => { SplitDebuginfo::Unpacked }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `SplitDebuginfo`, expected 0..3, actual {0}",
                                n));
                    }
                }
            }
        }
    };
impl FromStr for SplitDebuginfo {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "off" => Self::Off,
                "packed" => Self::Packed,
                "unpacked" => Self::Unpacked,
                _ => {
                    let all =
                        ["\'off\'", "\'packed\'", "\'unpacked\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "split debuginfo", s, all))
                                }));
                }
            })
    }
}
impl SplitDebuginfo {
    pub const ALL: &'static [SplitDebuginfo] =
        &[SplitDebuginfo::Off, SplitDebuginfo::Packed,
                    SplitDebuginfo::Unpacked];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Off => "off",
            Self::Packed => "packed",
            Self::Unpacked => "unpacked",
        }
    }
}
impl crate::json::ToJson for SplitDebuginfo {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for SplitDebuginfo {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for SplitDebuginfo {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1071    #[derive(Default, Encodable, Decodable)]
1072    pub enum SplitDebuginfo {
1073        /// Split debug-information is disabled, meaning that on supported platforms
1074        /// you can find all debug information in the executable itself. This is
1075        /// only supported for ELF effectively.
1076        ///
1077        /// * Windows - not supported
1078        /// * macOS - don't run `dsymutil`
1079        /// * ELF - `.debug_*` sections
1080        #[default]
1081        Off = "off",
1082
1083        /// Split debug-information can be found in a "packed" location separate
1084        /// from the final artifact. This is supported on all platforms.
1085        ///
1086        /// * Windows - `*.pdb`
1087        /// * macOS - `*.dSYM` (run `dsymutil`)
1088        /// * ELF - `*.dwp` (run `thorin`)
1089        Packed = "packed",
1090
1091        /// Split debug-information can be found in individual object files on the
1092        /// filesystem. The main executable may point to the object files.
1093        ///
1094        /// * Windows - not supported
1095        /// * macOS - supported, scattered object files
1096        /// * ELF - supported, scattered `*.dwo` or `*.o` files (see `SplitDwarfKind`)
1097        Unpacked = "unpacked",
1098    }
1099
1100    parse_error_type = "split debuginfo";
1101}
1102
1103impl ::rustc_error_messages::IntoDiagArg for SplitDebuginfo {
    fn into_diag_arg(self, path: &mut Option<std::path::PathBuf>)
        -> ::rustc_error_messages::DiagArgValue {
        self.to_string().into_diag_arg(path)
    }
}into_diag_arg_using_display!(SplitDebuginfo);
1104
1105#[derive(#[automatically_derived]
impl ::core::clone::Clone for StackProbeType {
    #[inline]
    fn clone(&self) -> StackProbeType {
        match self {
            StackProbeType::None => StackProbeType::None,
            StackProbeType::Inline => StackProbeType::Inline,
            StackProbeType::Call => StackProbeType::Call,
            StackProbeType::InlineOrCall {
                min_llvm_version_for_inline: __self_0 } =>
                StackProbeType::InlineOrCall {
                    min_llvm_version_for_inline: ::core::clone::Clone::clone(__self_0),
                },
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for StackProbeType {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            StackProbeType::None =>
                ::core::fmt::Formatter::write_str(f, "None"),
            StackProbeType::Inline =>
                ::core::fmt::Formatter::write_str(f, "Inline"),
            StackProbeType::Call =>
                ::core::fmt::Formatter::write_str(f, "Call"),
            StackProbeType::InlineOrCall {
                min_llvm_version_for_inline: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f,
                    "InlineOrCall", "min_llvm_version_for_inline", &__self_0),
        }
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for StackProbeType {
    #[inline]
    fn eq(&self, other: &StackProbeType) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (StackProbeType::InlineOrCall {
                    min_llvm_version_for_inline: __self_0 },
                    StackProbeType::InlineOrCall {
                    min_llvm_version_for_inline: __arg1_0 }) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for StackProbeType {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<(u32, u32, u32)>;
    }
}Eq, #[doc(hidden)]
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications,
clippy :: absolute_paths,)]
const _: () =
    {
        #[allow(unused_extern_crates, clippy :: useless_attribute)]
        extern crate serde as _serde;
        ;
        #[automatically_derived]
        impl<'de> _serde::Deserialize<'de> for StackProbeType {
            fn deserialize<__D>(__deserializer: __D)
                -> _serde::__private228::Result<Self, __D::Error> where
                __D: _serde::Deserializer<'de> {
                #[allow(non_camel_case_types)]
                #[doc(hidden)]
                enum __Field { __field0, __field1, __field2, __field3, }
                #[doc(hidden)]
                struct __FieldVisitor;
                #[automatically_derived]
                impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
                    type Value = __Field;
                    fn expecting(&self,
                        __formatter: &mut _serde::__private228::Formatter)
                        -> _serde::__private228::fmt::Result {
                        _serde::__private228::Formatter::write_str(__formatter,
                            "variant identifier")
                    }
                    fn visit_u64<__E>(self, __value: u64)
                        -> _serde::__private228::Result<Self::Value, __E> where
                        __E: _serde::de::Error {
                        match __value {
                            0u64 => _serde::__private228::Ok(__Field::__field0),
                            1u64 => _serde::__private228::Ok(__Field::__field1),
                            2u64 => _serde::__private228::Ok(__Field::__field2),
                            3u64 => _serde::__private228::Ok(__Field::__field3),
                            _ =>
                                _serde::__private228::Err(_serde::de::Error::invalid_value(_serde::de::Unexpected::Unsigned(__value),
                                        &"variant index 0 <= i < 4")),
                        }
                    }
                    fn visit_str<__E>(self, __value: &str)
                        -> _serde::__private228::Result<Self::Value, __E> where
                        __E: _serde::de::Error {
                        match __value {
                            "none" => _serde::__private228::Ok(__Field::__field0),
                            "inline" => _serde::__private228::Ok(__Field::__field1),
                            "call" => _serde::__private228::Ok(__Field::__field2),
                            "inline-or-call" =>
                                _serde::__private228::Ok(__Field::__field3),
                            _ => {
                                _serde::__private228::Err(_serde::de::Error::unknown_variant(__value,
                                        VARIANTS))
                            }
                        }
                    }
                    fn visit_bytes<__E>(self, __value: &[u8])
                        -> _serde::__private228::Result<Self::Value, __E> where
                        __E: _serde::de::Error {
                        match __value {
                            b"none" => _serde::__private228::Ok(__Field::__field0),
                            b"inline" => _serde::__private228::Ok(__Field::__field1),
                            b"call" => _serde::__private228::Ok(__Field::__field2),
                            b"inline-or-call" =>
                                _serde::__private228::Ok(__Field::__field3),
                            _ => {
                                let __value =
                                    &_serde::__private228::from_utf8_lossy(__value);
                                _serde::__private228::Err(_serde::de::Error::unknown_variant(__value,
                                        VARIANTS))
                            }
                        }
                    }
                }
                #[automatically_derived]
                impl<'de> _serde::Deserialize<'de> for __Field {
                    #[inline]
                    fn deserialize<__D>(__deserializer: __D)
                        -> _serde::__private228::Result<Self, __D::Error> where
                        __D: _serde::Deserializer<'de> {
                        _serde::Deserializer::deserialize_identifier(__deserializer,
                            __FieldVisitor)
                    }
                }
                #[doc(hidden)]
                const VARIANTS: &'static [&'static str] =
                    &["none", "inline", "call", "inline-or-call"];
                let (__tag, __content) =
                    _serde::Deserializer::deserialize_any(__deserializer,
                            _serde::__private228::de::TaggedContentVisitor::<__Field>::new("kind",
                                "internally tagged enum StackProbeType"))?;
                let __deserializer =
                    _serde::__private228::de::ContentDeserializer::<__D::Error>::new(__content);
                match __tag {
                    __Field::__field0 => {
                        _serde::Deserializer::deserialize_any(__deserializer,
                                _serde::__private228::de::InternallyTaggedUnitVisitor::new("StackProbeType",
                                    "None"))?;
                        _serde::__private228::Ok(StackProbeType::None)
                    }
                    __Field::__field1 => {
                        _serde::Deserializer::deserialize_any(__deserializer,
                                _serde::__private228::de::InternallyTaggedUnitVisitor::new("StackProbeType",
                                    "Inline"))?;
                        _serde::__private228::Ok(StackProbeType::Inline)
                    }
                    __Field::__field2 => {
                        _serde::Deserializer::deserialize_any(__deserializer,
                                _serde::__private228::de::InternallyTaggedUnitVisitor::new("StackProbeType",
                                    "Call"))?;
                        _serde::__private228::Ok(StackProbeType::Call)
                    }
                    __Field::__field3 => {
                        #[allow(non_camel_case_types)]
                        #[doc(hidden)]
                        enum __Field { __field0, __ignore, }
                        #[doc(hidden)]
                        struct __FieldVisitor;
                        #[automatically_derived]
                        impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
                            type Value = __Field;
                            fn expecting(&self,
                                __formatter: &mut _serde::__private228::Formatter)
                                -> _serde::__private228::fmt::Result {
                                _serde::__private228::Formatter::write_str(__formatter,
                                    "field identifier")
                            }
                            fn visit_u64<__E>(self, __value: u64)
                                -> _serde::__private228::Result<Self::Value, __E> where
                                __E: _serde::de::Error {
                                match __value {
                                    0u64 => _serde::__private228::Ok(__Field::__field0),
                                    _ => _serde::__private228::Ok(__Field::__ignore),
                                }
                            }
                            fn visit_str<__E>(self, __value: &str)
                                -> _serde::__private228::Result<Self::Value, __E> where
                                __E: _serde::de::Error {
                                match __value {
                                    "min-llvm-version-for-inline" =>
                                        _serde::__private228::Ok(__Field::__field0),
                                    _ => { _serde::__private228::Ok(__Field::__ignore) }
                                }
                            }
                            fn visit_bytes<__E>(self, __value: &[u8])
                                -> _serde::__private228::Result<Self::Value, __E> where
                                __E: _serde::de::Error {
                                match __value {
                                    b"min-llvm-version-for-inline" =>
                                        _serde::__private228::Ok(__Field::__field0),
                                    _ => { _serde::__private228::Ok(__Field::__ignore) }
                                }
                            }
                        }
                        #[automatically_derived]
                        impl<'de> _serde::Deserialize<'de> for __Field {
                            #[inline]
                            fn deserialize<__D>(__deserializer: __D)
                                -> _serde::__private228::Result<Self, __D::Error> where
                                __D: _serde::Deserializer<'de> {
                                _serde::Deserializer::deserialize_identifier(__deserializer,
                                    __FieldVisitor)
                            }
                        }
                        #[doc(hidden)]
                        struct __Visitor<'de> {
                            marker: _serde::__private228::PhantomData<StackProbeType>,
                            lifetime: _serde::__private228::PhantomData<&'de ()>,
                        }
                        #[automatically_derived]
                        impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> {
                            type Value = StackProbeType;
                            fn expecting(&self,
                                __formatter: &mut _serde::__private228::Formatter)
                                -> _serde::__private228::fmt::Result {
                                _serde::__private228::Formatter::write_str(__formatter,
                                    "struct variant StackProbeType::InlineOrCall")
                            }
                            #[inline]
                            fn visit_seq<__A>(self, mut __seq: __A)
                                -> _serde::__private228::Result<Self::Value, __A::Error>
                                where __A: _serde::de::SeqAccess<'de> {
                                let __field0 =
                                    match _serde::de::SeqAccess::next_element::<(u32, u32,
                                                    u32)>(&mut __seq)? {
                                        _serde::__private228::Some(__value) => __value,
                                        _serde::__private228::None =>
                                            return _serde::__private228::Err(_serde::de::Error::invalid_length(0usize,
                                                        &"struct variant StackProbeType::InlineOrCall with 1 element")),
                                    };
                                _serde::__private228::Ok(StackProbeType::InlineOrCall {
                                        min_llvm_version_for_inline: __field0,
                                    })
                            }
                            #[inline]
                            fn visit_map<__A>(self, mut __map: __A)
                                -> _serde::__private228::Result<Self::Value, __A::Error>
                                where __A: _serde::de::MapAccess<'de> {
                                let mut __field0:
                                        _serde::__private228::Option<(u32, u32, u32)> =
                                    _serde::__private228::None;
                                while let _serde::__private228::Some(__key) =
                                        _serde::de::MapAccess::next_key::<__Field>(&mut __map)? {
                                    match __key {
                                        __Field::__field0 => {
                                            if _serde::__private228::Option::is_some(&__field0) {
                                                return _serde::__private228::Err(<__A::Error as
                                                                _serde::de::Error>::duplicate_field("min-llvm-version-for-inline"));
                                            }
                                            __field0 =
                                                _serde::__private228::Some(_serde::de::MapAccess::next_value::<(u32,
                                                                u32, u32)>(&mut __map)?);
                                        }
                                        _ => {
                                            let _ =
                                                _serde::de::MapAccess::next_value::<_serde::de::IgnoredAny>(&mut __map)?;
                                        }
                                    }
                                }
                                let __field0 =
                                    match __field0 {
                                        _serde::__private228::Some(__field0) => __field0,
                                        _serde::__private228::None =>
                                            _serde::__private228::de::missing_field("min-llvm-version-for-inline")?,
                                    };
                                _serde::__private228::Ok(StackProbeType::InlineOrCall {
                                        min_llvm_version_for_inline: __field0,
                                    })
                            }
                        }
                        #[doc(hidden)]
                        const FIELDS: &'static [&'static str] =
                            &["min-llvm-version-for-inline"];
                        _serde::Deserializer::deserialize_any(__deserializer,
                            __Visitor {
                                marker: _serde::__private228::PhantomData::<StackProbeType>,
                                lifetime: _serde::__private228::PhantomData,
                            })
                    }
                }
            }
        }
    };serde_derive::Deserialize, const _: () =
    {
        #[automatically_derived]
        #[allow(unused_braces)]
        impl schemars::JsonSchema for StackProbeType {
            fn schema_name()
                -> schemars::_private::alloc::borrow::Cow<'static, str> {
                schemars::_private::alloc::borrow::Cow::Borrowed("StackProbeType")
            }
            fn schema_id()
                -> schemars::_private::alloc::borrow::Cow<'static, str> {
                schemars::_private::alloc::borrow::Cow::Borrowed("rustc_target::spec::StackProbeType")
            }
            fn json_schema(generator: &mut schemars::SchemaGenerator)
                -> schemars::Schema {
                {
                    {
                        let mut map = schemars::_private::serde_json::Map::new();
                        map.insert("oneOf".into(),
                            schemars::_private::serde_json::Value::Array({
                                    let mut enum_values =
                                        schemars::_private::alloc::vec::Vec::new();
                                    enum_values.push({
                                                let mut schema = generator.subschema_for::<()>();
                                                schemars::_private::apply_internal_enum_variant_tag(&mut schema,
                                                    "kind", "none", false);
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "title",
                                                    {
                                                        const TITLE: &str =
                                                            schemars::_private::get_title_and_description("Don\'t emit any stack probes.").0;
                                                        TITLE
                                                    });
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "description",
                                                    {
                                                        const DESCRIPTION: &str =
                                                            schemars::_private::get_title_and_description("Don\'t emit any stack probes.").1;
                                                        DESCRIPTION
                                                    });
                                                schema
                                            }.to_value());
                                    enum_values.push({
                                                let mut schema = generator.subschema_for::<()>();
                                                schemars::_private::apply_internal_enum_variant_tag(&mut schema,
                                                    "kind", "inline", false);
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "title",
                                                    {
                                                        const TITLE: &str =
                                                            schemars::_private::get_title_and_description("It is harmless to use this option even on targets that do not have backend support for\nstack probes as the failure mode is the same as if no stack-probe option was specified in\nthe first place.").0;
                                                        TITLE
                                                    });
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "description",
                                                    {
                                                        const DESCRIPTION: &str =
                                                            schemars::_private::get_title_and_description("It is harmless to use this option even on targets that do not have backend support for\nstack probes as the failure mode is the same as if no stack-probe option was specified in\nthe first place.").1;
                                                        DESCRIPTION
                                                    });
                                                schema
                                            }.to_value());
                                    enum_values.push({
                                                let mut schema = generator.subschema_for::<()>();
                                                schemars::_private::apply_internal_enum_variant_tag(&mut schema,
                                                    "kind", "call", false);
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "title",
                                                    {
                                                        const TITLE: &str =
                                                            schemars::_private::get_title_and_description("Call `__rust_probestack` whenever stack needs to be probed.").0;
                                                        TITLE
                                                    });
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "description",
                                                    {
                                                        const DESCRIPTION: &str =
                                                            schemars::_private::get_title_and_description("Call `__rust_probestack` whenever stack needs to be probed.").1;
                                                        DESCRIPTION
                                                    });
                                                schema
                                            }.to_value());
                                    enum_values.push({
                                                let mut schema =
                                                    <::schemars::Schema as
                                                                ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                                                                    let mut object = ::serde_json::Map::new();
                                                                    let _ =
                                                                        object.insert(("type").into(),
                                                                            ::serde_json::to_value(&"object").unwrap());
                                                                    ;
                                                                    object
                                                                })).unwrap();
                                                {
                                                    schemars::_private::insert_object_property(&mut schema,
                                                        "min-llvm-version-for-inline",
                                                        generator.contract().is_deserialize() &&
                                                            <(u32, u32, u32) as
                                                                    schemars::JsonSchema>::_schemars_private_is_option(),
                                                        { generator.subschema_for::<(u32, u32, u32)>() });
                                                }
                                                schemars::_private::apply_internal_enum_variant_tag(&mut schema,
                                                    "kind", "inline-or-call", false);
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "title",
                                                    {
                                                        const TITLE: &str =
                                                            schemars::_private::get_title_and_description("Use inline option for LLVM versions later than specified in `min_llvm_version_for_inline`\nand call `__rust_probestack` otherwise.").0;
                                                        TITLE
                                                    });
                                                schemars::_private::insert_metadata_property_if_nonempty(&mut schema,
                                                    "description",
                                                    {
                                                        const DESCRIPTION: &str =
                                                            schemars::_private::get_title_and_description("Use inline option for LLVM versions later than specified in `min_llvm_version_for_inline`\nand call `__rust_probestack` otherwise.").1;
                                                        DESCRIPTION
                                                    });
                                                schema
                                            }.to_value());
                                    enum_values
                                }));
                        schemars::Schema::from(map)
                    }
                }
            }
            fn inline_schema() -> bool { false }
        }
        ;
    };schemars::JsonSchema)]
1106#[serde(tag = "kind")]
1107#[serde(rename_all = "kebab-case")]
1108pub enum StackProbeType {
1109    /// Don't emit any stack probes.
1110    None,
1111    /// It is harmless to use this option even on targets that do not have backend support for
1112    /// stack probes as the failure mode is the same as if no stack-probe option was specified in
1113    /// the first place.
1114    Inline,
1115    /// Call `__rust_probestack` whenever stack needs to be probed.
1116    Call,
1117    /// Use inline option for LLVM versions later than specified in `min_llvm_version_for_inline`
1118    /// and call `__rust_probestack` otherwise.
1119    InlineOrCall {
1120        #[serde(rename = "min-llvm-version-for-inline")]
1121        min_llvm_version_for_inline: (u32, u32, u32),
1122    },
1123}
1124
1125impl ToJson for StackProbeType {
1126    fn to_json(&self) -> Json {
1127        Json::Object(match self {
1128            StackProbeType::None => {
1129                [(String::from("kind"), "none".to_json())].into_iter().collect()
1130            }
1131            StackProbeType::Inline => {
1132                [(String::from("kind"), "inline".to_json())].into_iter().collect()
1133            }
1134            StackProbeType::Call => {
1135                [(String::from("kind"), "call".to_json())].into_iter().collect()
1136            }
1137            StackProbeType::InlineOrCall { min_llvm_version_for_inline: (maj, min, patch) } => [
1138                (String::from("kind"), "inline-or-call".to_json()),
1139                (
1140                    String::from("min-llvm-version-for-inline"),
1141                    Json::Array(::alloc::boxed::box_assume_init_into_vec_unsafe(::alloc::intrinsics::write_box_via_move(::alloc::boxed::Box::new_uninit(),
        [maj.to_json(), min.to_json(), patch.to_json()]))vec![maj.to_json(), min.to_json(), patch.to_json()]),
1142                ),
1143            ]
1144            .into_iter()
1145            .collect(),
1146        })
1147    }
1148}
1149
1150#[derive(#[automatically_derived]
impl ::core::default::Default for SanitizerSet {
    #[inline]
    fn default() -> SanitizerSet {
        SanitizerSet(::core::default::Default::default())
    }
}Default, #[automatically_derived]
impl ::core::clone::Clone for SanitizerSet {
    #[inline]
    fn clone(&self) -> SanitizerSet {
        let _: ::core::clone::AssertParamIsClone<u16>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::marker::Copy for SanitizerSet { }Copy, #[automatically_derived]
impl ::core::cmp::PartialEq for SanitizerSet {
    #[inline]
    fn eq(&self, other: &SanitizerSet) -> bool { self.0 == other.0 }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for SanitizerSet {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<u16>;
    }
}Eq, #[automatically_derived]
impl ::core::hash::Hash for SanitizerSet {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&self.0, state)
    }
}Hash, const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for SanitizerSet {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    SanitizerSet(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                }
            }
        }
    };Encodable, const _: () =
    {
        impl<__D: ::rustc_span::SpanDecoder> ::rustc_serialize::Decodable<__D>
            for SanitizerSet {
            fn decode(__decoder: &mut __D) -> Self {
                SanitizerSet(::rustc_serialize::Decodable::decode(__decoder))
            }
        }
    };Decodable, const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for SanitizerSet
            {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                match *self {
                    SanitizerSet(ref __binding_0) => {
                        { __binding_0.stable_hash(__hcx, __hasher); }
                    }
                }
            }
        }
    };StableHash)]
1151pub struct SanitizerSet(u16);
1152impl SanitizerSet {
    #[allow(deprecated, non_upper_case_globals,)]
    pub const ADDRESS: Self = Self::from_bits_retain(1 << 0);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const LEAK: Self = Self::from_bits_retain(1 << 1);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const MEMORY: Self = Self::from_bits_retain(1 << 2);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const THREAD: Self = Self::from_bits_retain(1 << 3);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const HWADDRESS: Self = Self::from_bits_retain(1 << 4);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const CFI: Self = Self::from_bits_retain(1 << 5);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const MEMTAG: Self = Self::from_bits_retain(1 << 6);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SHADOWCALLSTACK: Self = Self::from_bits_retain(1 << 7);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const KCFI: Self = Self::from_bits_retain(1 << 8);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const KERNELADDRESS: Self = Self::from_bits_retain(1 << 9);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const KERNELHWADDRESS: Self = Self::from_bits_retain(1 << 10);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const SAFESTACK: Self = Self::from_bits_retain(1 << 11);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const DATAFLOW: Self = Self::from_bits_retain(1 << 12);
    #[allow(deprecated, non_upper_case_globals,)]
    pub const REALTIME: Self = Self::from_bits_retain(1 << 13);
}
impl ::bitflags::Flags for SanitizerSet {
    const FLAGS: &'static [::bitflags::Flag<SanitizerSet>] =
        &[{

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("ADDRESS", SanitizerSet::ADDRESS)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("LEAK", SanitizerSet::LEAK)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("MEMORY", SanitizerSet::MEMORY)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("THREAD", SanitizerSet::THREAD)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("HWADDRESS", SanitizerSet::HWADDRESS)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("CFI", SanitizerSet::CFI)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("MEMTAG", SanitizerSet::MEMTAG)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SHADOWCALLSTACK",
                            SanitizerSet::SHADOWCALLSTACK)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("KCFI", SanitizerSet::KCFI)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("KERNELADDRESS",
                            SanitizerSet::KERNELADDRESS)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("KERNELHWADDRESS",
                            SanitizerSet::KERNELHWADDRESS)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("SAFESTACK", SanitizerSet::SAFESTACK)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("DATAFLOW", SanitizerSet::DATAFLOW)
                    },
                    {

                        #[allow(deprecated, non_upper_case_globals,)]
                        ::bitflags::Flag::new("REALTIME", SanitizerSet::REALTIME)
                    }];
    type Bits = u16;
    fn bits(&self) -> u16 { SanitizerSet::bits(self) }
    fn from_bits_retain(bits: u16) -> SanitizerSet {
        SanitizerSet::from_bits_retain(bits)
    }
}
#[allow(dead_code, deprecated, unused_doc_comments, unused_attributes,
unused_mut, unused_imports, non_upper_case_globals, clippy ::
assign_op_pattern, clippy :: iter_without_into_iter,)]
const _: () =
    {
        #[allow(dead_code, deprecated, unused_attributes)]
        impl SanitizerSet {
            /// Get a flags value with all bits unset.
            #[inline]
            pub const fn empty() -> Self {
                Self(<u16 as ::bitflags::Bits>::EMPTY)
            }
            /// Get a flags value with all known bits set.
            #[inline]
            pub const fn all() -> Self {
                let mut truncated = <u16 as ::bitflags::Bits>::EMPTY;
                let mut i = 0;
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                {
                    {
                        let flag =
                            <SanitizerSet as
                                            ::bitflags::Flags>::FLAGS[i].value().bits();
                        truncated = truncated | flag;
                        i += 1;
                    }
                };
                let _ = i;
                Self(truncated)
            }
            /// Get the underlying bits value.
            ///
            /// The returned value is exactly the bits set in this flags value.
            #[inline]
            pub const fn bits(&self) -> u16 { self.0 }
            /// Convert from a bits value.
            ///
            /// This method will return `None` if any unknown bits are set.
            #[inline]
            pub const fn from_bits(bits: u16)
                -> ::bitflags::__private::core::option::Option<Self> {
                let truncated = Self::from_bits_truncate(bits).0;
                if truncated == bits {
                    ::bitflags::__private::core::option::Option::Some(Self(bits))
                } else { ::bitflags::__private::core::option::Option::None }
            }
            /// Convert from a bits value, unsetting any unknown bits.
            #[inline]
            pub const fn from_bits_truncate(bits: u16) -> Self {
                Self(bits & Self::all().0)
            }
            /// Convert from a bits value exactly.
            #[inline]
            pub const fn from_bits_retain(bits: u16) -> Self { Self(bits) }
            /// Get a flags value with the bits of a flag with the given name set.
            ///
            /// This method will return `None` if `name` is empty or doesn't
            /// correspond to any named flag.
            #[inline]
            pub fn from_name(name: &str)
                -> ::bitflags::__private::core::option::Option<Self> {
                {
                    if name == "ADDRESS" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::ADDRESS.bits()));
                    }
                };
                ;
                {
                    if name == "LEAK" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::LEAK.bits()));
                    }
                };
                ;
                {
                    if name == "MEMORY" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::MEMORY.bits()));
                    }
                };
                ;
                {
                    if name == "THREAD" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::THREAD.bits()));
                    }
                };
                ;
                {
                    if name == "HWADDRESS" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::HWADDRESS.bits()));
                    }
                };
                ;
                {
                    if name == "CFI" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::CFI.bits()));
                    }
                };
                ;
                {
                    if name == "MEMTAG" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::MEMTAG.bits()));
                    }
                };
                ;
                {
                    if name == "SHADOWCALLSTACK" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::SHADOWCALLSTACK.bits()));
                    }
                };
                ;
                {
                    if name == "KCFI" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::KCFI.bits()));
                    }
                };
                ;
                {
                    if name == "KERNELADDRESS" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::KERNELADDRESS.bits()));
                    }
                };
                ;
                {
                    if name == "KERNELHWADDRESS" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::KERNELHWADDRESS.bits()));
                    }
                };
                ;
                {
                    if name == "SAFESTACK" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::SAFESTACK.bits()));
                    }
                };
                ;
                {
                    if name == "DATAFLOW" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::DATAFLOW.bits()));
                    }
                };
                ;
                {
                    if name == "REALTIME" {
                        return ::bitflags::__private::core::option::Option::Some(Self(SanitizerSet::REALTIME.bits()));
                    }
                };
                ;
                let _ = name;
                ::bitflags::__private::core::option::Option::None
            }
            /// Whether all bits in this flags value are unset.
            #[inline]
            pub const fn is_empty(&self) -> bool {
                self.0 == <u16 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all known bits in this flags value are set.
            #[inline]
            pub const fn is_all(&self) -> bool {
                Self::all().0 | self.0 == self.0
            }
            /// Whether any set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn intersects(&self, other: Self) -> bool {
                self.0 & other.0 != <u16 as ::bitflags::Bits>::EMPTY
            }
            /// Whether all set bits in a source flags value are also set in a target flags value.
            #[inline]
            pub const fn contains(&self, other: Self) -> bool {
                self.0 & other.0 == other.0
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            pub fn insert(&mut self, other: Self) {
                *self = Self(self.0).union(other);
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `remove` won't truncate `other`, but the `!` operator will.
            #[inline]
            pub fn remove(&mut self, other: Self) {
                *self = Self(self.0).difference(other);
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            pub fn toggle(&mut self, other: Self) {
                *self = Self(self.0).symmetric_difference(other);
            }
            /// Call `insert` when `value` is `true` or `remove` when `value` is `false`.
            #[inline]
            pub fn set(&mut self, other: Self, value: bool) {
                if value { self.insert(other); } else { self.remove(other); }
            }
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn intersection(self, other: Self) -> Self {
                Self(self.0 & other.0)
            }
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn union(self, other: Self) -> Self {
                Self(self.0 | other.0)
            }
            /// The intersection of a source flags value with the complement of a target flags
            /// value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            #[must_use]
            pub const fn difference(self, other: Self) -> Self {
                Self(self.0 & !other.0)
            }
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            #[must_use]
            pub const fn symmetric_difference(self, other: Self) -> Self {
                Self(self.0 ^ other.0)
            }
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            #[must_use]
            pub const fn complement(self) -> Self {
                Self::from_bits_truncate(!self.0)
            }
        }
        impl ::bitflags::__private::core::fmt::Binary for SanitizerSet {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Binary::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::Octal for SanitizerSet {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::Octal::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::LowerHex for SanitizerSet {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::LowerHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::fmt::UpperHex for SanitizerSet {
            fn fmt(&self, f: &mut ::bitflags::__private::core::fmt::Formatter)
                -> ::bitflags::__private::core::fmt::Result {
                let inner = self.0;
                ::bitflags::__private::core::fmt::UpperHex::fmt(&inner, f)
            }
        }
        impl ::bitflags::__private::core::ops::BitOr for SanitizerSet {
            type Output = Self;
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor(self, other: SanitizerSet) -> Self { self.union(other) }
        }
        impl ::bitflags::__private::core::ops::BitOrAssign for SanitizerSet {
            /// The bitwise or (`|`) of the bits in two flags values.
            #[inline]
            fn bitor_assign(&mut self, other: Self) { self.insert(other); }
        }
        impl ::bitflags::__private::core::ops::BitXor for SanitizerSet {
            type Output = Self;
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor(self, other: Self) -> Self {
                self.symmetric_difference(other)
            }
        }
        impl ::bitflags::__private::core::ops::BitXorAssign for SanitizerSet {
            /// The bitwise exclusive-or (`^`) of the bits in two flags values.
            #[inline]
            fn bitxor_assign(&mut self, other: Self) { self.toggle(other); }
        }
        impl ::bitflags::__private::core::ops::BitAnd for SanitizerSet {
            type Output = Self;
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand(self, other: Self) -> Self { self.intersection(other) }
        }
        impl ::bitflags::__private::core::ops::BitAndAssign for SanitizerSet {
            /// The bitwise and (`&`) of the bits in two flags values.
            #[inline]
            fn bitand_assign(&mut self, other: Self) {
                *self =
                    Self::from_bits_retain(self.bits()).intersection(other);
            }
        }
        impl ::bitflags::__private::core::ops::Sub for SanitizerSet {
            type Output = Self;
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub(self, other: Self) -> Self { self.difference(other) }
        }
        impl ::bitflags::__private::core::ops::SubAssign for SanitizerSet {
            /// The intersection of a source flags value with the complement of a target flags value (`&!`).
            ///
            /// This method is not equivalent to `self & !other` when `other` has unknown bits set.
            /// `difference` won't truncate `other`, but the `!` operator will.
            #[inline]
            fn sub_assign(&mut self, other: Self) { self.remove(other); }
        }
        impl ::bitflags::__private::core::ops::Not for SanitizerSet {
            type Output = Self;
            /// The bitwise negation (`!`) of the bits in a flags value, truncating the result.
            #[inline]
            fn not(self) -> Self { self.complement() }
        }
        impl ::bitflags::__private::core::iter::Extend<SanitizerSet> for
            SanitizerSet {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn extend<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(&mut self, iterator: T) {
                for item in iterator { self.insert(item) }
            }
        }
        impl ::bitflags::__private::core::iter::FromIterator<SanitizerSet> for
            SanitizerSet {
            /// The bitwise or (`|`) of the bits in each flags value.
            fn from_iter<T: ::bitflags::__private::core::iter::IntoIterator<Item
                = Self>>(iterator: T) -> Self {
                use ::bitflags::__private::core::iter::Extend;
                let mut result = Self::empty();
                result.extend(iterator);
                result
            }
        }
        impl SanitizerSet {
            /// Yield a set of contained flags values.
            ///
            /// Each yielded flags value will correspond to a defined named flag. Any unknown bits
            /// will be yielded together as a final flags value.
            #[inline]
            pub const fn iter(&self) -> ::bitflags::iter::Iter<SanitizerSet> {
                ::bitflags::iter::Iter::__private_const_new(<SanitizerSet as
                        ::bitflags::Flags>::FLAGS,
                    SanitizerSet::from_bits_retain(self.bits()),
                    SanitizerSet::from_bits_retain(self.bits()))
            }
            /// Yield a set of contained named flags values.
            ///
            /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags.
            /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
            #[inline]
            pub const fn iter_names(&self)
                -> ::bitflags::iter::IterNames<SanitizerSet> {
                ::bitflags::iter::IterNames::__private_const_new(<SanitizerSet
                        as ::bitflags::Flags>::FLAGS,
                    SanitizerSet::from_bits_retain(self.bits()),
                    SanitizerSet::from_bits_retain(self.bits()))
            }
        }
        impl ::bitflags::__private::core::iter::IntoIterator for SanitizerSet
            {
            type Item = SanitizerSet;
            type IntoIter = ::bitflags::iter::Iter<SanitizerSet>;
            fn into_iter(self) -> Self::IntoIter { self.iter() }
        }
    };bitflags::bitflags! {
1153    impl SanitizerSet: u16 {
1154        const ADDRESS = 1 << 0;
1155        const LEAK    = 1 << 1;
1156        const MEMORY  = 1 << 2;
1157        const THREAD  = 1 << 3;
1158        const HWADDRESS = 1 << 4;
1159        const CFI     = 1 << 5;
1160        const MEMTAG  = 1 << 6;
1161        const SHADOWCALLSTACK = 1 << 7;
1162        const KCFI    = 1 << 8;
1163        const KERNELADDRESS = 1 << 9;
1164        const KERNELHWADDRESS = 1 << 10;
1165        const SAFESTACK = 1 << 11;
1166        const DATAFLOW = 1 << 12;
1167        const REALTIME = 1 << 13;
1168    }
1169}
1170impl ::std::fmt::Debug for SanitizerSet {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        ::bitflags::parser::to_writer(self, f)
    }
}rustc_data_structures::external_bitflags_debug! { SanitizerSet }
1171
1172impl SanitizerSet {
1173    // Taken from LLVM's sanitizer compatibility logic:
1174    // https://github.com/llvm/llvm-project/blob/release/18.x/clang/lib/Driver/SanitizerArgs.cpp#L512
1175    const MUTUALLY_EXCLUSIVE: &'static [(SanitizerSet, SanitizerSet)] = &[
1176        (SanitizerSet::ADDRESS, SanitizerSet::MEMORY),
1177        (SanitizerSet::ADDRESS, SanitizerSet::THREAD),
1178        (SanitizerSet::ADDRESS, SanitizerSet::HWADDRESS),
1179        (SanitizerSet::ADDRESS, SanitizerSet::MEMTAG),
1180        (SanitizerSet::ADDRESS, SanitizerSet::KERNELADDRESS),
1181        (SanitizerSet::ADDRESS, SanitizerSet::KERNELHWADDRESS),
1182        (SanitizerSet::ADDRESS, SanitizerSet::SAFESTACK),
1183        (SanitizerSet::LEAK, SanitizerSet::MEMORY),
1184        (SanitizerSet::LEAK, SanitizerSet::THREAD),
1185        (SanitizerSet::LEAK, SanitizerSet::KERNELADDRESS),
1186        (SanitizerSet::LEAK, SanitizerSet::KERNELHWADDRESS),
1187        (SanitizerSet::LEAK, SanitizerSet::SAFESTACK),
1188        (SanitizerSet::MEMORY, SanitizerSet::THREAD),
1189        (SanitizerSet::MEMORY, SanitizerSet::HWADDRESS),
1190        (SanitizerSet::MEMORY, SanitizerSet::KERNELADDRESS),
1191        (SanitizerSet::MEMORY, SanitizerSet::KERNELHWADDRESS),
1192        (SanitizerSet::MEMORY, SanitizerSet::SAFESTACK),
1193        (SanitizerSet::THREAD, SanitizerSet::HWADDRESS),
1194        (SanitizerSet::THREAD, SanitizerSet::KERNELADDRESS),
1195        (SanitizerSet::THREAD, SanitizerSet::KERNELHWADDRESS),
1196        (SanitizerSet::THREAD, SanitizerSet::SAFESTACK),
1197        (SanitizerSet::HWADDRESS, SanitizerSet::MEMTAG),
1198        (SanitizerSet::HWADDRESS, SanitizerSet::KERNELADDRESS),
1199        (SanitizerSet::HWADDRESS, SanitizerSet::KERNELHWADDRESS),
1200        (SanitizerSet::HWADDRESS, SanitizerSet::SAFESTACK),
1201        (SanitizerSet::CFI, SanitizerSet::KCFI),
1202        (SanitizerSet::MEMTAG, SanitizerSet::KERNELADDRESS),
1203        (SanitizerSet::MEMTAG, SanitizerSet::KERNELHWADDRESS),
1204        (SanitizerSet::KERNELADDRESS, SanitizerSet::KERNELHWADDRESS),
1205        (SanitizerSet::KERNELADDRESS, SanitizerSet::SAFESTACK),
1206        (SanitizerSet::KERNELHWADDRESS, SanitizerSet::SAFESTACK),
1207    ];
1208
1209    /// Return sanitizer's name
1210    ///
1211    /// Returns none if the flags is a set of sanitizers numbering not exactly one.
1212    pub fn as_str(self) -> Option<&'static str> {
1213        Some(match self {
1214            SanitizerSet::ADDRESS => "address",
1215            SanitizerSet::CFI => "cfi",
1216            SanitizerSet::DATAFLOW => "dataflow",
1217            SanitizerSet::KCFI => "kcfi",
1218            SanitizerSet::KERNELADDRESS => "kernel-address",
1219            SanitizerSet::KERNELHWADDRESS => "kernel-hwaddress",
1220            SanitizerSet::LEAK => "leak",
1221            SanitizerSet::MEMORY => "memory",
1222            SanitizerSet::MEMTAG => "memtag",
1223            SanitizerSet::SAFESTACK => "safestack",
1224            SanitizerSet::SHADOWCALLSTACK => "shadow-call-stack",
1225            SanitizerSet::THREAD => "thread",
1226            SanitizerSet::HWADDRESS => "hwaddress",
1227            SanitizerSet::REALTIME => "realtime",
1228            _ => return None,
1229        })
1230    }
1231
1232    pub fn mutually_exclusive(self) -> Option<(SanitizerSet, SanitizerSet)> {
1233        Self::MUTUALLY_EXCLUSIVE
1234            .into_iter()
1235            .find(|&(a, b)| self.contains(*a) && self.contains(*b))
1236            .copied()
1237    }
1238}
1239
1240/// Formats a sanitizer set as a comma separated list of sanitizers' names.
1241impl fmt::Display for SanitizerSet {
1242    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1243        let mut first = true;
1244        for s in *self {
1245            let name = s.as_str().unwrap_or_else(|| {
    ::core::panicking::panic_fmt(format_args!("unrecognized sanitizer {0:?}",
            s));
}panic!("unrecognized sanitizer {s:?}"));
1246            if !first {
1247                f.write_str(", ")?;
1248            }
1249            f.write_str(name)?;
1250            first = false;
1251        }
1252        Ok(())
1253    }
1254}
1255
1256impl FromStr for SanitizerSet {
1257    type Err = String;
1258    fn from_str(s: &str) -> Result<Self, Self::Err> {
1259        Ok(match s {
1260            "address" => SanitizerSet::ADDRESS,
1261            "cfi" => SanitizerSet::CFI,
1262            "dataflow" => SanitizerSet::DATAFLOW,
1263            "kcfi" => SanitizerSet::KCFI,
1264            "kernel-address" => SanitizerSet::KERNELADDRESS,
1265            "kernel-hwaddress" => SanitizerSet::KERNELHWADDRESS,
1266            "leak" => SanitizerSet::LEAK,
1267            "memory" => SanitizerSet::MEMORY,
1268            "memtag" => SanitizerSet::MEMTAG,
1269            "safestack" => SanitizerSet::SAFESTACK,
1270            "shadow-call-stack" => SanitizerSet::SHADOWCALLSTACK,
1271            "thread" => SanitizerSet::THREAD,
1272            "hwaddress" => SanitizerSet::HWADDRESS,
1273            "realtime" => SanitizerSet::REALTIME,
1274            s => return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("unknown sanitizer {0}", s))
    })format!("unknown sanitizer {s}")),
1275        })
1276    }
1277}
1278
1279impl<'de> serde::Deserialize<'de> for SanitizerSet {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}crate::json::serde_deserialize_from_str!(SanitizerSet);
1280impl schemars::JsonSchema for SanitizerSet {
1281    fn schema_name() -> std::borrow::Cow<'static, str> {
1282        "SanitizerSet".into()
1283    }
1284    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
1285        let all = Self::all().iter().map(|sanitizer| sanitizer.as_str()).collect::<Vec<_>>();
1286        <::schemars::Schema as
            ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                let mut object = ::serde_json::Map::new();
                let _ =
                    object.insert(("type").into(),
                        ::serde_json::to_value(&"string").unwrap());
                let _ =
                    object.insert(("enum").into(),
                        ::serde_json::to_value(&all).unwrap());
                ;
                object
            })).unwrap()schemars::json_schema! ({
1287            "type": "string",
1288            "enum": all,
1289        })
1290    }
1291}
1292
1293impl ToJson for SanitizerSet {
1294    fn to_json(&self) -> Json {
1295        self.into_iter()
1296            .map(|v| Some(v.as_str()?.to_json()))
1297            .collect::<Option<Vec<_>>>()
1298            .unwrap_or_default()
1299            .to_json()
1300    }
1301}
1302
1303#[automatically_derived]
impl ::core::clone::Clone for FramePointer {
    #[inline]
    fn clone(&self) -> FramePointer { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for FramePointer { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for FramePointer { }
#[automatically_derived]
impl ::core::cmp::PartialEq for FramePointer {
    #[inline]
    fn eq(&self, other: &FramePointer) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for FramePointer {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for FramePointer {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for FramePointer {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                FramePointer::Always => "Always",
                FramePointer::NonLeaf => "NonLeaf",
                FramePointer::MayOmit => "MayOmit",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for FramePointer {
    #[inline]
    fn partial_cmp(&self, other: &FramePointer)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for FramePointer {
    #[inline]
    fn cmp(&self, other: &FramePointer) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for FramePointer {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "always" => Self::Always,
                "non-leaf" => Self::NonLeaf,
                "may-omit" => Self::MayOmit,
                _ => {
                    let all =
                        ["\'always\'", "\'non-leaf\'", "\'may-omit\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "frame pointer", s, all))
                                }));
                }
            })
    }
}
impl FramePointer {
    pub const ALL: &'static [FramePointer] =
        &[FramePointer::Always, FramePointer::NonLeaf, FramePointer::MayOmit];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Always => "always",
            Self::NonLeaf => "non-leaf",
            Self::MayOmit => "may-omit",
        }
    }
}
impl crate::json::ToJson for FramePointer {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for FramePointer {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for FramePointer {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1304    pub enum FramePointer {
1305        /// Forces the machine code generator to always preserve the frame pointers.
1306        Always = "always",
1307        /// Forces the machine code generator to preserve the frame pointers except for the leaf
1308        /// functions (i.e. those that don't call other functions).
1309        NonLeaf = "non-leaf",
1310        /// Allows the machine code generator to omit the frame pointers.
1311        ///
1312        /// This option does not guarantee that the frame pointers will be omitted.
1313        MayOmit = "may-omit",
1314    }
1315
1316    parse_error_type = "frame pointer";
1317}
1318
1319impl FramePointer {
1320    /// It is intended that the "force frame pointer" transition is "one way"
1321    /// so this convenience assures such if used
1322    #[inline]
1323    pub fn ratchet(&mut self, rhs: FramePointer) -> FramePointer {
1324        *self = match (*self, rhs) {
1325            (FramePointer::Always, _) | (_, FramePointer::Always) => FramePointer::Always,
1326            (FramePointer::NonLeaf, _) | (_, FramePointer::NonLeaf) => FramePointer::NonLeaf,
1327            _ => FramePointer::MayOmit,
1328        };
1329        *self
1330    }
1331}
1332
1333#[automatically_derived]
impl ::core::clone::Clone for StackProtector {
    #[inline]
    fn clone(&self) -> StackProtector { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for StackProtector { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for StackProtector { }
#[automatically_derived]
impl ::core::cmp::PartialEq for StackProtector {
    #[inline]
    fn eq(&self, other: &StackProtector) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for StackProtector {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for StackProtector {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for StackProtector {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                StackProtector::None => "None",
                StackProtector::Basic => "Basic",
                StackProtector::Strong => "Strong",
                StackProtector::All => "All",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for StackProtector {
    #[inline]
    fn partial_cmp(&self, other: &StackProtector)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for StackProtector {
    #[inline]
    fn cmp(&self, other: &StackProtector) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
const _: () =
    {
        impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
            for StackProtector {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        StackProtector::None => { 0usize }
                        StackProtector::Basic => { 1usize }
                        StackProtector::Strong => { 2usize }
                        StackProtector::All => { 3usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    StackProtector::None => {}
                    StackProtector::Basic => {}
                    StackProtector::Strong => {}
                    StackProtector::All => {}
                }
            }
        }
    };
const _: () =
    {
        impl<__D: ::rustc_span::BlobDecoder> ::rustc_serialize::Decodable<__D>
            for StackProtector {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { StackProtector::None }
                    1usize => { StackProtector::Basic }
                    2usize => { StackProtector::Strong }
                    3usize => { StackProtector::All }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `StackProtector`, expected 0..4, actual {0}",
                                n));
                    }
                }
            }
        }
    };
const _: () =
    {
        impl ::rustc_data_structures::stable_hash::StableHash for
            StackProtector {
            #[inline]
            fn stable_hash<__Hcx: ::rustc_data_structures::stable_hash::StableHashCtxt>(&self,
                __hcx: &mut __Hcx,
                __hasher:
                    &mut ::rustc_data_structures::stable_hash::StableHasher) {
                ::std::mem::discriminant(self).stable_hash(__hcx, __hasher);
                match *self {
                    StackProtector::None => {}
                    StackProtector::Basic => {}
                    StackProtector::Strong => {}
                    StackProtector::All => {}
                }
            }
        }
    };
impl FromStr for StackProtector {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "none" => Self::None,
                "basic" => Self::Basic,
                "strong" => Self::Strong,
                "all" => Self::All,
                _ => {
                    let all =
                        ["\'none\'", "\'basic\'", "\'strong\'",
                                    "\'all\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "stack protector", s, all))
                                }));
                }
            })
    }
}
impl StackProtector {
    pub const ALL: &'static [StackProtector] =
        &[StackProtector::None, StackProtector::Basic, StackProtector::Strong,
                    StackProtector::All];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::None => "none",
            Self::Basic => "basic",
            Self::Strong => "strong",
            Self::All => "all",
        }
    }
}
impl crate::json::ToJson for StackProtector {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for StackProtector {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for StackProtector {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1334    /// Controls use of stack canaries.
1335    #[derive(Encodable, BlobDecodable, StableHash)]
1336    pub enum StackProtector {
1337        /// Disable stack canary generation.
1338        None = "none",
1339
1340        /// On LLVM, mark all generated LLVM functions with the `ssp` attribute (see
1341        /// llvm/docs/LangRef.rst). This triggers stack canary generation in
1342        /// functions which contain an array of a byte-sized type with more than
1343        /// eight elements.
1344        Basic = "basic",
1345
1346        /// On LLVM, mark all generated LLVM functions with the `sspstrong`
1347        /// attribute (see llvm/docs/LangRef.rst). This triggers stack canary
1348        /// generation in functions which either contain an array, or which take
1349        /// the address of a local variable.
1350        Strong = "strong",
1351
1352        /// Generate stack canaries in all functions.
1353        All = "all",
1354    }
1355
1356    parse_error_type = "stack protector";
1357}
1358
1359impl ::rustc_error_messages::IntoDiagArg for StackProtector {
    fn into_diag_arg(self, path: &mut Option<std::path::PathBuf>)
        -> ::rustc_error_messages::DiagArgValue {
        self.to_string().into_diag_arg(path)
    }
}into_diag_arg_using_display!(StackProtector);
1360
1361#[automatically_derived]
impl ::core::clone::Clone for BinaryFormat {
    #[inline]
    fn clone(&self) -> BinaryFormat { *self }
}
#[automatically_derived]
impl ::core::marker::Copy for BinaryFormat { }
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for BinaryFormat { }
#[automatically_derived]
impl ::core::cmp::PartialEq for BinaryFormat {
    #[inline]
    fn eq(&self, other: &BinaryFormat) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for BinaryFormat {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {}
}
#[automatically_derived]
impl ::core::hash::Hash for BinaryFormat {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for BinaryFormat {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                BinaryFormat::Coff => "Coff",
                BinaryFormat::Elf => "Elf",
                BinaryFormat::MachO => "MachO",
                BinaryFormat::Wasm => "Wasm",
                BinaryFormat::Xcoff => "Xcoff",
            })
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for BinaryFormat {
    #[inline]
    fn partial_cmp(&self, other: &BinaryFormat)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for BinaryFormat {
    #[inline]
    fn cmp(&self, other: &BinaryFormat) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr)
    }
}
impl FromStr for BinaryFormat {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "coff" => Self::Coff,
                "elf" => Self::Elf,
                "mach-o" => Self::MachO,
                "wasm" => Self::Wasm,
                "xcoff" => Self::Xcoff,
                _ => {
                    let all =
                        ["\'coff\'", "\'elf\'", "\'mach-o\'", "\'wasm\'",
                                    "\'xcoff\'"].join(", ");
                    return Err(::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("invalid {0}: \'{1}\'. allowed values: {2}",
                                            "binary format", s, all))
                                }));
                }
            })
    }
}
impl BinaryFormat {
    pub const ALL: &'static [BinaryFormat] =
        &[BinaryFormat::Coff, BinaryFormat::Elf, BinaryFormat::MachO,
                    BinaryFormat::Wasm, BinaryFormat::Xcoff];
    pub fn desc(&self) -> &'static str {
        match self {
            Self::Coff => "coff",
            Self::Elf => "elf",
            Self::MachO => "mach-o",
            Self::Wasm => "wasm",
            Self::Xcoff => "xcoff",
        }
    }
}
impl crate::json::ToJson for BinaryFormat {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for BinaryFormat {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for BinaryFormat {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1362    pub enum BinaryFormat {
1363        Coff = "coff",
1364        Elf = "elf",
1365        MachO = "mach-o",
1366        Wasm = "wasm",
1367        Xcoff = "xcoff",
1368    }
1369
1370    parse_error_type = "binary format";
1371}
1372
1373impl BinaryFormat {
1374    /// Returns [`object::BinaryFormat`] for given `BinaryFormat`
1375    pub fn to_object(&self) -> object::BinaryFormat {
1376        match self {
1377            Self::Coff => object::BinaryFormat::Coff,
1378            Self::Elf => object::BinaryFormat::Elf,
1379            Self::MachO => object::BinaryFormat::MachO,
1380            Self::Wasm => object::BinaryFormat::Wasm,
1381            Self::Xcoff => object::BinaryFormat::Xcoff,
1382        }
1383    }
1384
1385    pub fn desc_symbol(&self) -> Symbol {
1386        match self {
1387            Self::Coff => sym::coff,
1388            Self::Elf => sym::elf,
1389            Self::MachO => sym::macho,
1390            Self::Wasm => sym::wasm,
1391            Self::Xcoff => sym::xcoff,
1392        }
1393    }
1394}
1395
1396impl ToJson for Align {
1397    fn to_json(&self) -> Json {
1398        self.bits().to_json()
1399    }
1400}
1401
1402macro_rules! supported_targets {
1403    ( $(($tuple:literal, $module:ident),)+ ) => {
1404        mod targets {
1405            $(pub(crate) mod $module;)+
1406        }
1407
1408        /// List of supported targets
1409        pub static TARGETS: &[&str] = &[$($tuple),+];
1410
1411        fn load_builtin(target: &str) -> Option<Target> {
1412            let t = match target {
1413                $( $tuple => targets::$module::target(), )+
1414                _ => return None,
1415            };
1416            debug!("got builtin target: {:?}", t);
1417            Some(t)
1418        }
1419
1420        fn load_all_builtins() -> impl Iterator<Item = Target> {
1421            [
1422                $( targets::$module::target, )+
1423            ]
1424            .into_iter()
1425            .map(|f| f())
1426        }
1427
1428        #[cfg(test)]
1429        mod tests {
1430            // Cannot put this into a separate file without duplication, make an exception.
1431            $(
1432                #[test] // `#[test]`
1433                fn $module() {
1434                    crate::spec::targets::$module::target().test_target()
1435                }
1436            )+
1437        }
1438    };
1439}
1440
1441mod targets {
    pub(crate) mod x86_64_unknown_linux_gnu {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.static_position_independent_executables = true;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::KCFI
                                        | SanitizerSet::DATAFLOW | SanitizerSet::LEAK |
                                SanitizerSet::MEMORY | SanitizerSet::SAFESTACK |
                        SanitizerSet::THREAD | SanitizerSet::REALTIME;
            base.supports_fentry = true;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+)".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_linux_gnux32 {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.cpu = "x86-64".into();
            base.cfg_abi = CfgAbi::X32;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-mx32"]);
            base.stack_probes = StackProbeType::Inline;
            base.has_thread_local = false;
            base.plt_by_default = true;
            Target {
                llvm_target: "x86_64-unknown-linux-gnux32".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit Linux (x32 ABI) (kernel 4.15, glibc 2.27)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_unknown_linux_gnu {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RustcAbi, SanitizerSet,
            StackProbeType, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.supported_sanitizers = SanitizerSet::ADDRESS;
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.stack_probes = StackProbeType::Inline;
            base.supports_fentry = true;
            Target {
                llvm_target: "i686-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit Linux (kernel 3.2, glibc 2.17+)".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod i586_unknown_linux_gnu {
        use crate::spec::Target;
        pub(crate) fn target() -> Target {
            let mut base = super::i686_unknown_linux_gnu::target();
            base.rustc_abi = None;
            base.cpu = "pentium".into();
            base.llvm_target = "i586-unknown-linux-gnu".into();
            base.metadata =
                crate::spec::TargetMetadata {
                    description: Some("32-bit Linux (kernel 3.2, glibc 2.17+)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base
        }
    }
    pub(crate) mod loongarch64_unknown_linux_gnu {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SanitizerSet, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "loongarch64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("LoongArch64 Linux, LP64D ABI (kernel 5.19, glibc 2.36)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::LoongArch64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic".into(),
                    features: "+f,+d,+lsx,+relax".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                    SanitizerSet::CFI | SanitizerSet::LEAK |
                            SanitizerSet::MEMORY | SanitizerSet::THREAD,
                    supports_xray: true,
                    direct_access_external_data: Some(false),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod loongarch64_unknown_linux_musl {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SanitizerSet, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "loongarch64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("LoongArch64 Linux (LP64D ABI) with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::LoongArch64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic".into(),
                    features: "+f,+d,+lsx,+relax".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    crt_static_default: false,
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                    SanitizerSet::CFI | SanitizerSet::LEAK |
                            SanitizerSet::MEMORY | SanitizerSet::THREAD,
                    supports_xray: true,
                    direct_access_external_data: Some(false),
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod m68k_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, LinkSelfContainedDefault, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.cpu = "M68020".into();
            base.max_atomic_width = Some(32);
            Target {
                llvm_target: "m68k-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("Motorola 680x0 Linux".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16".into(),
                arch: Arch::M68k,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    link_self_contained: LinkSelfContainedDefault::False,
                    ..base
                },
            }
        }
    }
    pub(crate) mod m68k_unknown_none_elf {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, CodeModel, PanicStrategy, RelocModel, Target,
            TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let options =
                TargetOptions {
                    cpu: "M68010".into(),
                    max_atomic_width: None,
                    endian: Endian::Big,
                    linker: Some("m68k-linux-gnu-ld".into()),
                    panic_strategy: PanicStrategy::Abort,
                    code_model: Some(CodeModel::Medium),
                    has_rpath: false,
                    llvm_floatabi: None,
                    relocation_model: RelocModel::Static,
                    ..Default::default()
                };
            Target {
                llvm_target: "m68k".into(),
                metadata: TargetMetadata {
                    description: Some("Motorola 680x0".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16".into(),
                arch: Arch::M68k,
                options,
            }
        }
    }
    pub(crate) mod csky_unknown_linux_gnuabiv2 {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "csky-unknown-linux-gnuabiv2".into(),
                metadata: TargetMetadata {
                    description: Some("C-SKY abiv2 Linux (little endian)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-S32-p:32:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:32-v128:32:32-a:0:32-Fi32-n32".into(),
                arch: Arch::CSky,
                options: TargetOptions {
                    cfg_abi: CfgAbi::AbiV2,
                    features: "+2e3,+3e7,+7e10,+cache,+dsp1e2,+dspe60,+e1,+e2,+edsp,+elrw,+hard-tp,+high-registers,+hwdiv,+mp,+mp1e2,+nvic,+trust".into(),
                    late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &["-l:libatomic.a"]),
                    max_atomic_width: Some(32),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod csky_unknown_linux_gnuabiv2hf {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "csky-unknown-linux-gnuabiv2".into(),
                metadata: TargetMetadata {
                    description: Some("C-SKY abiv2 Linux, hardfloat (little endian)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-S32-p:32:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:32:32-v128:32:32-a:0:32-Fi32-n32".into(),
                arch: Arch::CSky,
                options: TargetOptions {
                    cfg_abi: CfgAbi::AbiV2Hf,
                    cpu: "ck860fv".into(),
                    features: "+hard-float,+hard-float-abi,+2e3,+3e7,+7e10,+cache,+dsp1e2,+dspe60,+e1,+e2,+edsp,+elrw,+hard-tp,+high-registers,+hwdiv,+mp,+mp1e2,+nvic,+trust".into(),
                    late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &["-l:libatomic.a", "-mhard-float"]),
                    max_atomic_width: Some(32),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mips_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mips-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS Linux (kernel 4.4, glibc 2.23)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    endian: Endian::Big,
                    cpu: "mips32r2".into(),
                    features: "+mips32r2,+fpxx,+nooddspreg".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mips64_unknown_linux_gnuabi64 {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mips64-unknown-linux-gnuabi64".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS64 Linux, N64 ABI (kernel 4.4, glibc 2.23)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Mips64,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Abi64,
                    endian: Endian::Big,
                    cpu: "mips64r2".into(),
                    features: "+mips64r2,+xgot".into(),
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    llvm_abiname: LlvmAbi::N64,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mips64el_unknown_linux_gnuabi64 {
        use crate::spec::{
            Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mips64el-unknown-linux-gnuabi64".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS64 Linux, N64 ABI (kernel 4.4, glibc 2.23)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Mips64,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Abi64,
                    cpu: "mips64r2".into(),
                    features: "+mips64r2,+xgot".into(),
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    llvm_abiname: LlvmAbi::N64,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mipsisa32r6_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsisa32r6-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit MIPS Release 6 Big Endian".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips32r6,
                options: TargetOptions {
                    endian: Endian::Big,
                    cpu: "mips32r6".into(),
                    features: "+mips32r6".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mipsisa32r6el_unknown_linux_gnu {
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsisa32r6el-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit MIPS Release 6 Little Endian".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips32r6,
                options: TargetOptions {
                    cpu: "mips32r6".into(),
                    features: "+mips32r6".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mipsisa64r6_unknown_linux_gnuabi64 {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsisa64r6-unknown-linux-gnuabi64".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit MIPS Release 6 Big Endian".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Mips64r6,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Abi64,
                    endian: Endian::Big,
                    cpu: "mips64r6".into(),
                    features: "+mips64r6".into(),
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    llvm_abiname: LlvmAbi::N64,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mipsisa64r6el_unknown_linux_gnuabi64 {
        use crate::spec::{
            Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsisa64r6el-unknown-linux-gnuabi64".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit MIPS Release 6 Little Endian".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Mips64r6,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Abi64,
                    cpu: "mips64r6".into(),
                    features: "+mips64r6".into(),
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    llvm_abiname: LlvmAbi::N64,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod mipsel_unknown_linux_gnu {
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsel-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS (little endian) Linux (kernel 4.4, glibc 2.23)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    cpu: "mips32r2".into(),
                    features: "+mips32r2,+fpxx,+nooddspreg".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod powerpc_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("PowerPC Linux (kernel 3.2, glibc 2.17)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    endian: Endian::Big,
                    features: "+secure-plt".into(),
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc_unknown_linux_gnuspe {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, RustcAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-mspe"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-linux-gnuspe".into(),
                metadata: TargetMetadata {
                    description: Some("PowerPC SPE Linux".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Spe,
                    rustc_abi: Some(RustcAbi::PowerPcSpe),
                    endian: Endian::Big,
                    features: "+secure-plt,+msync,+spe".into(),
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc_unknown_linux_musl {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("PowerPC Linux with musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc_unknown_linux_muslspe {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, RustcAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-mspe"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-linux-muslspe".into(),
                metadata: TargetMetadata {
                    description: Some("PowerPC SPE Linux with musl".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Spe,
                    rustc_abi: Some(RustcAbi::PowerPcSpe),
                    endian: Endian::Big,
                    features: "+msync,+spe".into(),
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc64_ibm_aix {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::aix::opts();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Unix(Cc::No),
                &["-b64", "-bpT:0x100000000", "-bpD:0x110000000",
                            "-bcdtors:mbr:0:s", "-bdbg:namedsects:ss"]);
            Target {
                llvm_target: "powerpc64-ibm-aix".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit AIX (7.2 and newer)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "E-m:a-Fi64-i64:64-i128:128-n32:64-f64:32:64-S128-v256:256:256-v512:512:512".into(),
                arch: Arch::PowerPC64,
                options: base,
            }
        }
    }
    pub(crate) mod powerpc64_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.cpu = "ppc64".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV1;
            base.llvm_abiname = LlvmAbi::ElfV1;
            Target {
                llvm_target: "powerpc64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("PowerPC Linux (kernel 3.2, glibc 2.17)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc64_unknown_linux_gnuelfv2 {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.cpu = "ppc64".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV2;
            base.llvm_abiname = LlvmAbi::ElfV2;
            Target {
                llvm_target: "powerpc64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("PPC64 Linux (ELFv2 ABI, kernel 3.2, glibc 2.17)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc64_unknown_linux_musl {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "ppc64".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV2;
            base.llvm_abiname = LlvmAbi::ElfV2;
            Target {
                llvm_target: "powerpc64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit PowerPC Linux with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc64le_unknown_linux_gnu {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.cpu = "ppc64le".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV2;
            base.llvm_abiname = LlvmAbi::ElfV2;
            Target {
                llvm_target: "powerpc64le-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("PPC64LE Linux (kernel 3.10, glibc 2.17)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions { mcount: "_mcount".into(), ..base },
            }
        }
    }
    pub(crate) mod powerpc64le_unknown_linux_musl {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "ppc64le".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.crt_static_default = true;
            base.cfg_abi = CfgAbi::ElfV2;
            base.llvm_abiname = LlvmAbi::ElfV2;
            Target {
                llvm_target: "powerpc64le-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit PowerPC Linux with musl 1.2.5, Little Endian".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions { mcount: "_mcount".into(), ..base },
            }
        }
    }
    pub(crate) mod s390x_unknown_linux_gnu {
        use rustc_abi::{Align, Endian};
        use crate::spec::{
            Arch, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.endian = Endian::Big;
            base.cpu = "z10".into();
            base.max_atomic_width = Some(128);
            base.min_global_align = Some(Align::from_bits(16).unwrap());
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::LEAK |
                        SanitizerSet::MEMORY | SanitizerSet::THREAD;
            base.supports_fentry = true;
            Target {
                llvm_target: "s390x-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("S390x Linux (kernel 3.2, glibc 2.17)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-S64-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64".into(),
                arch: Arch::S390x,
                options: base,
            }
        }
    }
    pub(crate) mod s390x_unknown_none_softfloat {
        use rustc_abi::{Align, Endian};
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel,
            RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    cfg_abi: CfgAbi::SoftFloat,
                    cpu: "z10".into(),
                    endian: Endian::Big,
                    features: "+soft-float,-vector".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    max_atomic_width: Some(128),
                    min_global_align: Some(Align::from_bits(16).unwrap()),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    rustc_abi: Some(RustcAbi::Softfloat),
                    stack_probes: StackProbeType::Inline,
                    supported_sanitizers: SanitizerSet::KERNELADDRESS,
                    supports_fentry: true,
                    ..Default::default()
                };
            Target {
                llvm_target: "s390x-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("S390x Linux".into()),
                    host_tools: Some(false),
                    std: Some(false),
                    tier: Some(2),
                },
                arch: Arch::S390x,
                data_layout: "E-S64-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64".into(),
                options: opts,
                pointer_width: 64,
            }
        }
    }
    pub(crate) mod s390x_unknown_linux_musl {
        use rustc_abi::{Align, Endian};
        use crate::spec::{
            Arch, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.endian = Endian::Big;
            base.cpu = "z10".into();
            base.max_atomic_width = Some(128);
            base.min_global_align = Some(Align::from_bits(16).unwrap());
            base.static_position_independent_executables = true;
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::LEAK |
                        SanitizerSet::MEMORY | SanitizerSet::THREAD;
            base.supports_fentry = true;
            Target {
                llvm_target: "s390x-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("S390x Linux (kernel 3.2, musl 1.2.5)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-S64-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64".into(),
                arch: Arch::S390x,
                options: base,
            }
        }
    }
    pub(crate) mod sparc_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "sparc-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit SPARC Linux".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-i64:64-i128:128-f128:64-n32-S64".into(),
                arch: Arch::Sparc,
                options: TargetOptions {
                    features: "+v8plus".into(),
                    cpu: "v9".into(),
                    endian: Endian::Big,
                    late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &["-mcpu=v9", "-m32"]),
                    max_atomic_width: Some(32),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod sparc64_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{Arch, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.endian = Endian::Big;
            base.cpu = "v9".into();
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "sparc64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("SPARC Linux (kernel 4.4, glibc 2.23)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Sparc64,
                options: base,
            }
        }
    }
    pub(crate) mod arm_unknown_linux_gnueabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "arm-unknown-linux-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6 Linux (kernel 3.2, glibc 2.17)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align,+v6".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod arm_unknown_linux_gnueabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, SanitizerSet, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "arm-unknown-linux-gnueabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6 Linux, hardfloat (kernel 3.2, glibc 2.17)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+strict-align,+v6,+vfp2".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    default_uwtable: false,
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod armeb_unknown_linux_gnueabi {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armeb-unknown-linux-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Arm BE8 the default Arm big-endian architecture since Armv6".into()),
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align,+v8,+crc".into(),
                    endian: Endian::Big,
                    max_atomic_width: Some(64),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod arm_unknown_linux_musleabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "arm-unknown-linux-musleabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6 Linux with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align,+v6".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}mcount".into(),
                    crt_static_default: true,
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod arm_unknown_linux_musleabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "arm-unknown-linux-musleabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6 Linux with musl 1.2.5, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+strict-align,+v6,+vfp2".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}mcount".into(),
                    crt_static_default: true,
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod armv4t_unknown_linux_gnueabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv4t-unknown-linux-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv4T Linux".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+soft-float,+strict-align".into(),
                    max_atomic_width: Some(32),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    has_thumb_interworking: true,
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod armv5te_unknown_linux_gnueabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv5te-unknown-linux-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv5TE Linux (kernel 4.4, glibc 2.23)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+soft-float,+strict-align".into(),
                    max_atomic_width: Some(32),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    has_thumb_interworking: true,
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod armv5te_unknown_linux_musleabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv5te-unknown-linux-musleabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv5TE Linux with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+soft-float,+strict-align".into(),
                    max_atomic_width: Some(32),
                    mcount: "\u{1}mcount".into(),
                    has_thumb_interworking: true,
                    crt_static_default: true,
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod armv5te_unknown_linux_uclibceabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv5te-unknown-linux-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv5TE Linux with uClibc".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+soft-float,+strict-align".into(),
                    max_atomic_width: Some(32),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    has_thumb_interworking: true,
                    ..base::linux_uclibc::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_linux_gnueabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Linux (kernel 4.15, glibc 2.27)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+v7,+thumb2,+soft-float,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_linux_gnueabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, SanitizerSet, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-gnueabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v7,+vfp3d16,+thumb2,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7neon_unknown_linux_gnueabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-gnueabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb2-mode ARMv7-A Linux with NEON (kernel 4.4, glibc 2.23)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".into(),
                    max_atomic_width: Some(64),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7neon_unknown_linux_musleabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-musleabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb2-mode ARMv7-A Linux with NEON, musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}mcount".into(),
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_linux_musleabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-musleabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Linux with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+v7,+thumb2,+soft-float,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}mcount".into(),
                    crt_static_default: true,
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_linux_musleabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-musleabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Linux with musl 1.2.5, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v7,+vfp3d16,+thumb2,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}mcount".into(),
                    crt_static_default: true,
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_linux_gnu {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, SanitizerSet,
            StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Linux (kernel 4.1, glibc 2.17+)".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &["-Wl,--fix-cortex-a53-843419"]),
                    features: "+v8a,+outline-atomics".into(),
                    frame_pointer: FramePointer::NonLeaf,
                    mcount: "\u{1}_mcount".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                                    SanitizerSet::CFI | SanitizerSet::KCFI | SanitizerSet::LEAK
                                        | SanitizerSet::MEMORY | SanitizerSet::MEMTAG |
                                SanitizerSet::THREAD | SanitizerSet::HWADDRESS |
                        SanitizerSet::REALTIME,
                    supports_xray: true,
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_linux_musl {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, SanitizerSet,
            StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.max_atomic_width = Some(128);
            base.supports_xray = true;
            base.features = "+v8a,+outline-atomics".into();
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK
                        | SanitizerSet::MEMORY | SanitizerSet::THREAD;
            base.crt_static_default = true;
            Target {
                llvm_target: "aarch64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Linux with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &["-Wl,--fix-cortex-a53-843419"]),
                    frame_pointer: FramePointer::NonLeaf,
                    mcount: "\u{1}_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_linux_pauthtest {
        use crate::spec::{
            Arch, CfgAbi, Env, FramePointer, LinkSelfContainedDefault,
            LlvmAbi, StackProbeType, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-linux-pauthtest".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Linux with pauth enabled musl".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    env: Env::Musl,
                    cfg_abi: CfgAbi::Pauthtest,
                    llvm_abiname: LlvmAbi::Pauthtest,
                    features: "+v8.3a,+pauth".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    crt_static_default: false,
                    crt_static_allows_dylibs: false,
                    frame_pointer: FramePointer::NonLeaf,
                    link_self_contained: LinkSelfContainedDefault::False,
                    mcount: "\u{1}_mcount".into(),
                    ..base::linux::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_be_unknown_linux_musl {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, FramePointer, SanitizerSet, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.max_atomic_width = Some(128);
            base.supports_xray = true;
            base.features = "+v8a,+outline-atomics".into();
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK
                        | SanitizerSet::MEMORY | SanitizerSet::THREAD;
            Target {
                llvm_target: "aarch64_be-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Linux (big-endian) with musl-libc 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    frame_pointer: FramePointer::NonLeaf,
                    mcount: "\u{1}_mcount".into(),
                    endian: Endian::Big,
                    ..base
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_linux_musl {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.static_position_independent_executables = true;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK
                        | SanitizerSet::MEMORY | SanitizerSet::THREAD;
            base.supports_fentry = true;
            base.supports_xray = true;
            base.crt_static_default = true;
            Target {
                llvm_target: "x86_64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit Linux with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_unknown_linux_musl {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi,
            StackProbeType, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32", "-Wl,-melf_i386"]);
            base.stack_probes = StackProbeType::Inline;
            base.supports_fentry = true;
            base.crt_static_default = true;
            base.frame_pointer = FramePointer::Always;
            Target {
                llvm_target: "i686-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit Linux with musl 1.2.5".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod i586_unknown_linux_musl {
        use crate::spec::Target;
        pub(crate) fn target() -> Target {
            let mut base = super::i686_unknown_linux_musl::target();
            base.rustc_abi = None;
            base.cpu = "pentium".into();
            base.llvm_target = "i586-unknown-linux-musl".into();
            base.crt_static_default = true;
            base
        }
    }
    pub(crate) mod mips_unknown_linux_musl {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "mips32r2".into();
            base.features = "+mips32r2,+soft-float".into();
            base.max_atomic_width = Some(32);
            Target {
                llvm_target: "mips-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS Linux with musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    endian: Endian::Big,
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod mipsel_unknown_linux_musl {
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "mips32r2".into();
            base.features = "+mips32r2,+soft-float".into();
            base.max_atomic_width = Some(32);
            Target {
                llvm_target: "mipsel-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS (little endian) Linux with musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod mips64_unknown_linux_muslabi64 {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "mips64r2".into();
            base.features = "+mips64r2,+xgot".into();
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "mips64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS64 Linux, N64 ABI, musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Mips64,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Abi64,
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    llvm_abiname: LlvmAbi::N64,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    ..base
                },
            }
        }
    }
    pub(crate) mod mips64el_unknown_linux_muslabi64 {
        use crate::spec::{
            Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "mips64r2".into();
            base.features = "+mips64r2,+xgot".into();
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "mips64el-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS64 Linux, N64 ABI, musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Mips64,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Abi64,
                    mcount: "_mcount".into(),
                    llvm_abiname: LlvmAbi::N64,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    ..base
                },
            }
        }
    }
    pub(crate) mod hexagon_unknown_linux_musl {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "hexagonv60".into();
            base.max_atomic_width = Some(32);
            base.features = "-small-data,+hvx-length128b".into();
            base.has_rpath = true;
            base.linker = Some("hexagon-unknown-linux-musl-clang".into());
            base.linker_flavor = LinkerFlavor::Gnu(Cc::Yes, Lld::No);
            base.c_enum_min_bits = Some(8);
            Target {
                llvm_target: "hexagon-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("Hexagon Linux with musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048".into(),
                arch: Arch::Hexagon,
                options: base,
            }
        }
    }
    pub(crate) mod hexagon_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, PanicStrategy, Target,
            TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "hexagon-unknown-none-elf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Hexagon (v60+, HVX)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32:32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32:32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048:2048:2048".into(),
                arch: Arch::Hexagon,
                options: TargetOptions {
                    cpu: "hexagonv60".into(),
                    panic_strategy: PanicStrategy::Abort,
                    dynamic_linking: true,
                    features: "-small-data,+hvx-length128b".into(),
                    max_atomic_width: Some(32),
                    emit_debug_gdb_scripts: false,
                    c_enum_min_bits: Some(8),
                    linker: Some("rust-lld".into()),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod hexagon_unknown_qurt {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Os, Target, TargetMetadata,
            TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            let mut base = TargetOptions::default();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-G0"]);
            Target {
                llvm_target: "hexagon-unknown-elf".into(),
                metadata: TargetMetadata {
                    description: Some("Hexagon QuRT".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "\
            e-m:e-p:32:32:32-a:0-n16:32-i64:64:64-i32:32\
            :32-i16:16:16-i1:8:8-f32:32:32-f64:64:64-v32\
            :32:32-v64:64:64-v512:512:512-v1024:1024:1024-v2048\
            :2048:2048".into(),
                arch: Arch::Hexagon,
                options: TargetOptions {
                    os: Os::Qurt,
                    vendor: "unknown".into(),
                    cpu: "hexagonv69".into(),
                    linker: Some("hexagon-clang".into()),
                    linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                    exe_suffix: ".elf".into(),
                    dynamic_linking: true,
                    executables: true,
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    has_thread_local: true,
                    has_rpath: false,
                    crt_static_default: false,
                    crt_static_respected: true,
                    crt_static_allows_dylibs: true,
                    no_default_libraries: false,
                    max_atomic_width: Some(32),
                    features: "-small-data,+hvx-length128b".into(),
                    c_enum_min_bits: Some(8),
                    ..base
                },
            }
        }
    }
    pub(crate) mod mips_unknown_linux_uclibc {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mips-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS Linux with uClibc".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    endian: Endian::Big,
                    cpu: "mips32r2".into(),
                    features: "+mips32r2,+soft-float".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    ..base::linux_uclibc::opts()
                },
            }
        }
    }
    pub(crate) mod mipsel_unknown_linux_uclibc {
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsel-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS (LE) Linux with uClibc".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    cpu: "mips32r2".into(),
                    features: "+mips32r2,+soft-float".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    ..base::linux_uclibc::opts()
                },
            }
        }
    }
    pub(crate) mod i686_linux_android {
        use crate::spec::{
            Arch, RustcAbi, SanitizerSet, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::android::opts();
            base.max_atomic_width = Some(64);
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.features = "+mmx,+sse,+sse2,+sse3,+ssse3".into();
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i686-linux-android".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit x86 Android".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: TargetOptions {
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    ..base
                },
            }
        }
    }
    pub(crate) mod x86_64_linux_android {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::android::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.features =
                "+mmx,+sse,+sse2,+sse3,+ssse3,+sse4.1,+sse4.2,+popcnt".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-linux-android".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit x86 Android".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: TargetOptions {
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    ..base
                },
            }
        }
    }
    pub(crate) mod arm_linux_androideabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, SanitizerSet, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "arm-linux-androideabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6 Android".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align,+v5te".into(),
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    max_atomic_width: Some(32),
                    ..base::android::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_linux_androideabi {
        use crate::spec::{
            Arch, Cc, CfgAbi, FloatAbi, LinkerFlavor, Lld, SanitizerSet,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::android::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-march=armv7-a"]);
            Target {
                llvm_target: "armv7-none-linux-android".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Android".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+v7,+thumb-mode,+thumb2,+vfp3d16,-neon".into(),
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    max_atomic_width: Some(64),
                    ..base
                },
            }
        }
    }
    pub(crate) mod thumbv7neon_linux_androideabi {
        use crate::spec::{
            Arch, Cc, CfgAbi, FloatAbi, LinkerFlavor, Lld, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::android::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-march=armv7-a"]);
            Target {
                llvm_target: "armv7-none-linux-android".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb2-mode ARMv7-A Android with NEON".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".into(),
                    max_atomic_width: Some(64),
                    ..base
                },
            }
        }
    }
    pub(crate) mod aarch64_linux_android {
        use crate::spec::{
            Arch, FramePointer, SanitizerSet, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-linux-android".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Android".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    max_atomic_width: Some(128),
                    features: "+v8a,+neon".into(),
                    frame_pointer: FramePointer::NonLeaf,
                    stack_probes: StackProbeType::Inline,
                    supported_sanitizers: SanitizerSet::CFI |
                                    SanitizerSet::HWADDRESS | SanitizerSet::MEMTAG |
                            SanitizerSet::SHADOWCALLSTACK | SanitizerSet::ADDRESS,
                    supports_xray: true,
                    ..base::android::opts()
                },
            }
        }
    }
    pub(crate) mod riscv64_linux_android {
        use std::borrow::Cow;
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SanitizerSet, SplitDebuginfo, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-linux-android".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V 64-bit Android".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c,+b,+v,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    max_atomic_width: Some(64),
                    supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
                    ..base::android::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_freebsd {
        use crate::spec::{
            Arch, SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-freebsd".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 FreeBSD".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    features: "+v8a".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                SanitizerSet::CFI | SanitizerSet::MEMORY |
                        SanitizerSet::THREAD,
                    ..base::freebsd::opts()
                },
            }
        }
    }
    pub(crate) mod armv6_unknown_freebsd {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv6-unknown-freebsd-gnueabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6 FreeBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v6,+vfp2".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),
                    ..base::freebsd::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_freebsd {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-freebsd-gnueabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A FreeBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v7,+vfp3d16,+thumb2,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}__gnu_mcount_nc".into(),
                    ..base::freebsd::opts()
                },
            }
        }
    }
    pub(crate) mod i686_unknown_freebsd {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::freebsd::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32", "-Wl,-znotext"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i686-unknown-freebsd".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit FreeBSD".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod powerpc_unknown_freebsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::freebsd::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32", "--target=powerpc-unknown-freebsd13.0"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-freebsd13.0".into(),
                metadata: TargetMetadata {
                    description: Some("PowerPC FreeBSD".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    endian: Endian::Big,
                    features: "+secure-plt".into(),
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc64_unknown_freebsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::freebsd::opts();
            base.cpu = "ppc64".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV2;
            base.llvm_abiname = LlvmAbi::ElfV2;
            Target {
                llvm_target: "powerpc64-unknown-freebsd".into(),
                metadata: TargetMetadata {
                    description: Some("PPC64 FreeBSD (ELFv2)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc64le_unknown_freebsd {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, add_link_args, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::freebsd::opts();
            base.cpu = "ppc64le".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            add_link_args(&mut base.late_link_args,
                LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-lgcc"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV2;
            base.llvm_abiname = LlvmAbi::ElfV2;
            Target {
                llvm_target: "powerpc64le-unknown-freebsd".into(),
                metadata: TargetMetadata {
                    description: Some("PPC64LE FreeBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-Fn32-i64:64-i128:128-n32:64".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions { mcount: "_mcount".into(), ..base },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_freebsd {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-freebsd".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V FreeBSD".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    ..base::freebsd::opts()
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_freebsd {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::freebsd::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI |
                        SanitizerSet::MEMORY | SanitizerSet::THREAD;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-freebsd".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit FreeBSD".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_dragonfly {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::dragonfly::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "x86_64-unknown-dragonfly".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit DragonFlyBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_unknown_openbsd {
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-openbsd".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 OpenBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    features: "+v8a".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    ..base::openbsd::opts()
                },
            }
        }
    }
    pub(crate) mod i686_unknown_openbsd {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::openbsd::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32", "-fuse-ld=lld"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i686-unknown-openbsd".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit OpenBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod powerpc_unknown_openbsd {
        use rustc_abi::Endian;
        use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::openbsd::opts();
            base.endian = Endian::Big;
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-openbsd".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: base,
            }
        }
    }
    pub(crate) mod powerpc64_unknown_openbsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::openbsd::opts();
            base.cpu = "ppc64".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV2;
            base.llvm_abiname = LlvmAbi::ElfV2;
            Target {
                llvm_target: "powerpc64-unknown-openbsd".into(),
                metadata: TargetMetadata {
                    description: Some("OpenBSD/powerpc64".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-Fn32-i64:64-i128:128-n32:64".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_openbsd {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-openbsd".into(),
                metadata: TargetMetadata {
                    description: Some("OpenBSD/riscv64".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    ..base::openbsd::opts()
                },
            }
        }
    }
    pub(crate) mod sparc64_unknown_openbsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::openbsd::opts();
            base.endian = Endian::Big;
            base.cpu = "v9".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "sparc64-unknown-openbsd".into(),
                metadata: TargetMetadata {
                    description: Some("OpenBSD/sparc64".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Sparc64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_openbsd {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::openbsd::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-openbsd".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit OpenBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_unknown_netbsd {
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-netbsd".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 NetBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    features: "+v8a".into(),
                    mcount: "__mcount".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    ..base::netbsd::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_be_unknown_netbsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64_be-unknown-netbsd".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 NetBSD (big-endian)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    mcount: "__mcount".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    endian: Endian::Big,
                    ..base::netbsd::opts()
                },
            }
        }
    }
    pub(crate) mod armv6_unknown_netbsd_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv6-unknown-netbsdelf-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6 NetBSD w/hard-float".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v6,+vfp2".into(),
                    max_atomic_width: Some(64),
                    mcount: "__mcount".into(),
                    ..base::netbsd::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_netbsd_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-netbsdelf-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A NetBSD w/hard-float".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v7,+vfp3d16,+thumb2,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "__mcount".into(),
                    ..base::netbsd::opts()
                },
            }
        }
    }
    pub(crate) mod i586_unknown_netbsd {
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::netbsd::opts();
            base.cpu = "pentium".into();
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i586-unknown-netbsdelf".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit x86, resricted to Pentium".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: TargetOptions { mcount: "__mcount".into(), ..base },
            }
        }
    }
    pub(crate) mod i686_unknown_netbsd {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::netbsd::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i686-unknown-netbsdelf".into(),
                metadata: TargetMetadata {
                    description: Some("NetBSD/i386 with SSE2".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: TargetOptions { mcount: "__mcount".into(), ..base },
            }
        }
    }
    pub(crate) mod mipsel_unknown_netbsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, LlvmAbi, Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::netbsd::opts();
            base.max_atomic_width = Some(32);
            base.cpu = "mips32".into();
            Target {
                llvm_target: "mipsel-unknown-netbsd".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit MIPS (LE), requires mips32 cpu support".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    features: "+soft-float".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    mcount: "__mcount".into(),
                    endian: Endian::Little,
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc_unknown_netbsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::netbsd::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-netbsd".into(),
                metadata: TargetMetadata {
                    description: Some("NetBSD 32-bit powerpc systems".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "__mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_netbsd {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-netbsd".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V NetBSD".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    mcount: "__mcount".into(),
                    ..base::netbsd::opts()
                },
            }
        }
    }
    pub(crate) mod sparc64_unknown_netbsd {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::netbsd::opts();
            base.cpu = "v9".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "sparc64-unknown-netbsd".into(),
                metadata: TargetMetadata {
                    description: Some("NetBSD/sparc64".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Sparc64,
                options: TargetOptions {
                    endian: Endian::Big,
                    mcount: "__mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_netbsd {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::netbsd::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK
                        | SanitizerSet::MEMORY | SanitizerSet::THREAD;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-netbsd".into(),
                metadata: TargetMetadata {
                    description: Some("NetBSD/amd64".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: TargetOptions { mcount: "__mcount".into(), ..base },
            }
        }
    }
    pub(crate) mod i686_unknown_haiku {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::haiku::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i686-unknown-haiku".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit Haiku".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_haiku {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::haiku::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.position_independent_executables = true;
            Target {
                llvm_target: "x86_64-unknown-haiku".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit Haiku".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_unknown_helenos {
        use crate::spec::{Arch, Target, base};
        pub(crate) fn target() -> Target {
            let mut base = base::helenos::opts();
            base.max_atomic_width = Some(128);
            base.features = "+v8a".into();
            base.linker = Some("aarch64-helenos-gcc".into());
            Target {
                llvm_target: "aarch64-unknown-helenos".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("ARM64 HelenOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_unknown_helenos {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RustcAbi, Target, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::helenos::opts();
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.linker = Some("i686-helenos-gcc".into());
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            Target {
                llvm_target: "i686-unknown-helenos".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("IA-32 (i686) HelenOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod powerpc_unknown_helenos {
        use rustc_abi::Endian;
        use crate::spec::{Arch, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::helenos::opts();
            base.endian = Endian::Big;
            base.max_atomic_width = Some(32);
            base.linker = Some("ppc-helenos-gcc".into());
            Target {
                llvm_target: "powerpc-unknown-helenos".into(),
                metadata: TargetMetadata {
                    description: Some("PowerPC HelenOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: base,
            }
        }
    }
    pub(crate) mod sparc64_unknown_helenos {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::helenos::opts();
            base.endian = Endian::Big;
            base.cpu = "v9".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.linker = Some("sparc64-helenos-gcc".into());
            Target {
                llvm_target: "sparc64-unknown-helenos".into(),
                metadata: TargetMetadata {
                    description: Some("SPARC HelenOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Sparc64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_helenos {
        use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, base};
        pub(crate) fn target() -> Target {
            let mut base = base::helenos::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.linker = Some("amd64-helenos-gcc".into());
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            Target {
                llvm_target: "x86_64-unknown-helenos".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("64-bit HelenOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_unknown_hurd_gnu {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::hurd_gnu::opts();
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i686-unknown-hurd-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit GNU/Hurd".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_hurd_gnu {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::hurd_gnu::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-hurd-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit GNU/Hurd".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_apple_darwin {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::MacOs, Arch::Arm64, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple macOS (11.0+, Big Sur+)".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    mcount: "\u{1}mcount".into(),
                    cpu: "apple-m1".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                SanitizerSet::CFI | SanitizerSet::THREAD |
                        SanitizerSet::REALTIME,
                    supports_xray: true,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod arm64e_apple_darwin {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::MacOs, Arch::Arm64e, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64e Apple Darwin".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    mcount: "\u{1}mcount".into(),
                    cpu: "apple-m1".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                            SanitizerSet::CFI | SanitizerSet::THREAD,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod x86_64_apple_darwin {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::MacOs, Arch::X86_64, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86_64 Apple macOS (10.12+, Sierra+)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch,
                options: TargetOptions {
                    mcount: "\u{1}mcount".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                    SanitizerSet::CFI | SanitizerSet::LEAK |
                            SanitizerSet::THREAD | SanitizerSet::REALTIME,
                    supports_xray: true,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod x86_64h_apple_darwin {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (mut opts, llvm_target, arch) =
                base(Os::MacOs, Arch::X86_64h, TargetEnv::Normal);
            opts.max_atomic_width = Some(128);
            opts.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK
                    | SanitizerSet::THREAD;
            opts.features = "-rdrand,-aes,-pclmulqdq,-rtm,-fsgsbase".into();
            {
                match (&opts.cpu, &"core-avx2") {
                    (left_val, right_val) => {
                        if !(*left_val == *right_val) {
                            let kind = ::core::panicking::AssertKind::Eq;
                            ::core::panicking::assert_failed(kind, &*left_val,
                                &*right_val,
                                ::core::option::Option::Some(format_args!("you need to adjust the feature list in x86_64h-apple-darwin if you change this")));
                        }
                    }
                }
            };
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86_64 Apple macOS with Intel Haswell+".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch,
                options: TargetOptions {
                    mcount: "\u{1}mcount".into(),
                    ..opts
                },
            }
        }
    }
    pub(crate) mod i686_apple_darwin {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::MacOs, Arch::I686, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86 Apple macOS (10.12+, Sierra+)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:128-n8:16:32-S128".into(),
                arch,
                options: TargetOptions {
                    mcount: "\u{1}mcount".into(),
                    max_atomic_width: Some(64),
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_fuchsia {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::fuchsia::opts();
            base.cpu = "generic".into();
            base.features = "+v8a,+crc,+aes,+sha2,+neon".into();
            base.max_atomic_width = Some(128);
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI |
                            SanitizerSet::HWADDRESS | SanitizerSet::LEAK |
                    SanitizerSet::SHADOWCALLSTACK;
            base.default_sanitizers = SanitizerSet::SHADOWCALLSTACK;
            base.supports_xray = true;
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["--execute-only", "--fix-cortex-a53-843419"]);
            Target {
                llvm_target: "aarch64-unknown-fuchsia".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Fuchsia".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_fuchsia {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SanitizerSet, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::fuchsia::opts();
            base.code_model = Some(CodeModel::Medium);
            base.cpu = "generic-rv64".into();
            base.features = "+m,+a,+f,+d,+c,+v,+zicsr,+zifencei".into();
            base.llvm_abiname = LlvmAbi::Lp64d;
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK
                    | SanitizerSet::SHADOWCALLSTACK;
            base.default_sanitizers = SanitizerSet::SHADOWCALLSTACK;
            base.supports_xray = true;
            Target {
                llvm_target: "riscv64-unknown-fuchsia".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Fuchsia".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_fuchsia {
        use crate::spec::{
            Arch, SanitizerSet, StackProbeType, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::fuchsia::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.features =
                "+cmpxchg16b,+lahfsahf,+popcnt,+sse3,+sse4.1,+sse4.2,+ssse3".into();
            base.max_atomic_width = Some(128);
            base.stack_probes = StackProbeType::Inline;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI |
                    SanitizerSet::LEAK;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-fuchsia".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit x86 Fuchsia".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod avr_none {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                arch: Arch::Avr,
                metadata: crate::spec::TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                data_layout: "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8:16-a:8".into(),
                llvm_target: "avr-unknown-unknown".into(),
                pointer_width: 16,
                options: TargetOptions {
                    c_int_width: 16,
                    exe_suffix: ".elf".into(),
                    linker: Some("avr-gcc".into()),
                    eh_frame_header: false,
                    pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &[]),
                    late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &["-lgcc"]),
                    max_atomic_width: Some(16),
                    atomic_cas: false,
                    relocation_model: RelocModel::Static,
                    need_explicit_cpu: true,
                    requires_consistent_cpu: true,
                    ..TargetOptions::default()
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_l4re_uclibc {
        use crate::spec::{Arch, PanicStrategy, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::l4re::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.panic_strategy = PanicStrategy::Abort;
            Target {
                llvm_target: "x86_64-unknown-l4re-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_unknown_redox {
        use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::redox::opts();
            base.max_atomic_width = Some(128);
            base.stack_probes = StackProbeType::Inline;
            base.features = "+v8a".into();
            Target {
                llvm_target: "aarch64-unknown-redox".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 RedoxOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod i586_unknown_redox {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::redox::opts();
            base.cpu = "pentiumpro".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.stack_probes = StackProbeType::Call;
            Target {
                llvm_target: "i586-unknown-redox".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_redox {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::redox::opts();
            base.code_model = Some(CodeModel::Medium);
            base.cpu = "generic-rv64".into();
            base.features = "+m,+a,+f,+d,+c".into();
            base.llvm_abiname = LlvmAbi::Lp64d;
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "riscv64-unknown-redox".into(),
                metadata: TargetMetadata {
                    description: Some("Redox OS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_redox {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::redox::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "x86_64-unknown-redox".into(),
                metadata: TargetMetadata {
                    description: Some("Redox OS".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_managarm_mlibc {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::managarm_mlibc::opts();
            base.cpu = "x86-64".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "x86_64-unknown-managarm-mlibc".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("managarm/amd64".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_unknown_managarm_mlibc {
        use crate::spec::{Arch, StackProbeType, Target, base};
        pub(crate) fn target() -> Target {
            let mut base = base::managarm_mlibc::opts();
            base.max_atomic_width = Some(128);
            base.stack_probes = StackProbeType::Inline;
            base.features = "+v8a".into();
            Target {
                llvm_target: "aarch64-unknown-managarm-mlibc".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("managarm/aarch64".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_managarm_mlibc {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, Target, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-managarm-mlibc".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("managarm/riscv64".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    ..base::managarm_mlibc::opts()
                },
            }
        }
    }
    pub(crate) mod i386_apple_ios {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::I386, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86 Apple iOS Simulator".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:128-n8:16:32-S128".into(),
                arch,
                options: TargetOptions { max_atomic_width: Some(64), ..opts },
            }
        }
    }
    pub(crate) mod x86_64_apple_ios {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::X86_64, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86_64 Apple iOS Simulator".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch,
                options: TargetOptions {
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                        SanitizerSet::THREAD,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_ios {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::Arm64, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple iOS".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a7".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                            SanitizerSet::THREAD | SanitizerSet::REALTIME,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod arm64e_apple_ios {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::Arm64e, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64e Apple iOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a12,+v8.3a,+paca,+pacg".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                        SanitizerSet::THREAD,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod armv7s_apple_ios {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::Armv7s, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARMv7-A Apple-A6 Apple iOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:o-p:32:32-Fi8-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32".into(),
                arch,
                options: TargetOptions {
                    features: "+v7,+vfp4,+neon".into(),
                    max_atomic_width: Some(64),
                    ..opts
                },
            }
        }
    }
    pub(crate) mod x86_64_apple_ios_macabi {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::X86_64, TargetEnv::MacCatalyst);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86_64 Apple Mac Catalyst".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch,
                options: TargetOptions {
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                            SanitizerSet::LEAK | SanitizerSet::THREAD,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_ios_macabi {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::Arm64, TargetEnv::MacCatalyst);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple Mac Catalyst".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a12".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                            SanitizerSet::LEAK | SanitizerSet::THREAD,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_ios_sim {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::IOs, Arch::Arm64, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple iOS Simulator".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a7".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                            SanitizerSet::THREAD | SanitizerSet::REALTIME,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_tvos {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::TvOs, Arch::Arm64, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple tvOS".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a7".into(),
                    max_atomic_width: Some(128),
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_tvos_sim {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::TvOs, Arch::Arm64, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple tvOS Simulator".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a7".into(),
                    max_atomic_width: Some(128),
                    ..opts
                },
            }
        }
    }
    pub(crate) mod arm64e_apple_tvos {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::TvOs, Arch::Arm64e, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64e Apple tvOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a12,+v8.3a,+paca,+pacg".into(),
                    max_atomic_width: Some(128),
                    ..opts
                },
            }
        }
    }
    pub(crate) mod x86_64_apple_tvos {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::TvOs, Arch::X86_64, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86_64 Apple tvOS Simulator".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch,
                options: TargetOptions { max_atomic_width: Some(128), ..opts },
            }
        }
    }
    pub(crate) mod armv7k_apple_watchos {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::WatchOs, Arch::Armv7k, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("Armv7-A Apple WatchOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:o-p:32:32-Fi8-i64:64-a:0:32-n32-S128".into(),
                arch,
                options: TargetOptions {
                    features: "+v7,+vfp4,+neon".into(),
                    max_atomic_width: Some(64),
                    dynamic_linking: false,
                    position_independent_executables: true,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod arm64_32_apple_watchos {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::WatchOs, Arch::Arm64_32, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple watchOS with 32-bit pointers".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+v8a,+neon,+apple-a7".into(),
                    max_atomic_width: Some(128),
                    dynamic_linking: false,
                    position_independent_executables: true,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod x86_64_apple_watchos_sim {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::WatchOs, Arch::X86_64, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("x86_64 Apple watchOS Simulator".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch,
                options: TargetOptions { max_atomic_width: Some(128), ..opts },
            }
        }
    }
    pub(crate) mod aarch64_apple_watchos {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::WatchOs, Arch::Arm64, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple watchOS".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+v8a,+neon,+apple-a7".into(),
                    max_atomic_width: Some(128),
                    dynamic_linking: false,
                    position_independent_executables: true,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_watchos_sim {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{Os, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::WatchOs, Arch::Arm64, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple watchOS Simulator".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a7".into(),
                    max_atomic_width: Some(128),
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_visionos {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::VisionOs, Arch::Arm64, TargetEnv::Normal);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple visionOS".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a16".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                        SanitizerSet::THREAD,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod aarch64_apple_visionos_sim {
        use crate::spec::base::apple::{Arch, TargetEnv, base};
        use crate::spec::{
            Os, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let (opts, llvm_target, arch) =
                base(Os::VisionOs, Arch::Arm64, TargetEnv::Simulator);
            Target {
                llvm_target,
                metadata: TargetMetadata {
                    description: Some("ARM64 Apple visionOS simulator".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch,
                options: TargetOptions {
                    features: "+neon,+apple-a16".into(),
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                        SanitizerSet::THREAD,
                    ..opts
                },
            }
        }
    }
    pub(crate) mod armebv7r_none_eabi {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, FloatAbi, LinkerFlavor, Lld, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armebv7r-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv7-R, Big Endian".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    endian: Endian::Big,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    relocation_model: RelocModel::Static,
                    panic_strategy: PanicStrategy::Abort,
                    max_atomic_width: Some(64),
                    emit_debug_gdb_scripts: false,
                    c_enum_min_bits: Some(8),
                    has_thumb_interworking: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod armebv7r_none_eabihf {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, FloatAbi, LinkerFlavor, Lld, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armebv7r-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv7-R, Big Endian, hardfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    endian: Endian::Big,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    relocation_model: RelocModel::Static,
                    panic_strategy: PanicStrategy::Abort,
                    features: "+vfp3d16".into(),
                    max_atomic_width: Some(64),
                    emit_debug_gdb_scripts: false,
                    c_enum_min_bits: Some(8),
                    has_thumb_interworking: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod armv7r_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7r-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv7-R".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7r_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7r-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare Armv7-R".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv7r_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7r-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv7-R, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp3d16".into(),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7r_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7r-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare Armv7-R, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp3d16".into(),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv8r_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv8r-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv8-R, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv8r_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv8r-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare Armv8-R, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_rtems_eabihf {
        use crate::spec::{
            Arch, Cc, CfgAbi, Env, FloatAbi, LinkerFlavor, Lld, Os,
            PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
            cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7 RTEMS (Requires RTEMS toolchain and kernel".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    os: Os::Rtems,
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                    linker: None,
                    relocation_model: RelocModel::Static,
                    panic_strategy: PanicStrategy::Unwind,
                    features: "+thumb2,+neon,+vfp3".into(),
                    max_atomic_width: Some(64),
                    emit_debug_gdb_scripts: false,
                    c_enum_min_bits: Some(8),
                    eh_frame_header: false,
                    no_default_libraries: false,
                    env: Env::Newlib,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod x86_64_pc_solaris {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, SanitizerSet, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base =
                TargetOptions {
                    cpu: "x86-64".into(),
                    plt_by_default: false,
                    vendor: "pc".into(),
                    max_atomic_width: Some(64),
                    stack_probes: StackProbeType::Inline,
                    supported_sanitizers: SanitizerSet::ADDRESS |
                            SanitizerSet::CFI | SanitizerSet::THREAD,
                    ..base::solaris::opts()
                };
            base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes), &["-m64"]);
            Target {
                llvm_target: "x86_64-pc-solaris".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit Solaris 11.4".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod sparcv9_sun_solaris {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            let mut base =
                TargetOptions {
                    endian: Endian::Big,
                    cpu: "v9".into(),
                    vendor: "sun".into(),
                    max_atomic_width: Some(64),
                    ..base::solaris::opts()
                };
            base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes), &["-m64"]);
            Target {
                llvm_target: "sparcv9-sun-solaris".into(),
                metadata: TargetMetadata {
                    description: Some("SPARC Solaris 11.4".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Sparc64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_illumos {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, SanitizerSet, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::illumos::opts();
            base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes),
                &["-m64", "-std=c99"]);
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI |
                    SanitizerSet::THREAD;
            Target {
                llvm_target: "x86_64-pc-solaris".into(),
                metadata: TargetMetadata {
                    description: Some("illumos".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_unknown_illumos {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, SanitizerSet, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::illumos::opts();
            base.add_pre_link_args(LinkerFlavor::Unix(Cc::Yes),
                &["-std=c99"]);
            base.max_atomic_width = Some(128);
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI;
            base.features = "+v8a".into();
            Target {
                llvm_target: "aarch64-unknown-solaris2.11".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 illumos".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_pc_windows_gnu {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_gnu::opts();
            base.cpu = "x86-64".into();
            base.features = "+cmpxchg16b,+sse3,+lahfsahf".into();
            base.plt_by_default = false;
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pep", "--high-entropy-va"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64", "-Wl,--high-entropy-va"]);
            base.max_atomic_width = Some(128);
            base.linker = Some("x86_64-w64-mingw32-gcc".into());
            Target {
                llvm_target: "x86_64-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit MinGW (Windows 10+)".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_uwp_windows_gnu {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_uwp_gnu::opts();
            base.cpu = "x86-64".into();
            base.features = "+cmpxchg16b,+sse3,+lahfsahf".into();
            base.plt_by_default = false;
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pep", "--high-entropy-va"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64", "-Wl,--high-entropy-va"]);
            base.max_atomic_width = Some(128);
            Target {
                llvm_target: "x86_64-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_win7_windows_gnu {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base =
                TargetOptions {
                    vendor: "win7".into(),
                    cpu: "x86-64".into(),
                    plt_by_default: false,
                    max_atomic_width: Some(64),
                    linker: Some("x86_64-w64-mingw32-gcc".into()),
                    ..base::windows_gnu::opts()
                };
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pep", "--high-entropy-va"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64", "-Wl,--high-entropy-va"]);
            Target {
                llvm_target: "x86_64-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit MinGW (Windows 7+)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_pc_windows_gnu {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target,
            TargetMetadata, base, crt_objects,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_gnu::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.frame_pointer = FramePointer::Always;
            base.linker = Some("i686-w64-mingw32-gcc".into());
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pe", "--large-address-aware"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-Wl,--large-address-aware"]);
            base.pre_link_objects = crt_objects::pre_i686_mingw();
            base.post_link_objects = crt_objects::post_i686_mingw();
            base.pre_link_objects_self_contained =
                crt_objects::pre_i686_mingw_self_contained();
            base.post_link_objects_self_contained =
                crt_objects::post_i686_mingw_self_contained();
            Target {
                llvm_target: "i686-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit MinGW (Windows 10+)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod i686_uwp_windows_gnu {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_uwp_gnu::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.frame_pointer = FramePointer::Always;
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pe", "--large-address-aware"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-Wl,--large-address-aware"]);
            Target {
                llvm_target: "i686-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod i686_win7_windows_gnu {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base =
                TargetOptions {
                    vendor: "win7".into(),
                    rustc_abi: Some(RustcAbi::X86Sse2),
                    cpu: "pentium4".into(),
                    max_atomic_width: Some(64),
                    frame_pointer: FramePointer::Always,
                    linker: Some("i686-w64-mingw32-gcc".into()),
                    ..base::windows_gnu::opts()
                };
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pe", "--large-address-aware"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-Wl,--large-address-aware"]);
            Target {
                llvm_target: "i686-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit MinGW (Windows 7+)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_pc_windows_gnullvm {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, Target, TargetMetadata,
            base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_gnullvm::opts();
            base.max_atomic_width = Some(128);
            base.features = "+v8a,+neon".into();
            base.linker = Some("aarch64-w64-mingw32-clang".into());
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "arm64pe"]);
            base.frame_pointer = FramePointer::NonLeaf;
            Target {
                llvm_target: "aarch64-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 MinGW (Windows 10+), LLVM ABI".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_pc_windows_gnullvm {
        use crate::spec::{
            Arch, Cc, FramePointer, LinkerFlavor, Lld, RustcAbi, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_gnullvm::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.frame_pointer = FramePointer::Always;
            base.linker = Some("i686-w64-mingw32-clang".into());
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pe", "--large-address-aware"]);
            Target {
                llvm_target: "i686-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit x86 MinGW (Windows 10+), LLVM ABI".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_pc_windows_gnullvm {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_gnullvm::opts();
            base.cpu = "x86-64".into();
            base.features = "+cmpxchg16b,+sse3,+lahfsahf".into();
            base.plt_by_default = false;
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pep"]);
            base.max_atomic_width = Some(128);
            base.linker = Some("x86_64-w64-mingw32-clang".into());
            Target {
                llvm_target: "x86_64-pc-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit x86 MinGW (Windows 10+), LLVM ABI".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_pc_windows_msvc {
        use crate::spec::{Arch, FramePointer, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::windows_msvc::opts();
            base.max_atomic_width = Some(128);
            base.features = "+v8a,+neon".into();
            base.frame_pointer = FramePointer::NonLeaf;
            Target {
                llvm_target: "aarch64-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Windows MSVC".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_uwp_windows_msvc {
        use crate::spec::{Arch, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::windows_uwp_msvc::opts();
            base.max_atomic_width = Some(128);
            base.features = "+v8a".into();
            Target {
                llvm_target: "aarch64-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod arm64ec_pc_windows_msvc {
        use crate::spec::{
            Arch, FramePointer, LinkerFlavor, Lld, Target, TargetMetadata,
            add_link_args, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_msvc::opts();
            base.max_atomic_width = Some(128);
            base.features = "+v8a,+neon".into();
            add_link_args(&mut base.late_link_args,
                LinkerFlavor::Msvc(Lld::No),
                &["/machine:arm64ec", "softintrin.lib"]);
            base.frame_pointer = FramePointer::NonLeaf;
            Target {
                llvm_target: "arm64ec-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: Some("Arm64EC Windows MSVC".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::Arm64EC,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_pc_windows_msvc {
        use crate::spec::{Arch, SanitizerSet, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::windows_msvc::opts();
            base.cpu = "x86-64".into();
            base.features = "+cmpxchg16b,+sse3,+lahfsahf".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(128);
            base.supported_sanitizers = SanitizerSet::ADDRESS;
            Target {
                llvm_target: "x86_64-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit MSVC (Windows 10+)".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_uwp_windows_msvc {
        use crate::spec::{Arch, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::windows_uwp_msvc::opts();
            base.cpu = "x86-64".into();
            base.features = "+cmpxchg16b,+sse3,+lahfsahf".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(128);
            Target {
                llvm_target: "x86_64-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_win7_windows_msvc {
        use crate::spec::{
            Arch, SanitizerSet, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let base =
                TargetOptions {
                    vendor: "win7".into(),
                    cpu: "x86-64".into(),
                    plt_by_default: false,
                    max_atomic_width: Some(64),
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    ..base::windows_msvc::opts()
                };
            Target {
                llvm_target: "x86_64-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit MSVC (Windows 7+)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_pc_windows_msvc {
        use crate::spec::{
            Arch, LinkerFlavor, Lld, RustcAbi, SanitizerSet, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_msvc::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.supported_sanitizers = SanitizerSet::ADDRESS;
            base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No),
                &["/LARGEADDRESSAWARE", "/SAFESEH"]);
            Target {
                llvm_target: "i686-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit MSVC (Windows 10+)".into()),
                    tier: Some(1),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod i686_uwp_windows_msvc {
        use crate::spec::{Arch, RustcAbi, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::windows_uwp_msvc::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "i686-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod i686_win7_windows_msvc {
        use crate::spec::{
            Arch, LinkerFlavor, Lld, RustcAbi, SanitizerSet, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base =
                TargetOptions {
                    vendor: "win7".into(),
                    rustc_abi: Some(RustcAbi::X86Sse2),
                    cpu: "pentium4".into(),
                    max_atomic_width: Some(64),
                    supported_sanitizers: SanitizerSet::ADDRESS,
                    has_thread_local: false,
                    ..base::windows_msvc::opts()
                };
            base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No),
                &["/LARGEADDRESSAWARE", "/SAFESEH"]);
            Target {
                llvm_target: "i686-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit MSVC (Windows 7+)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:128-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod thumbv7a_pc_windows_msvc {
        use crate::spec::{
            Arch, FloatAbi, LinkerFlavor, Lld, PanicStrategy, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::windows_msvc::opts();
            base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No),
                &["/OPT:NOLBR"]);
            Target {
                llvm_target: "thumbv7a-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp3,+neon".into(),
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    ..base
                },
            }
        }
    }
    pub(crate) mod thumbv7a_uwp_windows_msvc {
        use crate::spec::{
            Arch, FloatAbi, PanicStrategy, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7a-pc-windows-msvc".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:w-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp3,+neon".into(),
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    ..base::windows_uwp_msvc::opts()
                },
            }
        }
    }
    pub(crate) mod wasm32_unknown_emscripten {
        use crate::spec::{
            Arch, LinkArgs, LinkerFlavor, Os, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions, base, cvs,
        };
        pub(crate) fn target() -> Target {
            let pre_link_args = LinkArgs::new();
            let post_link_args =
                TargetOptions::link_args(LinkerFlavor::EmCc,
                    &["-sABORTING_MALLOC=0", "-sWASM_BIGINT"]);
            let opts =
                TargetOptions {
                    os: Os::Emscripten,
                    linker_flavor: LinkerFlavor::EmCc,
                    exe_suffix: ".js".into(),
                    linker: None,
                    pre_link_args,
                    post_link_args,
                    relocation_model: RelocModel::Pic,
                    crt_static_respected: true,
                    crt_static_default: true,
                    crt_static_allows_dylibs: true,
                    main_needs_argc_argv: true,
                    entry_name: "__main_argc_argv".into(),
                    panic_strategy: PanicStrategy::Unwind,
                    no_default_libraries: false,
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix"),
                                    ::std::borrow::Cow::Borrowed("wasm")]),
                    llvm_args: ::std::borrow::Cow::Borrowed(&[]),
                    ..base::wasm::options()
                };
            Target {
                llvm_target: "wasm32-unknown-emscripten".into(),
                metadata: TargetMetadata {
                    description: Some("WebAssembly via Emscripten".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-f128:64-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm32,
                options: opts,
            }
        }
    }
    pub(crate) mod wasm32_unknown_unknown {
        //! A "bare wasm" target representing a WebAssembly output that makes zero
        //! assumptions about its environment.
        //!
        //! The `wasm32-unknown-unknown` target is intended to encapsulate use cases
        //! that do not rely on any imported functionality. The binaries generated are
        //! entirely self-contained by default when using the standard library. Although
        //! the standard library is available, most of it returns an error immediately
        //! (e.g. trying to create a TCP stream or something like that).
        //!
        //! This target is more or less managed by the Rust and WebAssembly Working
        //! Group nowadays at <https://github.com/rustwasm>.
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Os, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut options = base::wasm::options();
            options.os = Os::Unknown;
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No),
                &["--no-entry"]);
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes),
                &["--target=wasm32-unknown-unknown", "-Wl,--no-entry"]);
            Target {
                llvm_target: "wasm32-unknown-unknown".into(),
                metadata: TargetMetadata {
                    description: Some("WebAssembly".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm32,
                options,
            }
        }
    }
    pub(crate) mod wasm32v1_none {
        //! A "bare wasm" target representing a WebAssembly output that does not import
        //! anything from its environment and also specifies an _upper_ bound on the set
        //! of WebAssembly proposals that are supported.
        //!
        //! It's equivalent to the `wasm32-unknown-unknown` target with the additional
        //! flags `-Ctarget-cpu=mvp` and `-Ctarget-feature=+mutable-globals`. This
        //! enables just the features specified in <https://www.w3.org/TR/wasm-core-1/>
        //!
        //! This is a _separate target_ because using `wasm32-unknown-unknown` with
        //! those target flags doesn't automatically rebuild libcore / liballoc with
        //! them, and in order to get those libraries rebuilt you need to use the
        //! nightly Rust feature `-Zbuild-std`. This target is for people who want to
        //! use stable Rust, and target a stable set of WebAssembly features.
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Os, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut options = base::wasm::options();
            options.os = Os::None;
            options.cpu = "mvp".into();
            options.features = "+mutable-globals".into();
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No),
                &["--no-entry"]);
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes),
                &["--target=wasm32-unknown-unknown", "-Wl,--no-entry"]);
            Target {
                llvm_target: "wasm32-unknown-unknown".into(),
                metadata: TargetMetadata {
                    description: Some("WebAssembly".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm32,
                options,
            }
        }
    }
    pub(crate) mod wasm32_wasip1 {
        //! The `wasm32-wasip1` enables compiling to WebAssembly using the first
        //! version of the WASI standard, called "preview1". This version of the
        //! standard was never formally specified and WASI has since evolved to a
        //! "preview2". This target in rustc uses the previous version of the proposal.
        //!
        //! This target uses the syscalls defined at
        //! <https://github.com/WebAssembly/WASI/tree/wasi-0.1/preview1>.
        //!
        //! Note that this target was historically called `wasm32-wasi` originally and
        //! was since renamed to `wasm32-wasip1` after the preview2 target was
        //! introduced.
        use crate::spec::{
            Arch, Cc, Env, LinkSelfContainedDefault, LinkerFlavor, Os, Target,
            TargetMetadata, base, crt_objects,
        };
        pub(crate) fn target() -> Target {
            let mut options = base::wasm::options();
            options.os = Os::Wasi;
            options.env = Env::P1;
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes),
                &["--target=wasm32-wasip1"]);
            options.pre_link_objects_self_contained =
                crt_objects::pre_wasi_self_contained();
            options.post_link_objects_self_contained =
                crt_objects::post_wasi_self_contained();
            options.link_self_contained = LinkSelfContainedDefault::True;
            options.crt_static_default = true;
            options.crt_static_respected = true;
            options.crt_static_allows_dylibs = true;
            options.entry_name = "__main_void".into();
            Target {
                llvm_target: "wasm32-wasip1".into(),
                metadata: TargetMetadata {
                    description: Some("WebAssembly with WASI".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm32,
                options,
            }
        }
    }
    pub(crate) mod wasm32_wasip2 {
        //! The `wasm32-wasip2` target is the next evolution of the
        //! wasm32-wasip1 target. While the wasi specification is still under
        //! active development, the preview 2 iteration is considered an "island
        //! of stability" that should allow users to rely on it indefinitely.
        //!
        //! The `wasi` target is a proposal to define a standardized set of WebAssembly
        //! component imports that allow it to interoperate with the host system in a
        //! standardized way. This set of imports is intended to empower WebAssembly
        //! binaries with host capabilities such as filesystem access, network access, etc.
        //!
        //! Wasi Preview 2 relies on the WebAssembly component model which is an extension of
        //! the core WebAssembly specification which allows interoperability between WebAssembly
        //! modules (known as "components") through high-level, shared-nothing APIs instead of the
        //! low-level, shared-everything linear memory model of the core WebAssembly specification.
        //!
        //! You can see more about wasi at <https://wasi.dev> and the component model at
        //! <https://github.com/WebAssembly/component-model>.
        use crate::spec::{
            Arch, Env, LinkSelfContainedDefault, Os, RelocModel, Target,
            TargetMetadata, base, crt_objects,
        };
        pub(crate) fn target() -> Target {
            let mut options = base::wasm::options();
            options.os = Os::Wasi;
            options.env = Env::P2;
            options.linker = Some("wasm-component-ld".into());
            options.pre_link_objects_self_contained =
                crt_objects::pre_wasi_self_contained();
            options.post_link_objects_self_contained =
                crt_objects::post_wasi_self_contained();
            options.link_self_contained = LinkSelfContainedDefault::True;
            options.crt_static_default = true;
            options.crt_static_respected = true;
            options.crt_static_allows_dylibs = true;
            options.entry_name = "__main_void".into();
            options.relocation_model = RelocModel::Pic;
            Target {
                llvm_target: "wasm32-wasip2".into(),
                metadata: TargetMetadata {
                    description: Some("WebAssembly".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm32,
                options,
            }
        }
    }
    pub(crate) mod wasm32_wasip3 {
        //! The `wasm32-wasip3` target is the next in the chain of `wasm32-wasip1`, then
        //! `wasm32-wasip2`, then WASIp3. The main feature of WASIp3 is native async
        //! support in the component model itself.
        //!
        //! Like `wasm32-wasip2` this target produces a component by default. Support
        //! for `wasm32-wasip3` is very early as of the time of this writing so
        //! components produced will still import WASIp2 APIs, but that's ok since it's
        //! all component-model-level imports anyway. Over time the imports of the
        //! standard library will change to WASIp3.
        use crate::spec::{Cc, Env, LinkerFlavor, Target, add_link_args};
        pub(crate) fn target() -> Target {
            let mut target = super::wasm32_wasip2::target();
            target.llvm_target = "wasm32-wasip3".into();
            target.metadata =
                crate::spec::TargetMetadata {
                    description: Some("WebAssembly".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                };
            target.options.env = Env::P3;
            add_link_args(&mut target.pre_link_args,
                LinkerFlavor::WasmLld(Cc::No), &["--cooperative-threading"]);
            target
        }
    }
    pub(crate) mod wasm32_wasip1_threads {
        //! The `wasm32-wasip1-threads` target is an extension of the `wasm32-wasip1`
        //! target where threads are enabled by default for all crates. This target
        //! should be considered "in flux" as WASI itself has moved on from "p1" to "p2"
        //! now and threads in "p2" are still under heavy design.
        //!
        //! This target inherits most of the other aspects of `wasm32-wasip1`.
        //!
        //! Historically this target was known as `wasm32-wasi-preview1-threads`.
        use crate::spec::{
            Arch, Cc, Env, LinkSelfContainedDefault, LinkerFlavor, Os, Target,
            TargetMetadata, base, crt_objects,
        };
        pub(crate) fn target() -> Target {
            let mut options = base::wasm::options();
            options.os = Os::Wasi;
            options.env = Env::P1;
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No),
                &["--import-memory", "--export-memory", "--shared-memory",
                            "--max-memory=1073741824"]);
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes),
                &["--target=wasm32-wasip1-threads", "-Wl,--import-memory",
                            "-Wl,--export-memory,", "-Wl,--shared-memory",
                            "-Wl,--max-memory=1073741824"]);
            options.pre_link_objects_self_contained =
                crt_objects::pre_wasi_self_contained();
            options.post_link_objects_self_contained =
                crt_objects::post_wasi_self_contained();
            options.link_self_contained = LinkSelfContainedDefault::True;
            options.crt_static_default = true;
            options.crt_static_respected = true;
            options.crt_static_allows_dylibs = true;
            options.entry_name = "__main_void".into();
            options.singlethread = false;
            options.features =
                "+atomics,+bulk-memory,+mutable-globals".into();
            Target {
                llvm_target: "wasm32-wasip1-threads".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm32,
                options,
            }
        }
    }
    pub(crate) mod wasm32_wali_linux_musl {
        //! The `wasm32-wali-linux-musl` target is a wasm32 target compliant with the
        //! [WebAssembly Linux Interface](https://github.com/arjunr2/WALI).
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut options = base::linux_wasm::opts();
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No),
                &["--export-memory", "--shared-memory",
                            "--max-memory=1073741824"]);
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes),
                &["--target=wasm32-linux-muslwali", "-Wl,--export-memory,",
                            "-Wl,--shared-memory", "-Wl,--max-memory=1073741824"]);
            Target {
                llvm_target: "wasm32-linux-muslwali".into(),
                metadata: TargetMetadata {
                    description: Some("WebAssembly Linux Interface with musl-libc".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm32,
                options,
            }
        }
    }
    pub(crate) mod wasm64_unknown_unknown {
        //! A "bare wasm" target representing a WebAssembly output that makes zero
        //! assumptions about its environment.
        //!
        //! The `wasm64-unknown-unknown` target is intended to encapsulate use cases
        //! that do not rely on any imported functionality. The binaries generated are
        //! entirely self-contained by default when using the standard library. Although
        //! the standard library is available, most of it returns an error immediately
        //! (e.g. trying to create a TCP stream or something like that).
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Os, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut options = base::wasm::options();
            options.os = Os::Unknown;
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No),
                &["--no-entry", "-mwasm64"]);
            options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes),
                &["--target=wasm64-unknown-unknown", "-Wl,--no-entry"]);
            options.features =
                "+bulk-memory,+mutable-globals,+sign-ext,+nontrapping-fptoint".into();
            Target {
                llvm_target: "wasm64-unknown-unknown".into(),
                metadata: TargetMetadata {
                    description: Some("WebAssembly".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20".into(),
                arch: Arch::Wasm64,
                options,
            }
        }
    }
    pub(crate) mod thumbv6m_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv6m-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv6-M".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align,+atomics-32".into(),
                    atomic_cas: false,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7m_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7m-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv7-M".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7em_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7em-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv7E-M".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7em_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7em-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv7E-M, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp4d16sp".into(),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv8m_base_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv8m.base-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv8-M Baseline".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align".into(),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv8m_main_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv8m.main-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv8-M Mainline".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv8m_main_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv8m.main-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv8-M Mainline, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+fp-armv8d16sp".into(),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv7a_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7a-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv7-A".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+soft-float,-neon,+strict-align".into(),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7a_none_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7a-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare Armv7-A".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+soft-float,-neon,+strict-align".into(),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv7a_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7a-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv7-A, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp3d16,-neon,+strict-align".into(),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7a_none_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7a-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare Armv7-A, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp3d16,-neon,+strict-align".into(),
                    max_atomic_width: Some(64),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv7a_nuttx_eabi {
        use crate::spec::{
            Arch, Cc, CfgAbi, FloatAbi, LinkerFlavor, Lld, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    features: "+v7,+thumb2,+soft-float,-neon,+strict-align".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    emit_debug_gdb_scripts: false,
                    c_enum_min_bits: Some(8),
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    ..Default::default()
                };
            Target {
                llvm_target: "armv7a-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("ARMv7-A Cortex-A with NuttX".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: opts,
            }
        }
    }
    pub(crate) mod armv7a_nuttx_eabihf {
        use crate::spec::{
            Arch, Cc, CfgAbi, FloatAbi, LinkerFlavor, Lld, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    features: "+v7,+thumb2,+vfp3,+neon,+strict-align".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    emit_debug_gdb_scripts: false,
                    c_enum_min_bits: Some(8),
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    ..Default::default()
                };
            Target {
                llvm_target: "armv7a-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("ARMv7-A Cortex-A with NuttX (hard float)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: opts,
            }
        }
    }
    pub(crate) mod armv7a_vex_v5 {
        use crate::spec::{
            Arch, Cc, CfgAbi, Env, FloatAbi, LinkerFlavor, Lld, Os,
            PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
        };
        const LINKER_SCRIPT: &str =
            "OUTPUT_FORMAT(\"elf32-littlearm\")\nENTRY(_boot)\n\n/*\n * PROVIDE() is used here so that users can override default values.\n * This is intended to give developers the option to use this Rust\n * target even if the default values in this linker script aren\'t\n * suitable for their needs.\n *\n * For example: `-C link-arg=--defsym=__stack_length=8M` could\n * be used to increase the stack size above the value set in this\n * file.\n */\n\nPROVIDE(__vcodesig_magic = 0x35585658);     /* XVX5                 */\nPROVIDE(__vcodesig_type = 0);               /* V5_SIG_TYPE_USER     */\nPROVIDE(__vcodesig_owner = 2);              /* V5_SIG_OWNER_PARTNER */\nPROVIDE(__vcodesig_options = 0);            /* none (0)             */\n\n__user_ram_start = 0x03800000;\n__user_ram_end   = 0x08000000;\n/* (0x48 =) 72 MiB length */\n__user_ram_length = __user_ram_start - __user_ram_end;\n\n/*\n * VEXos provides a method for pre-loading a \"linked file\" at a specified\n * address in User RAM, conventionally near the end, after the primary\n * program binary. We need to be sure not to place any data in that location,\n * so we allow the user of this linker script to inform the start address of\n * this blob.\n */\nPROVIDE(__linked_file_length = 0);\nPROVIDE(__linked_file_end = __user_ram_end);\nPROVIDE(__linked_file_start = __linked_file_end - __linked_file_length);\n\nPROVIDE(__stack_length = 4M);\nPROVIDE(__stack_top = __linked_file_start);\nPROVIDE(__stack_bottom = __linked_file_start - __stack_length);\n\nMEMORY {\n    USER_RAM (RWX) : ORIGIN = __user_ram_start, LENGTH = __user_ram_length\n}\n\nSECTIONS {\n    /*\n     * VEXos expects program binaries to have a 32-byte header called a \"code signature\"\n     * at their start which tells the OS that we are a valid program and configures some\n     * miscellaneous startup behavior.\n     */\n    .code_signature : {\n        LONG(__vcodesig_magic)\n        LONG(__vcodesig_type)\n        LONG(__vcodesig_owner)\n        LONG(__vcodesig_options)\n\n        FILL(0)\n        . = __user_ram_start + 0x20;\n    } > USER_RAM\n\n    /*\n     * Executable program instructions.\n     */\n    .text ALIGN(4) : {\n        /* _boot routine (entry point from VEXos, must be at 0x03800020) */\n        *(.boot)\n\n        /* The rest of the program. */\n        *(.text .text.*)\n    } > USER_RAM\n\n    /*\n     * Global/uninitialized/static/constant data sections.\n     */\n    .rodata : {\n        *(.rodata .rodata1 .rodata.*)\n        *(.srodata .srodata.*)\n    } > USER_RAM\n\n    /*\n     * ARM Stack Unwinding Sections\n     *\n     * These sections are added by the compiler in some cases to facilitate stack unwinding.\n     * __eh_frame_start and similar symbols are used by libunwind.\n     */\n\n    .except_ordered : {\n        PROVIDE(__extab_start = .);\n        *(.gcc_except_table *.gcc_except_table.*)\n        *(.ARM.extab*)\n        PROVIDE(__extab_end = .);\n    } > USER_RAM\n\n    .eh_frame_hdr : {\n        /* see https://github.com/llvm/llvm-project/blob/main/libunwind/src/AddressSpace.hpp#L78 */\n        PROVIDE(__eh_frame_hdr_start = .);\n        KEEP(*(.eh_frame_hdr))\n        PROVIDE(__eh_frame_hdr_end = .);\n    } > USER_RAM\n\n    .eh_frame : {\n        PROVIDE(__eh_frame_start = .);\n        KEEP(*(.eh_frame))\n        PROVIDE(__eh_frame_end = .);\n    } > USER_RAM\n\n    .except_unordered : {\n        PROVIDE(__exidx_start = .);\n        *(.ARM.exidx*)\n        PROVIDE(__exidx_end = .);\n    } > USER_RAM\n\n    /* -- Data intended to be mutable at runtime begins here. -- */\n\n    .data : {\n        *(.data .data1 .data.*)\n        *(.sdata .sdata.* .sdata2.*)\n    } > USER_RAM\n\n    /* -- End of loadable sections - anything beyond this point shouldn\'t go in the binary uploaded to the device. -- */\n\n    .bss (NOLOAD) : {\n        __bss_start = .;\n        *(.sbss*)\n        *(.bss .bss.*)\n\n        /* Align the heap */\n        . = ALIGN(8);\n        __bss_end = .;\n    } > USER_RAM\n\n    /*\n     * Active memory sections for the stack/heap.\n     *\n     * Because these are (NOLOAD), they will not influence the final size of the binary.\n     */\n    .heap (NOLOAD) : {\n        __heap_start = .;\n        . = __stack_bottom;\n        __heap_end = .;\n    } > USER_RAM\n\n    .stack (NOLOAD) : ALIGN(8) {\n        __stack_bottom = .;\n        . += __stack_length;\n        __stack_top = .;\n    } > USER_RAM\n\n    /*\n     * `.ARM.attributes` contains arch metadata for compatibility purposes, but we\n     * only target one hardware configuration, meaning it\'d just take up space.\n     */\n    /DISCARD/ : {\n        *(.ARM.attributes*)\n    }\n}\n";
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    vendor: "vex".into(),
                    env: Env::V5,
                    os: Os::VexOs,
                    cpu: "cortex-a9".into(),
                    cfg_abi: CfgAbi::EabiHf,
                    is_like_vexos: true,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    features: "+v7,+neon,+vfp3d16,+thumb2".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    emit_debug_gdb_scripts: false,
                    c_enum_min_bits: Some(8),
                    default_uwtable: true,
                    has_thumb_interworking: true,
                    link_script: Some(LINKER_SCRIPT.into()),
                    ..Default::default()
                };
            Target {
                llvm_target: "armv7a-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("ARMv7-A Cortex-A9 VEX V5 Brain".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: opts,
            }
        }
    }
    pub(crate) mod msp430_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, PanicStrategy, RelocModel, Target,
            TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "msp430-none-elf".into(),
                metadata: TargetMetadata {
                    description: Some("16-bit MSP430 microcontrollers".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 16,
                data_layout: "e-m:e-p:16:16-i32:16-i64:16-f32:16-f64:16-a:8-n8:16-S16".into(),
                arch: Arch::Msp430,
                options: TargetOptions {
                    c_int_width: 16,
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mcpu=msp430")]),
                    linker: Some("msp430-elf-gcc".into()),
                    linker_flavor: LinkerFlavor::Unix(Cc::Yes),
                    max_atomic_width: Some(0),
                    atomic_cas: false,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    default_codegen_units: Some(1),
                    trap_unreachable: false,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod aarch64_be_unknown_hermit {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64_be-unknown-hermit".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Hermit (big-endian)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                arch: Arch::AArch64,
                data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                options: TargetOptions {
                    features: "+v8a,+strict-align,+neon".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    endian: Endian::Big,
                    ..base::hermit::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_hermit {
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-hermit".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Hermit".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                arch: Arch::AArch64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                options: TargetOptions {
                    features: "+v8a,+strict-align,+neon".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    ..base::hermit::opts()
                },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_hermit {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, RelocModel, Target, TargetMetadata,
            TargetOptions, TlsModel, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-hermit".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Hermit".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                arch: Arch::RiscV64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                options: TargetOptions {
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    relocation_model: RelocModel::Pic,
                    code_model: Some(CodeModel::Medium),
                    tls_model: TlsModel::LocalExec,
                    max_atomic_width: Some(64),
                    llvm_abiname: LlvmAbi::Lp64d,
                    ..base::hermit::opts()
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_hermit {
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "x86_64-unknown-hermit".into(),
                metadata: TargetMetadata {
                    description: Some("x86_64 Hermit".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                arch: Arch::X86_64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                options: TargetOptions {
                    cpu: "x86-64".into(),
                    features: "+rdrand,+rdseed".into(),
                    plt_by_default: false,
                    max_atomic_width: Some(64),
                    stack_probes: StackProbeType::Inline,
                    ..base::hermit::opts()
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_motor {
        use crate::spec::{
            Arch, CodeModel, LinkSelfContainedDefault, RelocModel, RelroLevel,
            Target, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::motor::opts();
            base.cpu = "x86-64".into();
            base.max_atomic_width = Some(64);
            base.code_model = Some(CodeModel::Small);
            base.position_independent_executables = true;
            base.relro_level = RelroLevel::Full;
            base.static_position_independent_executables = true;
            base.relocation_model = RelocModel::Pic;
            base.link_self_contained = LinkSelfContainedDefault::True;
            base.dynamic_linking = false;
            base.crt_static_default = true;
            base.crt_static_respected = true;
            Target {
                llvm_target: "x86_64-unknown-none-elf".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("Motor OS".into()),
                    tier: Some(3),
                    host_tools: None,
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unikraft_linux_musl {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "x86_64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit Unikraft with musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                arch: Arch::X86_64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                options: TargetOptions {
                    cpu: "x86-64".into(),
                    plt_by_default: false,
                    pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes,
                            Lld::No), &["-m64"]),
                    max_atomic_width: Some(64),
                    stack_probes: StackProbeType::Inline,
                    ..base::unikraft_linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_trusty {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, LinkSelfContainedDefault, Os,
            PanicStrategy, RelroLevel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-unknown-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Trusty".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+v7,+thumb2,+soft-float,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}mcount".into(),
                    os: Os::Trusty,
                    link_self_contained: LinkSelfContainedDefault::InferredForMusl,
                    dynamic_linking: false,
                    executables: true,
                    crt_static_default: true,
                    crt_static_respected: true,
                    relro_level: RelroLevel::Full,
                    panic_strategy: PanicStrategy::Abort,
                    position_independent_executables: true,
                    static_position_independent_executables: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_trusty {
        use crate::spec::{
            Arch, LinkSelfContainedDefault, Os, PanicStrategy, RelroLevel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-unknown-musl".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Trusty".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    features: "+neon,+reserve-x18".into(),
                    executables: true,
                    max_atomic_width: Some(128),
                    panic_strategy: PanicStrategy::Abort,
                    os: Os::Trusty,
                    position_independent_executables: true,
                    static_position_independent_executables: true,
                    crt_static_default: true,
                    crt_static_respected: true,
                    dynamic_linking: false,
                    link_self_contained: LinkSelfContainedDefault::InferredForMusl,
                    relro_level: RelroLevel::Full,
                    mcount: "\u{1}_mcount".into(),
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_trusty {
        use crate::spec::{
            Arch, LinkSelfContainedDefault, Os, PanicStrategy, RelroLevel,
            StackProbeType, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "x86_64-unknown-unknown-musl".into(),
                metadata: TargetMetadata {
                    description: Some("x86_64 Trusty".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: TargetOptions {
                    executables: true,
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    os: Os::Trusty,
                    link_self_contained: LinkSelfContainedDefault::InferredForMusl,
                    position_independent_executables: true,
                    static_position_independent_executables: true,
                    crt_static_default: true,
                    crt_static_respected: true,
                    dynamic_linking: false,
                    plt_by_default: false,
                    relro_level: RelroLevel::Full,
                    stack_probes: StackProbeType::Inline,
                    mcount: "\u{1}_mcount".into(),
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32i_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32I ISA)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: false,
                    features: "+forced-atomics".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32im_risc0_zkvm_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("RISC Zero's zero-knowledge Virtual Machine (RV32IM ISA)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    os: Os::Zkvm,
                    vendor: "risc0".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(64),
                    atomic_cas: true,
                    features: "+m".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    executables: true,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    singlethread: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32im_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: false,
                    features: "+m,+forced-atomics".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32ima_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32IMA ISA)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    features: "+m,+a".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imc_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32IMC ISA)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: false,
                    features: "+m,+c,+forced-atomics".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imfc_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32IMFC ISA, hardware single-float, no atomics)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: false,
                    features: "+m,+f,+c,+forced-atomics".into(),
                    llvm_abiname: LlvmAbi::Ilp32f,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imc_esp_espidf {
        use crate::spec::{
            Arch, Env, LlvmAbi, Os, PanicStrategy, RelocModel, Target,
            TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V ESP-IDF".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::EspIdf,
                    env: Env::Newlib,
                    vendor: "espressif".into(),
                    linker: Some("riscv32-esp-elf-gcc".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    features: "+m,+c".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imac_esp_espidf {
        use crate::spec::{
            Arch, Env, LlvmAbi, Os, PanicStrategy, RelocModel, Target,
            TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V ESP-IDF".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::EspIdf,
                    env: Env::Newlib,
                    vendor: "espressif".into(),
                    linker: Some("riscv32-esp-elf-gcc".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    features: "+m,+a,+c".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imafc_esp_espidf {
        use crate::spec::{
            Arch, Env, LlvmAbi, Os, PanicStrategy, RelocModel, Target,
            TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V ESP-IDF".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::EspIdf,
                    env: Env::Newlib,
                    vendor: "espressif".into(),
                    linker: Some("riscv32-esp-elf-gcc".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    llvm_abiname: LlvmAbi::Ilp32f,
                    features: "+m,+a,+c,+f".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32e_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S32".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32E ISA)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Ilp32e,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    llvm_abiname: LlvmAbi::Ilp32e,
                    max_atomic_width: Some(32),
                    atomic_cas: false,
                    features: "+e,+forced-atomics".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32em_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S32".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32EM ISA)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Ilp32e,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    llvm_abiname: LlvmAbi::Ilp32e,
                    max_atomic_width: Some(32),
                    atomic_cas: false,
                    features: "+e,+m,+forced-atomics".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32emc_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S32".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32EMC ISA)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Ilp32e,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    llvm_abiname: LlvmAbi::Ilp32e,
                    max_atomic_width: Some(32),
                    atomic_cas: false,
                    features: "+e,+m,+c,+forced-atomics".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imac_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32IMAC ISA)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    features: "+m,+a,+c".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imafc_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV32IMAFC ISA)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    llvm_abiname: LlvmAbi::Ilp32f,
                    features: "+m,+a,+c,+f".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imac_unknown_xous_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Xous (RV32IMAC ISA)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    os: Os::Xous,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    features: "+m,+a,+c".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Unwind,
                    relocation_model: RelocModel::Static,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32gc_unknown_linux_gnu {
        use std::borrow::Cow;
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv32-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Linux (kernel 5.4, glibc 2.33)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                arch: Arch::RiscV32,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv32".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Ilp32d,
                    max_atomic_width: Some(32),
                    supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
                    mcount: "\u{1}_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod riscv32gc_unknown_linux_musl {
        use std::borrow::Cow;
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv32-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Linux (kernel 5.4, musl 1.2.5)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                arch: Arch::RiscV32,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv32".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Ilp32d,
                    max_atomic_width: Some(32),
                    supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod riscv64im_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                llvm_target: "riscv64".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV64IM ISA)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                arch: Arch::RiscV64,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv64".into(),
                    max_atomic_width: Some(64),
                    atomic_cas: false,
                    features: "+m,+forced-atomics".into(),
                    llvm_abiname: LlvmAbi::Lp64,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    code_model: Some(CodeModel::Medium),
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv64imac_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                llvm_target: "riscv64".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV64IMAC ISA)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                arch: Arch::RiscV64,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv64".into(),
                    max_atomic_width: Some(64),
                    features: "+m,+a,+c".into(),
                    llvm_abiname: LlvmAbi::Lp64,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    code_model: Some(CodeModel::Medium),
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    supported_sanitizers: SanitizerSet::KERNELADDRESS |
                        SanitizerSet::SHADOWCALLSTACK,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_none_elf {
        use crate::spec::{
            Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, SanitizerSet, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                metadata: TargetMetadata {
                    description: Some("Bare RISC-V (RV64IMAFDC ISA)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                llvm_target: "riscv64".into(),
                pointer_width: 64,
                arch: Arch::RiscV64,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    llvm_abiname: LlvmAbi::Lp64d,
                    cpu: "generic-rv64".into(),
                    max_atomic_width: Some(64),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    code_model: Some(CodeModel::Medium),
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    supported_sanitizers: SanitizerSet::KERNELADDRESS |
                        SanitizerSet::SHADOWCALLSTACK,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_linux_gnu {
        use std::borrow::Cow;
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Linux (kernel 4.20, glibc 2.29)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
                    mcount: "\u{1}_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_linux_musl {
        use std::borrow::Cow;
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Linux (kernel 4.20, musl 1.2.5)".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
                    ..base::linux_musl::opts()
                },
            }
        }
    }
    pub(crate) mod riscv64a23_unknown_linux_gnu {
        use std::borrow::Cow;
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SplitDebuginfo, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("RISC-V Linux (kernel 6.8.0, glibc 2.39)".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic-rv64".into(),
                    features: "+rva23u64".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
                    mcount: "\u{1}_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod sparc_unknown_none_elf {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target,
            TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let options =
                TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                    linker: Some("sparc-elf-gcc".into()),
                    endian: Endian::Big,
                    cpu: "v7".into(),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    no_default_libraries: false,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                };
            Target {
                data_layout: "E-m:e-p:32:32-i64:64-i128:128-f128:64-n32-S64".into(),
                llvm_target: "sparc-unknown-none-elf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare 32-bit SPARC V7+".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Sparc,
                options,
            }
        }
    }
    pub(crate) mod loongarch32_unknown_none {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "loongarch32-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Freestanding/bare-metal LoongArch32".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                arch: Arch::LoongArch32,
                options: TargetOptions {
                    cpu: "generic".into(),
                    features: "+f,+d".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    llvm_abiname: LlvmAbi::Ilp32d,
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    relocation_model: RelocModel::Static,
                    panic_strategy: PanicStrategy::Abort,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod loongarch32_unknown_none_softfloat {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "loongarch32-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Freestanding/bare-metal LoongArch32 softfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                arch: Arch::LoongArch32,
                options: TargetOptions {
                    cpu: "generic".into(),
                    features: "-f,-d".into(),
                    cfg_abi: CfgAbi::SoftFloat,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    llvm_abiname: LlvmAbi::Ilp32s,
                    max_atomic_width: Some(32),
                    mcount: "_mcount".into(),
                    relocation_model: RelocModel::Static,
                    panic_strategy: PanicStrategy::Abort,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod loongarch64_unknown_none {
        use crate::spec::{
            Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "loongarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Freestanding/bare-metal LoongArch64".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::LoongArch64,
                options: TargetOptions {
                    cpu: "generic".into(),
                    features: "+f,+d,-lsx".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    relocation_model: RelocModel::Static,
                    panic_strategy: PanicStrategy::Abort,
                    code_model: Some(CodeModel::Medium),
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod loongarch64_unknown_none_softfloat {
        use crate::spec::{
            Arch, Cc, CfgAbi, CodeModel, LinkerFlavor, Lld, LlvmAbi,
            PanicStrategy, RelocModel, Target, TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "loongarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Freestanding/bare-metal LoongArch64 softfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::LoongArch64,
                options: TargetOptions {
                    cpu: "generic".into(),
                    features: "-f,-d".into(),
                    cfg_abi: CfgAbi::SoftFloat,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    llvm_abiname: LlvmAbi::Lp64s,
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    relocation_model: RelocModel::Static,
                    panic_strategy: PanicStrategy::Abort,
                    code_model: Some(CodeModel::Medium),
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_none {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel,
            SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No,
                            Lld::No), &["--fix-cortex-a53-843419"]),
                    features: "+v8a,+strict-align,+neon".into(),
                    supported_sanitizers: SanitizerSet::KCFI |
                            SanitizerSet::KERNELADDRESS | SanitizerSet::KERNELHWADDRESS,
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    panic_strategy: PanicStrategy::Abort,
                    default_uwtable: true,
                    supports_xray: true,
                    ..Default::default()
                };
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARM64, hardfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: opts,
            }
        }
    }
    pub(crate) mod aarch64_unknown_none_softfloat {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel,
            RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    cfg_abi: CfgAbi::SoftFloat,
                    rustc_abi: Some(RustcAbi::Softfloat),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    features: "+v8a,+strict-align,-neon".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::KCFI |
                            SanitizerSet::KERNELADDRESS | SanitizerSet::KERNELHWADDRESS,
                    stack_probes: StackProbeType::Inline,
                    panic_strategy: PanicStrategy::Abort,
                    default_uwtable: true,
                    supports_xray: true,
                    ..Default::default()
                };
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARM64, softfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: opts,
            }
        }
    }
    pub(crate) mod aarch64_be_unknown_none_softfloat {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel,
            RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    cfg_abi: CfgAbi::SoftFloat,
                    rustc_abi: Some(RustcAbi::Softfloat),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    features: "+v8a,+strict-align,-neon".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::KCFI |
                            SanitizerSet::KERNELADDRESS | SanitizerSet::KERNELHWADDRESS,
                    stack_probes: StackProbeType::Inline,
                    panic_strategy: PanicStrategy::Abort,
                    endian: Endian::Big,
                    ..Default::default()
                };
            Target {
                llvm_target: "aarch64_be-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARM64 (big-endian), softfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: opts,
            }
        }
    }
    pub(crate) mod aarch64_unknown_nuttx {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelocModel,
            SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No,
                            Lld::No), &["--fix-cortex-a53-843419"]),
                    features: "+v8a,+strict-align,+neon".into(),
                    supported_sanitizers: SanitizerSet::KCFI |
                            SanitizerSet::KERNELADDRESS | SanitizerSet::KERNELHWADDRESS,
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    panic_strategy: PanicStrategy::Abort,
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    ..Default::default()
                };
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("AArch64 NuttX".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: opts,
            }
        }
    }
    pub(crate) mod aarch64v8r_unknown_none {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel,
            SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    supported_sanitizers: SanitizerSet::KCFI |
                            SanitizerSet::KERNELADDRESS | SanitizerSet::KERNELHWADDRESS,
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    panic_strategy: PanicStrategy::Abort,
                    default_uwtable: true,
                    features: "+v8r,+strict-align".into(),
                    ..Default::default()
                };
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv8-R AArch64, hardfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: opts,
            }
        }
    }
    pub(crate) mod aarch64v8r_unknown_none_softfloat {
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, PanicStrategy, RelocModel,
            RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    cfg_abi: CfgAbi::SoftFloat,
                    rustc_abi: Some(RustcAbi::Softfloat),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(128),
                    supported_sanitizers: SanitizerSet::KCFI |
                            SanitizerSet::KERNELADDRESS | SanitizerSet::KERNELHWADDRESS,
                    stack_probes: StackProbeType::Inline,
                    panic_strategy: PanicStrategy::Abort,
                    default_uwtable: true,
                    features: "+v8r,+strict-align,-neon".into(),
                    ..Default::default()
                };
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv8-R AArch64, softfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: opts,
            }
        }
    }
    pub(crate) mod x86_64_fortanix_unknown_sgx {
        use std::borrow::Cow;
        use crate::spec::{
            Arch, Cc, CfgAbi, Env, LinkerFlavor, Lld, Os, Target,
            TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            let pre_link_args =
                TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                    &["-e", "elf_entry", "-Bstatic", "--gc-sections", "-z",
                                "text", "-z", "norelro", "--no-undefined",
                                "--error-unresolved-symbols", "--no-undefined-version",
                                "-Bsymbolic", "--export-dynamic", "-u", "__rust_abort",
                                "-u", "__rust_c_alloc", "-u", "__rust_c_dealloc", "-u",
                                "__rust_print_err", "-u", "__rust_rwlock_rdlock", "-u",
                                "__rust_rwlock_unlock", "-u", "__rust_rwlock_wrlock"]);
            const EXPORT_SYMBOLS: &[&str] =
                &["sgx_entry", "HEAP_BASE", "HEAP_SIZE", "RELA", "RELACOUNT",
                            "ENCLAVE_SIZE", "CFGDATA_BASE", "DEBUG",
                            "EH_FRM_HDR_OFFSET", "EH_FRM_HDR_LEN", "EH_FRM_OFFSET",
                            "EH_FRM_LEN", "TEXT_BASE", "TEXT_SIZE"];
            let opts =
                TargetOptions {
                    os: Os::Unknown,
                    env: Env::Sgx,
                    vendor: "fortanix".into(),
                    cfg_abi: CfgAbi::Fortanix,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    max_atomic_width: Some(64),
                    cpu: "x86-64".into(),
                    plt_by_default: false,
                    features: "+rdrand,+rdseed,+lvi-cfi,+lvi-load-hardening".into(),
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("--x86-experimental-lvi-inline-asm-hardening")]),
                    position_independent_executables: true,
                    pre_link_args,
                    override_export_symbols: Some(EXPORT_SYMBOLS.iter().cloned().map(Cow::from).collect()),
                    relax_elf_relocations: true,
                    ..Default::default()
                };
            Target {
                llvm_target: "x86_64-elf".into(),
                metadata: TargetMetadata {
                    description: Some("Fortanix ABI for 64-bit Intel SGX".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: opts,
            }
        }
    }
    pub(crate) mod x86_64_unknown_uefi {
        use rustc_abi::{CanonAbi, X86Call};
        use crate::spec::{Arch, RustcAbi, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::uefi_msvc::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.entry_abi = CanonAbi::X86(X86Call::Win64);
            base.features = "-mmx,-sse,+soft-float".into();
            base.rustc_abi = Some(RustcAbi::Softfloat);
            Target {
                llvm_target: "x86_64-unknown-windows".into(),
                metadata: TargetMetadata {
                    description: Some("64-bit UEFI".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod i686_unknown_uefi {
        use crate::spec::{
            Arch, LinkerFlavor, Lld, RustcAbi, Target, TargetMetadata,
            add_link_args, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::uefi_msvc::opts();
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.features = "-mmx,-sse,+soft-float".into();
            base.rustc_abi = Some(RustcAbi::Softfloat);
            add_link_args(&mut base.post_link_args,
                LinkerFlavor::Msvc(Lld::No), &["/DEBUG:NODWARF"]);
            Target {
                llvm_target: "i686-unknown-windows-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("32-bit UEFI".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod aarch64_unknown_uefi {
        use crate::spec::{
            Arch, LinkerFlavor, Lld, Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::uefi_msvc::opts();
            base.max_atomic_width = Some(128);
            base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No),
                &["/machine:arm64"]);
            base.features = "+v8a".into();
            Target {
                llvm_target: "aarch64-unknown-windows".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 UEFI".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-p:64:64-i32:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod nvptx64_nvidia_cuda {
        use crate::spec::{
            Arch, LinkSelfContainedDefault, LinkerFlavor, MergeFunctions, Os,
            PanicStrategy, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                arch: Arch::Nvptx64,
                data_layout: "e-p6:32:32-i64:64-i128:128-i256:256-v16:16-v32:32-n16:32:64".into(),
                llvm_target: "nvptx64-nvidia-cuda".into(),
                metadata: TargetMetadata {
                    description: Some("--emit=asm generates PTX code that runs on NVIDIA GPUs".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                options: TargetOptions {
                    os: Os::Cuda,
                    vendor: "nvidia".into(),
                    linker_flavor: LinkerFlavor::Llbc,
                    cpu: "sm_70".into(),
                    unsupported_cpus: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("sm_20"),
                                    ::std::borrow::Cow::Borrowed("sm_21"),
                                    ::std::borrow::Cow::Borrowed("sm_30"),
                                    ::std::borrow::Cow::Borrowed("sm_32"),
                                    ::std::borrow::Cow::Borrowed("sm_35"),
                                    ::std::borrow::Cow::Borrowed("sm_37"),
                                    ::std::borrow::Cow::Borrowed("sm_50"),
                                    ::std::borrow::Cow::Borrowed("sm_52"),
                                    ::std::borrow::Cow::Borrowed("sm_53"),
                                    ::std::borrow::Cow::Borrowed("sm_60"),
                                    ::std::borrow::Cow::Borrowed("sm_61"),
                                    ::std::borrow::Cow::Borrowed("sm_62")]),
                    requires_consistent_cpu: true,
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    dynamic_linking: true,
                    only_cdylib: true,
                    obj_is_bitcode: true,
                    is_like_gpu: true,
                    dll_prefix: "".into(),
                    dll_suffix: ".ptx".into(),
                    exe_suffix: ".ptx".into(),
                    merge_functions: MergeFunctions::Disabled,
                    supports_stack_protector: false,
                    link_self_contained: LinkSelfContainedDefault::True,
                    static_initializer_must_be_acyclic: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod amdgcn_amd_amdhsa {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, Target,
            TargetMetadata, TargetOptions,
        };
        pub(crate) fn target() -> Target {
            Target {
                arch: Arch::AmdGpu,
                data_layout: "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9".into(),
                llvm_target: "amdgcn-amd-amdhsa".into(),
                metadata: TargetMetadata {
                    description: Some("AMD GPU".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                options: TargetOptions {
                    os: Os::AmdHsa,
                    vendor: "amd".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    need_explicit_cpu: true,
                    requires_consistent_cpu: true,
                    max_atomic_width: Some(64),
                    panic_strategy: PanicStrategy::Abort,
                    no_builtins: true,
                    simd_types_indirect: false,
                    is_like_gpu: true,
                    dynamic_linking: true,
                    only_cdylib: true,
                    executables: false,
                    dll_prefix: "".into(),
                    dll_suffix: ".elf".into(),
                    supports_stack_protector: false,
                    requires_lto: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod xtensa_esp32_none_elf {
        use crate::spec::base::xtensa;
        use crate::spec::{Arch, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "xtensa-none-elf".into(),
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".into(),
                arch: Arch::Xtensa,
                metadata: TargetMetadata {
                    description: Some("Xtensa ESP32".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                options: TargetOptions {
                    vendor: "espressif".into(),
                    cpu: "esp32".into(),
                    linker: Some("xtensa-esp32-elf-gcc".into()),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    ..xtensa::opts()
                },
            }
        }
    }
    pub(crate) mod xtensa_esp32_espidf {
        use rustc_abi::Endian;
        use crate::spec::base::xtensa;
        use crate::spec::{
            Arch, Env, Os, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "xtensa-none-elf".into(),
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".into(),
                arch: Arch::Xtensa,
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: None,
                },
                options: TargetOptions {
                    endian: Endian::Little,
                    c_int_width: 32,
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::EspIdf,
                    env: Env::Newlib,
                    vendor: "espressif".into(),
                    executables: true,
                    cpu: "esp32".into(),
                    linker: Some("xtensa-esp32-elf-gcc".into()),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    ..xtensa::opts()
                },
            }
        }
    }
    pub(crate) mod xtensa_esp32s2_none_elf {
        use crate::spec::base::xtensa;
        use crate::spec::{Arch, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "xtensa-none-elf".into(),
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".into(),
                arch: Arch::Xtensa,
                metadata: TargetMetadata {
                    description: Some("Xtensa ESP32-S2".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                options: TargetOptions {
                    vendor: "espressif".into(),
                    cpu: "esp32s2".into(),
                    linker: Some("xtensa-esp32s2-elf-gcc".into()),
                    max_atomic_width: Some(32),
                    features: "+forced-atomics".into(),
                    ..xtensa::opts()
                },
            }
        }
    }
    pub(crate) mod xtensa_esp32s2_espidf {
        use rustc_abi::Endian;
        use crate::spec::base::xtensa;
        use crate::spec::{
            Arch, Env, Os, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "xtensa-none-elf".into(),
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".into(),
                arch: Arch::Xtensa,
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: None,
                },
                options: TargetOptions {
                    endian: Endian::Little,
                    c_int_width: 32,
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::EspIdf,
                    env: Env::Newlib,
                    vendor: "espressif".into(),
                    executables: true,
                    cpu: "esp32s2".into(),
                    linker: Some("xtensa-esp32s2-elf-gcc".into()),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    ..xtensa::opts()
                },
            }
        }
    }
    pub(crate) mod xtensa_esp32s3_none_elf {
        use crate::spec::base::xtensa;
        use crate::spec::{Arch, Target, TargetMetadata, TargetOptions};
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "xtensa-none-elf".into(),
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".into(),
                arch: Arch::Xtensa,
                metadata: TargetMetadata {
                    description: Some("Xtensa ESP32-S3".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                options: TargetOptions {
                    vendor: "espressif".into(),
                    cpu: "esp32s3".into(),
                    linker: Some("xtensa-esp32s3-elf-gcc".into()),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    ..xtensa::opts()
                },
            }
        }
    }
    pub(crate) mod xtensa_esp32s3_espidf {
        use rustc_abi::Endian;
        use crate::spec::base::xtensa;
        use crate::spec::{
            Arch, Env, Os, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "xtensa-none-elf".into(),
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i8:8:32-i16:16:32-i64:64-n32".into(),
                arch: Arch::Xtensa,
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: None,
                },
                options: TargetOptions {
                    endian: Endian::Little,
                    c_int_width: 32,
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::EspIdf,
                    env: Env::Newlib,
                    vendor: "espressif".into(),
                    executables: true,
                    cpu: "esp32s3".into(),
                    linker: Some("xtensa-esp32s3-elf-gcc".into()),
                    max_atomic_width: Some(32),
                    atomic_cas: true,
                    ..xtensa::opts()
                },
            }
        }
    }
    pub(crate) mod i686_wrs_vxworks {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, RustcAbi, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::vxworks::opts();
            base.rustc_abi = Some(RustcAbi::X86Sse2);
            base.cpu = "pentium4".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32"]);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "i686-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_wrs_vxworks {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::vxworks::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.disable_redzone = true;
            Target {
                llvm_target: "x86_64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod armv7_wrs_vxworks_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-gnueabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A for VxWorks".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+v7,+vfp3d16,+thumb2,-neon".into(),
                    max_atomic_width: Some(64),
                    ..base::vxworks::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_wrs_vxworks {
        use crate::spec::{
            Arch, StackProbeType, Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    features: "+v8a,+reserve-x18".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    ..base::vxworks::opts()
                },
            }
        }
    }
    pub(crate) mod powerpc_wrs_vxworks {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::vxworks::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m32", "--secure-plt"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    endian: Endian::Big,
                    features: "+secure-plt".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc_wrs_vxworks_spe {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, RustcAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::vxworks::opts();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-mspe", "--secure-plt"]);
            base.max_atomic_width = Some(32);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "powerpc-unknown-linux-gnuspe".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),
                arch: Arch::PowerPC,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Spe,
                    rustc_abi: Some(RustcAbi::PowerPcSpe),
                    endian: Endian::Big,
                    features: "+secure-plt,+msync,+spe".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod powerpc64_wrs_vxworks {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, LinkerFlavor, Lld, LlvmAbi, StackProbeType,
            Target, TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::vxworks::opts();
            base.cpu = "ppc64".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.cfg_abi = CfgAbi::ElfV1;
            base.llvm_abiname = LlvmAbi::ElfV1;
            Target {
                llvm_target: "powerpc64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
                arch: Arch::PowerPC64,
                options: TargetOptions { endian: Endian::Big, ..base },
            }
        }
    }
    pub(crate) mod riscv32_wrs_vxworks {
        use crate::spec::{
            Arch, LlvmAbi, StackProbeType, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv32-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                arch: Arch::RiscV32,
                options: TargetOptions {
                    cpu: "generic-rv32".into(),
                    llvm_abiname: LlvmAbi::Ilp32d,
                    max_atomic_width: Some(32),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    stack_probes: StackProbeType::Inline,
                    ..base::vxworks::opts()
                },
            }
        }
    }
    pub(crate) mod riscv64_wrs_vxworks {
        use crate::spec::{
            Arch, LlvmAbi, StackProbeType, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "riscv64-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::RiscV64,
                options: TargetOptions {
                    cpu: "generic-rv64".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    stack_probes: StackProbeType::Inline,
                    ..base::vxworks::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_kmc_solid_asp3 {
        use crate::spec::{
            Arch, RelocModel, StackProbeType, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let base = base::solid::opts();
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 SOLID with TOPPERS/ASP3".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    linker: Some("aarch64-kmc-elf-gcc".into()),
                    features: "+v8a,+neon".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    ..base
                },
            }
        }
    }
    pub(crate) mod armv7a_kmc_solid_asp3_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, RelocModel, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let base = base::solid::opts();
            Target {
                llvm_target: "armv7a-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Arm SOLID with TOPPERS/ASP3".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    linker: Some("arm-kmc-eabi-gcc".into()),
                    features: "+v7,+soft-float,+thumb2,-neon".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(64),
                    ..base
                },
            }
        }
    }
    pub(crate) mod armv7a_kmc_solid_asp3_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, RelocModel, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let base = base::solid::opts();
            Target {
                llvm_target: "armv7a-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Arm SOLID with TOPPERS/ASP3, hardfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    linker: Some("arm-kmc-eabi-gcc".into()),
                    features: "+v7,+vfp3d16,+thumb2,-neon".into(),
                    relocation_model: RelocModel::Static,
                    disable_redzone: true,
                    max_atomic_width: Some(64),
                    ..base
                },
            }
        }
    }
    pub(crate) mod mipsel_sony_psp {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, RelocModel, Target,
            TargetMetadata, TargetOptions, cvs,
        };
        const LINKER_SCRIPT: &str =
            "ENTRY(module_start)\nSECTIONS\n{\n  /* PRX format requires text to begin at 0 */\n  .text 0 : { *(.text .text.*) }\n\n  /* Sort stubs for convenient ordering */\n  .sceStub.text : { *(.sceStub.text) *(SORT(.sceStub.text.*)) }\n\n  /* PSP import library stub sections. Bundles together `.lib.stub.entry.*`\n   * sections for better `--gc-sections` support. */\n  .lib.stub.top : { *(.lib.stub.top) }\n  .lib.stub :     { *(.lib.stub) *(.lib.stub.entry.*) }\n  .lib.stub.btm : { *(.lib.stub.btm) }\n\n  /* Keep these sections around, even though they may appear unused to the linker */\n  .lib.ent.top :  { KEEP(*(.lib.ent.top)) }\n  .lib.ent :      { KEEP(*(.lib.ent)) }\n  .lib.ent.btm :  { KEEP(*(.lib.ent.btm)) }\n\n  .eh_frame_hdr : { *(.eh_frame_hdr) }\n\n  /* Add symbols for LLVM\'s libunwind */\n  __eh_frame_hdr_start = SIZEOF(.eh_frame_hdr) > 0 ? ADDR(.eh_frame_hdr) : 0;\n  __eh_frame_hdr_end = SIZEOF(.eh_frame_hdr) > 0 ? . : 0;\n  .eh_frame :\n  {\n    __eh_frame_start = .;\n    KEEP(*(.eh_frame))\n    __eh_frame_end = .;\n  }\n\n  /* These are explicitly listed to avoid being merged into .rodata */\n  .rodata.sceResident : { *(.rodata.sceResident) *(.rodata.sceResident.*) }\n  .rodata.sceModuleInfo : { *(.rodata.sceModuleInfo) }\n  /* Sort NIDs for convenient ordering */\n  .rodata.sceNid : { *(.rodata.sceNid) *(SORT(.rodata.sceNid.*)) }\n\n  .rodata : { *(.rodata .rodata.*) }\n  .data : { *(.data .data.*) }\n  .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) }\n  .bss : { *(.bss .bss.*) }\n\n  /DISCARD/ : { *(.rel.sceStub.text .MIPS.abiflags .reginfo) }\n}\n";
        pub(crate) fn target() -> Target {
            let pre_link_args =
                TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                    &["--emit-relocs", "--nmagic"]);
            Target {
                llvm_target: "mipsel-sony-psp".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS (LE) Sony PlatStation Portable (PSP)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    os: Os::Psp,
                    vendor: "sony".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    cpu: "mips2".into(),
                    linker: Some("rust-lld".into()),
                    relocation_model: RelocModel::Static,
                    features: "+single-float".into(),
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    llvm_abiname: LlvmAbi::O32,
                    pre_link_args,
                    link_script: Some(LINKER_SCRIPT.into()),
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod mipsel_sony_psx {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsel-sony-psx".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS (LE) Sony PlayStation 1 (PSX)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    os: Os::Psx,
                    vendor: "sony".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    cpu: "mips1".into(),
                    executables: true,
                    linker: Some("rust-lld".into()),
                    relocation_model: RelocModel::Static,
                    exe_suffix: ".exe".into(),
                    features: "+soft-float".into(),
                    max_atomic_width: Some(0),
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    llvm_abiname: LlvmAbi::O32,
                    panic_strategy: PanicStrategy::Abort,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod mipsel_unknown_none {
        //! Bare MIPS32r2, little endian, softfloat, O32 calling convention
        //!
        //! Can be used for MIPS M4K core (e.g. on PIC32MX devices)
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "mipsel-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("Bare MIPS (LE) softfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                arch: Arch::Mips,
                options: TargetOptions {
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    cpu: "mips32r2".into(),
                    features: "+mips32r2,+soft-float,+noabicalls".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    linker: Some("rust-lld".into()),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod mips_mti_none_elf {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                llvm_target: "mips".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS32r2 BE Baremetal Softfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                arch: Arch::Mips,
                options: TargetOptions {
                    vendor: "mti".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    endian: Endian::Big,
                    cpu: "mips32r2".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    features: "+mips32r2,+soft-float,+noabicalls".into(),
                    executables: true,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    singlethread: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod mipsel_mti_none_elf {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, PanicStrategy, RelocModel,
            Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),
                llvm_target: "mipsel".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS32r2 LE Baremetal Softfloat".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                arch: Arch::Mips,
                options: TargetOptions {
                    vendor: "mti".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    endian: Endian::Little,
                    cpu: "mips32r2".into(),
                    llvm_abiname: LlvmAbi::O32,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    max_atomic_width: Some(32),
                    features: "+mips32r2,+soft-float,+noabicalls".into(),
                    executables: true,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    singlethread: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod armv4t_none_eabi {
        //! Targets the ARMv4T architecture, with `a32` code by default.
        //!
        //! Primarily of use for the GBA, but usable with other devices too.
        //!
        //! Please ping @Lokathor if changes are needed.
        //!
        //! **Important:** This target profile **does not** specify a linker script. You
        //! just get the default link script when you build a binary for this target.
        //! The default link script is very likely wrong, so you should use
        //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv4t-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv4T".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Arm,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mthumb-interwork"),
                                    ::std::borrow::Cow::Borrowed("-march=armv4t"),
                                    ::std::borrow::Cow::Borrowed("-mlittle-endian")]),
                    features: "+soft-float,+strict-align".into(),
                    atomic_cas: false,
                    max_atomic_width: Some(0),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv5te_none_eabi {
        //! Targets the ARMv5TE architecture, with `a32` code by default.
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv5te-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare Armv5TE".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Arm,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mthumb-interwork"),
                                    ::std::borrow::Cow::Borrowed("-march=armv5te"),
                                    ::std::borrow::Cow::Borrowed("-mlittle-endian")]),
                    features: "+soft-float,+strict-align".into(),
                    atomic_cas: false,
                    max_atomic_width: Some(0),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv6_none_eabi {
        //! Targets the ARMv6K architecture, with `a32` code by default.
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv6-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv6 soft-float".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Arm,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mthumb-interwork"),
                                    ::std::borrow::Cow::Borrowed("-march=armv6"),
                                    ::std::borrow::Cow::Borrowed("-mlittle-endian")]),
                    features: "+soft-float,+strict-align,+v6k".into(),
                    atomic_cas: true,
                    has_thumb_interworking: true,
                    max_atomic_width: Some(64),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod armv6_none_eabihf {
        //! Targets the ARMv6K architecture, with `a32` code by default, and hard-float ABI
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv6-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Bare ARMv6 hard-float".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Arm,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                options: TargetOptions {
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mthumb-interwork"),
                                    ::std::borrow::Cow::Borrowed("-march=armv6"),
                                    ::std::borrow::Cow::Borrowed("-mlittle-endian")]),
                    features: "+strict-align,+v6k,+vfp2,-d32".into(),
                    atomic_cas: true,
                    has_thumb_interworking: true,
                    max_atomic_width: Some(64),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv4t_none_eabi {
        //! Targets the ARMv4T architecture, with `t32` code by default.
        //!
        //! Primarily of use for the GBA, but usable with other devices too.
        //!
        //! Please ping @Lokathor if changes are needed.
        //!
        //! **Important:** This target profile **does not** specify a linker script. You
        //! just get the default link script when you build a binary for this target.
        //! The default link script is very likely wrong, so you should use
        //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script.
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv4t-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare ARMv4T".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Arm,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mthumb-interwork"),
                                    ::std::borrow::Cow::Borrowed("-march=armv4t"),
                                    ::std::borrow::Cow::Borrowed("-mlittle-endian")]),
                    features: "+soft-float,+strict-align".into(),
                    atomic_cas: false,
                    max_atomic_width: Some(0),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv5te_none_eabi {
        //! Targets the ARMv5TE architecture, with `t32` code by default.
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv5te-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare ARMv5TE".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Arm,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mthumb-interwork"),
                                    ::std::borrow::Cow::Borrowed("-march=armv5te"),
                                    ::std::borrow::Cow::Borrowed("-mlittle-endian")]),
                    features: "+soft-float,+strict-align".into(),
                    atomic_cas: false,
                    max_atomic_width: Some(0),
                    has_thumb_interworking: true,
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv6_none_eabi {
        //! Targets the ARMv6K architecture, with `t32` code by default.
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv6-none-eabi".into(),
                metadata: TargetMetadata {
                    description: Some("Thumb-mode Bare ARMv6 soft-float".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 32,
                arch: Arch::Arm,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    asm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mthumb-interwork"),
                                    ::std::borrow::Cow::Borrowed("-march=armv6"),
                                    ::std::borrow::Cow::Borrowed("-mlittle-endian")]),
                    features: "+soft-float,+strict-align,+v6k".into(),
                    atomic_cas: true,
                    has_thumb_interworking: true,
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_be_unknown_linux_gnu {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, FramePointer, StackProbeType, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64_be-unknown-linux-gnu".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Linux (big-endian)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    features: "+v8a,+outline-atomics".into(),
                    frame_pointer: FramePointer::NonLeaf,
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    mcount: "\u{1}_mcount".into(),
                    endian: Endian::Big,
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_linux_gnu_ilp32 {
        use crate::spec::{
            Arch, CfgAbi, FramePointer, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-linux-gnu_ilp32".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Linux (ILP32 ABI)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Ilp32,
                    features: "+v8a,+outline-atomics".into(),
                    frame_pointer: FramePointer::NonLeaf,
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    mcount: "\u{1}_mcount".into(),
                    ..base::linux_gnu::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_be_unknown_linux_gnu_ilp32 {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, CfgAbi, FramePointer, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_gnu::opts();
            base.max_atomic_width = Some(128);
            Target {
                llvm_target: "aarch64_be-unknown-linux-gnu_ilp32".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Linux (big-endian, ILP32 ABI)".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "E-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Ilp32,
                    features: "+v8a,+outline-atomics".into(),
                    frame_pointer: FramePointer::NonLeaf,
                    stack_probes: StackProbeType::Inline,
                    mcount: "\u{1}_mcount".into(),
                    endian: Endian::Big,
                    ..base
                },
            }
        }
    }
    pub(crate) mod bpfeb_unknown_none {
        use rustc_abi::Endian;
        use crate::spec::{Arch, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "bpfeb".into(),
                metadata: TargetMetadata {
                    description: Some("BPF (big endian)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                data_layout: "E-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                pointer_width: 64,
                arch: Arch::Bpf,
                options: base::bpf::opts(Endian::Big),
            }
        }
    }
    pub(crate) mod bpfel_unknown_none {
        use rustc_abi::Endian;
        use crate::spec::{Arch, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "bpfel".into(),
                metadata: TargetMetadata {
                    description: Some("BPF (little endian)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                pointer_width: 64,
                arch: Arch::Bpf,
                options: base::bpf::opts(Endian::Little),
            }
        }
    }
    pub(crate) mod armv6k_nintendo_3ds {
        use crate::spec::{
            Arch, Cc, CfgAbi, Env, FloatAbi, LinkerFlavor, Lld, Os,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        /// A base target for Nintendo 3DS devices using the devkitARM toolchain.
        ///
        /// Requires the devkitARM toolchain for 3DS targets on the host system.
        pub(crate) fn target() -> Target {
            let pre_link_args =
                TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                    &["-specs=3dsx.specs", "-mtune=mpcore", "-mfloat-abi=hard",
                                "-mtp=soft"]);
            Target {
                llvm_target: "armv6k-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv6K Nintendo 3DS, Horizon (Requires devkitARM toolchain)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    os: Os::Horizon,
                    env: Env::Newlib,
                    vendor: "nintendo".into(),
                    cpu: "mpcore".into(),
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    linker: Some("arm-none-eabi-gcc".into()),
                    relocation_model: RelocModel::Static,
                    features: "+vfp2".into(),
                    pre_link_args,
                    exe_suffix: ".elf".into(),
                    no_default_libraries: false,
                    has_thread_local: true,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod aarch64_nintendo_switch_freestanding {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, Os, PanicStrategy, RelroLevel,
            StackProbeType, Target, TargetMetadata, TargetOptions,
        };
        const LINKER_SCRIPT: &str =
            "OUTPUT_FORMAT(elf64-littleaarch64)\nOUTPUT_ARCH(aarch64)\nENTRY(_start)\n\nPHDRS\n{\n  text PT_LOAD FLAGS(5);\n  rodata PT_LOAD FLAGS(4);\n  data PT_LOAD FLAGS(6);\n  bss PT_LOAD FLAGS(6);\n  dynamic PT_DYNAMIC;\n}\n\nSECTIONS\n{\n  . = 0;\n\n  .text : ALIGN(0x1000) {\n    HIDDEN(__text_start = .);\n    KEEP(*(.text.jmp))\n\n    . = 0x80;\n\n    *(.text .text.*)\n    *(.plt .plt.*)\n  }\n\n  /* Read-only sections */\n\n  . = ALIGN(0x1000);\n\n  .module_name : { *(.module_name) } :rodata\n\n  .rodata : { *(.rodata .rodata.*) } :rodata\n  .hash : { *(.hash) }\n  .dynsym : { *(.dynsym .dynsym.*) }\n  .dynstr : { *(.dynstr .dynstr.*) }\n  .rela.dyn : { *(.rela.dyn) }\n\n  .eh_frame : {\n    HIDDEN(__eh_frame_start = .);\n    *(.eh_frame .eh_frame.*)\n    HIDDEN(__eh_frame_end = .);\n  }\n\n  .eh_frame_hdr : {\n    HIDDEN(__eh_frame_hdr_start = .);\n    *(.eh_frame_hdr .eh_frame_hdr.*)\n    HIDDEN(__eh_frame_hdr_end = .);\n  }\n\n  /* Read-write sections */\n\n   . = ALIGN(0x1000);\n\n  .data : {\n    *(.data .data.*)\n    *(.got .got.*)\n    *(.got.plt .got.plt.*)\n  } :data\n\n  .dynamic : {\n    HIDDEN(__dynamic_start = .);\n    *(.dynamic)\n  }\n\n  /* BSS section */\n\n  . = ALIGN(0x1000);\n\n  .bss : {\n    HIDDEN(__bss_start = .);\n    *(.bss .bss.*)\n    *(COMMON)\n    . = ALIGN(8);\n    HIDDEN(__bss_end = .);\n  } :bss\n}\n";
        /// A base target for Nintendo Switch devices using a pure LLVM toolchain.
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 Nintendo Switch, Horizon".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    features: "+v8a,+neon,+crypto,+crc".into(),
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    link_script: Some(LINKER_SCRIPT.into()),
                    os: Os::Horizon,
                    vendor: "nintendo".into(),
                    max_atomic_width: Some(128),
                    stack_probes: StackProbeType::Inline,
                    panic_strategy: PanicStrategy::Abort,
                    position_independent_executables: true,
                    dynamic_linking: true,
                    relro_level: RelroLevel::Off,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod armv7_sony_vita_newlibeabihf {
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, Cc, CfgAbi, Env, FloatAbi, LinkerFlavor, Lld, Os,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        /// A base target for PlayStation Vita devices using the VITASDK toolchain (using newlib).
        ///
        /// Requires the VITASDK toolchain on the host system.
        pub(crate) fn target() -> Target {
            let pre_link_args =
                TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                    &["-Wl,-q", "-Wl,--pic-veneer"]);
            Target {
                llvm_target: "thumbv7a-sony-vita-eabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Cortex-A9 Sony PlayStation Vita (requires VITASDK toolchain)".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    os: Os::Vita,
                    endian: Endian::Little,
                    c_int_width: 32,
                    env: Env::Newlib,
                    vendor: "sony".into(),
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                    no_default_libraries: false,
                    cpu: "cortex-a9".into(),
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    linker: Some("arm-vita-eabi-gcc".into()),
                    relocation_model: RelocModel::Static,
                    features: "+v7,+neon,+vfp3,+thumb2,+thumb-mode".into(),
                    pre_link_args,
                    exe_suffix: ".elf".into(),
                    has_thumb_interworking: true,
                    max_atomic_width: Some(64),
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_linux_uclibceabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            let base = base::linux_uclibc::opts();
            Target {
                llvm_target: "armv7-unknown-linux-gnueabi".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Linux with uClibc, softfloat".into()),
                    tier: Some(3),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+v7,+thumb2,+soft-float,-neon".into(),
                    cpu: "generic".into(),
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    ..base
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_linux_uclibceabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            let base = base::linux_uclibc::opts();
            Target {
                llvm_target: "armv7-unknown-linux-gnueabihf".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A Linux with uClibc, hardfloat".into()),
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    features: "+v7,+vfp3d16,+thumb2,-neon".into(),
                    cpu: "generic".into(),
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    ..base
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_none {
        use crate::spec::{
            Arch, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelroLevel,
            RustcAbi, SanitizerSet, StackProbeType, Target, TargetMetadata,
            TargetOptions,
        };
        pub(crate) fn target() -> Target {
            let opts =
                TargetOptions {
                    cpu: "x86-64".into(),
                    plt_by_default: false,
                    max_atomic_width: Some(64),
                    stack_probes: StackProbeType::Inline,
                    position_independent_executables: true,
                    static_position_independent_executables: true,
                    relro_level: RelroLevel::Full,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    rustc_abi: Some(RustcAbi::Softfloat),
                    features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(),
                    supported_sanitizers: SanitizerSet::KCFI |
                        SanitizerSet::KERNELADDRESS,
                    disable_redzone: true,
                    panic_strategy: PanicStrategy::Abort,
                    code_model: Some(CodeModel::Kernel),
                    ..Default::default()
                };
            Target {
                llvm_target: "x86_64-unknown-none-elf".into(),
                metadata: TargetMetadata {
                    description: Some("Freestanding/bare-metal x86_64 softfloat".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: opts,
            }
        }
    }
    pub(crate) mod aarch64_unknown_teeos {
        use crate::spec::{Arch, StackProbeType, Target, TargetMetadata, base};
        pub(crate) fn target() -> Target {
            let mut base = base::teeos::opts();
            base.features = "+strict-align,+neon".into();
            base.max_atomic_width = Some(128);
            base.stack_probes = StackProbeType::Inline;
            Target {
                llvm_target: "aarch64-unknown-none".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 TEEOS".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: None,
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: base,
            }
        }
    }
    pub(crate) mod mips64_openwrt_linux_musl {
        //! A target tuple for OpenWrt MIPS64 targets.
        use rustc_abi::Endian;
        use crate::spec::{
            Arch, CfgAbi, LlvmAbi, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_musl::opts();
            base.cpu = "mips64r2".into();
            base.features = "+mips64r2,+soft-float".into();
            base.max_atomic_width = Some(64);
            Target {
                llvm_target: "mips64-unknown-linux-musl".into(),
                metadata: TargetMetadata {
                    description: Some("MIPS64 for OpenWrt Linux musl 1.2.5".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::Mips64,
                options: TargetOptions {
                    vendor: "openwrt".into(),
                    cfg_abi: CfgAbi::Abi64,
                    endian: Endian::Big,
                    mcount: "_mcount".into(),
                    llvm_abiname: LlvmAbi::N64,
                    llvm_args: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("-mno-check-zero-division")]),
                    ..base
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_nto_qnx700 {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{Env, Target};
        pub(crate) fn target() -> Target {
            let mut target = qnx_sdp::aarch64();
            target.metadata.description = Some("ARM64 QNX SDP 7.0".into());
            target.options.pre_link_args =
                qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default,
                    qnx_sdp::Arch::Aarch64);
            target.options.env = Env::Nto70;
            target
        }
    }
    pub(crate) mod aarch64_unknown_nto_qnx710 {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{Env, Target};
        pub(crate) fn target() -> Target {
            let mut target = qnx_sdp::aarch64();
            target.metadata.description =
                Some("ARM64 QNX SDP 7.1 with io-pkt network stack".into());
            target.options.pre_link_args =
                qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default,
                    qnx_sdp::Arch::Aarch64);
            target.options.env = Env::Nto71;
            target
        }
    }
    pub(crate) mod aarch64_unknown_nto_qnx710_iosock {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{Env, Target};
        pub(crate) fn target() -> Target {
            let mut target = qnx_sdp::aarch64();
            target.metadata.description =
                Some("ARM64 QNX SDP 7.1 with io-sock network stack".into());
            target.options.pre_link_args =
                qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::IoSock,
                    qnx_sdp::Arch::Aarch64);
            target.options.env = Env::Nto71IoSock;
            target
        }
    }
    pub(crate) mod aarch64_unknown_qnx {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{Os, Target};
        pub(crate) fn target() -> Target {
            let mut target = qnx_sdp::aarch64();
            target.metadata.description = Some("ARM64 QNX SDP 8.0+".into());
            target.options.pre_link_args =
                qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default,
                    qnx_sdp::Arch::Aarch64);
            target.options.os = Os::Qnx;
            target
        }
    }
    pub(crate) mod x86_64_pc_nto_qnx710 {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{Env, Target};
        pub(crate) fn target() -> Target {
            let mut target = qnx_sdp::x86_64();
            target.metadata.description =
                Some("x86 64-bit QNX SDP 7.1 with io-pkt network stack".into());
            target.options.pre_link_args =
                qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default,
                    qnx_sdp::Arch::X86_64);
            target.options.env = Env::Nto71;
            target
        }
    }
    pub(crate) mod x86_64_pc_nto_qnx710_iosock {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{Env, Target};
        pub(crate) fn target() -> Target {
            let mut target = qnx_sdp::x86_64();
            target.metadata.description =
                Some("x86 64-bit QNX SDP 7.1 with io-sock network stack".into());
            target.options.pre_link_args =
                qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::IoSock,
                    qnx_sdp::Arch::X86_64);
            target.options.env = Env::Nto71IoSock;
            target
        }
    }
    pub(crate) mod x86_64_pc_qnx {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{Os, Target};
        pub(crate) fn target() -> Target {
            let mut target = qnx_sdp::x86_64();
            target.metadata.description =
                Some("x86 64-bit QNX SDP 8.0+".into());
            target.options.pre_link_args =
                qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default,
                    qnx_sdp::Arch::X86_64);
            target.options.os = Os::Qnx;
            target
        }
    }
    pub(crate) mod i686_pc_nto_qnx700 {
        use crate::spec::base::qnx_sdp;
        use crate::spec::{
            Arch, Env, RustcAbi, StackProbeType, Target, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut meta = qnx_sdp::meta();
            meta.description = Some("32-bit x86 QNX SDP 7.0".into());
            meta.std = Some(false);
            Target {
                llvm_target: "i586-pc-unknown".into(),
                metadata: meta,
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-p270:32:32-p271:32:32-p272:64:64-\
            i128:128-f64:32:64-f80:32-n8:16:32-S128".into(),
                arch: Arch::X86,
                options: TargetOptions {
                    rustc_abi: Some(RustcAbi::X86Sse2),
                    cpu: "pentium4".into(),
                    max_atomic_width: Some(64),
                    pre_link_args: qnx_sdp::pre_link_args(qnx_sdp::ApiVariant::Default,
                        qnx_sdp::Arch::I586),
                    env: Env::Nto70,
                    vendor: "pc".into(),
                    stack_probes: StackProbeType::Inline,
                    ..base::qnx_sdp::opts()
                },
            }
        }
    }
    pub(crate) mod aarch64_unknown_linux_ohos {
        use crate::spec::{
            Arch, FramePointer, SanitizerSet, StackProbeType, Target,
            TargetMetadata, TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_ohos::opts();
            base.max_atomic_width = Some(128);
            Target {
                llvm_target: "aarch64-unknown-linux-ohos".into(),
                metadata: TargetMetadata {
                    description: Some("ARM64 OpenHarmony".into()),
                    tier: Some(2),
                    host_tools: Some(true),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32".into(),
                arch: Arch::AArch64,
                options: TargetOptions {
                    frame_pointer: FramePointer::NonLeaf,
                    mcount: "\u{1}_mcount".into(),
                    stack_probes: StackProbeType::Inline,
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                            SanitizerSet::CFI | SanitizerSet::LEAK |
                                    SanitizerSet::MEMORY | SanitizerSet::MEMTAG |
                            SanitizerSet::THREAD | SanitizerSet::HWADDRESS,
                    ..base
                },
            }
        }
    }
    pub(crate) mod armv7_unknown_linux_ohos {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Target, TargetMetadata, TargetOptions,
            base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "armv7-unknown-linux-ohos".into(),
                metadata: TargetMetadata {
                    description: Some("Armv7-A OpenHarmony".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+v7,+thumb2,+soft-float,-neon".into(),
                    max_atomic_width: Some(64),
                    mcount: "\u{1}mcount".into(),
                    ..base::linux_ohos::opts()
                },
            }
        }
    }
    pub(crate) mod loongarch64_unknown_linux_ohos {
        use crate::spec::{
            Arch, CodeModel, LlvmAbi, SanitizerSet, Target, TargetMetadata,
            TargetOptions, base,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "loongarch64-unknown-linux-ohos".into(),
                metadata: TargetMetadata {
                    description: Some("LoongArch64 OpenHarmony".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                arch: Arch::LoongArch64,
                options: TargetOptions {
                    code_model: Some(CodeModel::Medium),
                    cpu: "generic".into(),
                    features: "+f,+d,+lsx,+relax".into(),
                    llvm_abiname: LlvmAbi::Lp64d,
                    max_atomic_width: Some(64),
                    mcount: "_mcount".into(),
                    supported_sanitizers: SanitizerSet::ADDRESS |
                                    SanitizerSet::CFI | SanitizerSet::LEAK |
                            SanitizerSet::MEMORY | SanitizerSet::THREAD,
                    supports_xray: true,
                    direct_access_external_data: Some(false),
                    ..base::linux_ohos::opts()
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_linux_ohos {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target,
            TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux_ohos::opts();
            base.cpu = "x86-64".into();
            base.max_atomic_width = Some(64);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.stack_probes = StackProbeType::Inline;
            base.static_position_independent_executables = true;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK
                        | SanitizerSet::MEMORY | SanitizerSet::THREAD;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-linux-ohos".into(),
                metadata: TargetMetadata {
                    description: Some("x86_64 OpenHarmony".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_unknown_linux_none {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, PanicStrategy, StackProbeType,
            Target, TargetMetadata, base,
        };
        pub(crate) fn target() -> Target {
            let mut base = base::linux::opts();
            base.cpu = "x86-64".into();
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.linker_flavor = LinkerFlavor::Gnu(Cc::No, Lld::Yes);
            base.linker = Some("rust-lld".into());
            base.panic_strategy = PanicStrategy::Abort;
            base.supports_fentry = true;
            Target {
                llvm_target: "x86_64-unknown-linux-none".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod thumbv6m_nuttx_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv6m-none-eabi".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align".into(),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7a_nuttx_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7a-none-eabi".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+soft-float,-neon".into(),
                    max_atomic_width: Some(64),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7a_nuttx_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7a-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp3,+neon".into(),
                    max_atomic_width: Some(64),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7m_nuttx_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7m-none-eabi".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7em_nuttx_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7em-none-eabi".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv7em_nuttx_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv7em-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+vfp4d16sp".into(),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv8m_base_nuttx_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv8m.base-none-eabi".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    features: "+strict-align".into(),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv8m_main_nuttx_eabi {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv8m.main-none-eabi".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::Eabi,
                    llvm_floatabi: Some(FloatAbi::Soft),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod thumbv8m_main_nuttx_eabihf {
        use crate::spec::{
            Arch, CfgAbi, FloatAbi, Os, Target, TargetMetadata, TargetOptions,
            base, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                llvm_target: "thumbv8m.main-none-eabihf".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),
                arch: Arch::Arm,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    cfg_abi: CfgAbi::EabiHf,
                    llvm_floatabi: Some(FloatAbi::Hard),
                    features: "+fp-armv8d16sp".into(),
                    max_atomic_width: Some(32),
                    ..base::arm_none::opts()
                },
            }
        }
    }
    pub(crate) mod riscv32imc_unknown_nuttx_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    features: "+m,+c".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Unwind,
                    relocation_model: RelocModel::Static,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imac_unknown_nuttx_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    features: "+m,+a,+c".into(),
                    llvm_abiname: LlvmAbi::Ilp32,
                    panic_strategy: PanicStrategy::Unwind,
                    relocation_model: RelocModel::Static,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv32imafc_unknown_nuttx_elf {
        use crate::spec::{
            Arch, Cc, LinkerFlavor, Lld, LlvmAbi, Os, PanicStrategy,
            RelocModel, Target, TargetMetadata, TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),
                llvm_target: "riscv32".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                pointer_width: 32,
                arch: Arch::RiscV32,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv32".into(),
                    max_atomic_width: Some(32),
                    llvm_abiname: LlvmAbi::Ilp32f,
                    features: "+m,+a,+c,+f".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv64imac_unknown_nuttx_elf {
        use crate::spec::{
            Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, Os,
            PanicStrategy, RelocModel, SanitizerSet, Target, TargetMetadata,
            TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                llvm_target: "riscv64".into(),
                pointer_width: 64,
                arch: Arch::RiscV64,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    cpu: "generic-rv64".into(),
                    max_atomic_width: Some(64),
                    features: "+m,+a,+c".into(),
                    llvm_abiname: LlvmAbi::Lp64,
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    code_model: Some(CodeModel::Medium),
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    supported_sanitizers: SanitizerSet::KERNELADDRESS,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod riscv64gc_unknown_nuttx_elf {
        use crate::spec::{
            Arch, Cc, CodeModel, LinkerFlavor, Lld, LlvmAbi, Os,
            PanicStrategy, RelocModel, SanitizerSet, Target, TargetMetadata,
            TargetOptions, cvs,
        };
        pub(crate) fn target() -> Target {
            Target {
                data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),
                metadata: TargetMetadata {
                    description: None,
                    tier: Some(3),
                    host_tools: None,
                    std: Some(true),
                },
                llvm_target: "riscv64".into(),
                pointer_width: 64,
                arch: Arch::RiscV64,
                options: TargetOptions {
                    families: ::std::borrow::Cow::Borrowed(&[::std::borrow::Cow::Borrowed("unix")]),
                    os: Os::NuttX,
                    linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
                    linker: Some("rust-lld".into()),
                    llvm_abiname: LlvmAbi::Lp64d,
                    cpu: "generic-rv64".into(),
                    max_atomic_width: Some(64),
                    features: "+m,+a,+f,+d,+c,+zicsr,+zifencei".into(),
                    panic_strategy: PanicStrategy::Abort,
                    relocation_model: RelocModel::Static,
                    code_model: Some(CodeModel::Medium),
                    emit_debug_gdb_scripts: false,
                    eh_frame_header: false,
                    supported_sanitizers: SanitizerSet::KERNELADDRESS,
                    ..Default::default()
                },
            }
        }
    }
    pub(crate) mod x86_64_lynx_lynxos178 {
        use crate::spec::{Arch, SanitizerSet, StackProbeType, Target, base};
        pub(crate) fn target() -> Target {
            let mut base = base::lynxos178::opts();
            base.cpu = "x86-64".into();
            base.plt_by_default = false;
            base.max_atomic_width = Some(64);
            base.stack_probes = StackProbeType::Inline;
            base.static_position_independent_executables = false;
            base.supported_sanitizers =
                SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::KCFI
                                    | SanitizerSet::DATAFLOW | SanitizerSet::LEAK |
                            SanitizerSet::MEMORY | SanitizerSet::SAFESTACK |
                    SanitizerSet::THREAD;
            base.supports_xray = true;
            Target {
                llvm_target: "x86_64-unknown-unknown-gnu".into(),
                metadata: crate::spec::TargetMetadata {
                    description: Some("LynxOS-178".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(false),
                },
                pointer_width: 64,
                data_layout: "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
            }
        }
    }
    pub(crate) mod x86_64_pc_cygwin {
        use crate::spec::{Arch, Cc, LinkerFlavor, Lld, Target, base};
        pub(crate) fn target() -> Target {
            let mut base = base::cygwin::opts();
            base.cpu = "x86-64".into();
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No),
                &["-m", "i386pep"]);
            base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No),
                &["-m64"]);
            base.max_atomic_width = Some(64);
            base.linker = Some("x86_64-pc-cygwin-gcc".into());
            Target {
                llvm_target: "x86_64-pc-cygwin".into(),
                pointer_width: 64,
                data_layout: "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
                arch: Arch::X86_64,
                options: base,
                metadata: crate::spec::TargetMetadata {
                    description: Some("64-bit x86 Cygwin".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                },
            }
        }
    }
    pub(crate) mod x86_64_unknown_linux_gnuasan {
        use crate::spec::{SanitizerSet, Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::x86_64_unknown_linux_gnu::target();
            base.metadata =
                TargetMetadata {
                    description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+) with ASAN enabled by default".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.supported_sanitizers = SanitizerSet::ADDRESS;
            base.default_sanitizers = SanitizerSet::ADDRESS;
            base
        }
    }
    pub(crate) mod x86_64_unknown_linux_gnumsan {
        use crate::spec::{SanitizerSet, Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::x86_64_unknown_linux_gnu::target();
            base.metadata =
                TargetMetadata {
                    description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+) with MSAN enabled by default".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.supported_sanitizers = SanitizerSet::MEMORY;
            base.default_sanitizers = SanitizerSet::MEMORY;
            base
        }
    }
    pub(crate) mod x86_64_unknown_linux_gnutsan {
        use crate::spec::{SanitizerSet, Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::x86_64_unknown_linux_gnu::target();
            base.metadata =
                TargetMetadata {
                    description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+) with TSAN enabled by default".into()),
                    tier: Some(2),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.supported_sanitizers = SanitizerSet::THREAD;
            base.default_sanitizers = SanitizerSet::THREAD;
            base
        }
    }
    pub(crate) mod aarch64_oe_linux_gnu {
        use crate::spec::{Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::aarch64_unknown_linux_gnu::target();
            base.metadata =
                TargetMetadata {
                    description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+) for yocto".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.llvm_target = "aarch64-oe-linux-gnu".into();
            base.options.linker = Some("aarch64-oe-linux-gcc".into());
            base
        }
    }
    pub(crate) mod armv7_oe_linux_gnueabihf {
        use crate::spec::{Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::armv7_unknown_linux_gnueabihf::target();
            base.metadata =
                TargetMetadata {
                    description: Some("Armv7-A Linux, hardfloat (kernel 3.2, glibc 2.17) for yocto".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.llvm_target = "armv7-oe-linux-gnueabihf".into();
            base.options.linker = Some("arm-oe-linux-gnueabi-gcc".into());
            base
        }
    }
    pub(crate) mod i686_oe_linux_gnu {
        use crate::spec::{Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::i686_unknown_linux_gnu::target();
            base.metadata =
                TargetMetadata {
                    description: Some("32-bit Linux (kernel 3.2, glibc 2.17+) for yocto".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.llvm_target = "i686-oe-linux-gnu".into();
            base.options.linker = Some("i686-oe-linux-gcc".into());
            base.options.cpu = "core2".into();
            base.options.features = "+sse3".into();
            base
        }
    }
    pub(crate) mod riscv64_oe_linux_gnu {
        use crate::spec::{Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::riscv64gc_unknown_linux_gnu::target();
            base.metadata =
                TargetMetadata {
                    description: Some("RISC-V Linux (kernel 4.20, glibc 2.29) for yocto".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.llvm_target = "riscv64-oe-linux-gnu".into();
            base.options.linker = Some("riscv64-oe-linux-gcc".into());
            base
        }
    }
    pub(crate) mod x86_64_oe_linux_gnu {
        use crate::spec::{Target, TargetMetadata};
        pub(crate) fn target() -> Target {
            let mut base = super::x86_64_unknown_linux_gnu::target();
            base.metadata =
                TargetMetadata {
                    description: Some("64-bit Linux (kernel 3.2+, glibc 2.17+) for yocto".into()),
                    tier: Some(3),
                    host_tools: Some(false),
                    std: Some(true),
                };
            base.llvm_target = "x86_64-oe-linux-gnu".into();
            base.options.linker = Some("x86_64-oe-linux-gcc".into());
            base
        }
    }
}
/// List of supported targets
pub static TARGETS: &[&str] =
    &["x86_64-unknown-linux-gnu", "x86_64-unknown-linux-gnux32",
                "i686-unknown-linux-gnu", "i586-unknown-linux-gnu",
                "loongarch64-unknown-linux-gnu",
                "loongarch64-unknown-linux-musl", "m68k-unknown-linux-gnu",
                "m68k-unknown-none-elf", "csky-unknown-linux-gnuabiv2",
                "csky-unknown-linux-gnuabiv2hf", "mips-unknown-linux-gnu",
                "mips64-unknown-linux-gnuabi64",
                "mips64el-unknown-linux-gnuabi64",
                "mipsisa32r6-unknown-linux-gnu",
                "mipsisa32r6el-unknown-linux-gnu",
                "mipsisa64r6-unknown-linux-gnuabi64",
                "mipsisa64r6el-unknown-linux-gnuabi64",
                "mipsel-unknown-linux-gnu", "powerpc-unknown-linux-gnu",
                "powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-musl",
                "powerpc-unknown-linux-muslspe", "powerpc64-ibm-aix",
                "powerpc64-unknown-linux-gnu",
                "powerpc64-unknown-linux-gnuelfv2",
                "powerpc64-unknown-linux-musl",
                "powerpc64le-unknown-linux-gnu",
                "powerpc64le-unknown-linux-musl", "s390x-unknown-linux-gnu",
                "s390x-unknown-none-softfloat", "s390x-unknown-linux-musl",
                "sparc-unknown-linux-gnu", "sparc64-unknown-linux-gnu",
                "arm-unknown-linux-gnueabi", "arm-unknown-linux-gnueabihf",
                "armeb-unknown-linux-gnueabi", "arm-unknown-linux-musleabi",
                "arm-unknown-linux-musleabihf",
                "armv4t-unknown-linux-gnueabi",
                "armv5te-unknown-linux-gnueabi",
                "armv5te-unknown-linux-musleabi",
                "armv5te-unknown-linux-uclibceabi",
                "armv7-unknown-linux-gnueabi",
                "armv7-unknown-linux-gnueabihf",
                "thumbv7neon-unknown-linux-gnueabihf",
                "thumbv7neon-unknown-linux-musleabihf",
                "armv7-unknown-linux-musleabi",
                "armv7-unknown-linux-musleabihf", "aarch64-unknown-linux-gnu",
                "aarch64-unknown-linux-musl",
                "aarch64-unknown-linux-pauthtest",
                "aarch64_be-unknown-linux-musl", "x86_64-unknown-linux-musl",
                "i686-unknown-linux-musl", "i586-unknown-linux-musl",
                "mips-unknown-linux-musl", "mipsel-unknown-linux-musl",
                "mips64-unknown-linux-muslabi64",
                "mips64el-unknown-linux-muslabi64",
                "hexagon-unknown-linux-musl", "hexagon-unknown-none-elf",
                "hexagon-unknown-qurt", "mips-unknown-linux-uclibc",
                "mipsel-unknown-linux-uclibc", "i686-linux-android",
                "x86_64-linux-android", "arm-linux-androideabi",
                "armv7-linux-androideabi", "thumbv7neon-linux-androideabi",
                "aarch64-linux-android", "riscv64-linux-android",
                "aarch64-unknown-freebsd", "armv6-unknown-freebsd",
                "armv7-unknown-freebsd", "i686-unknown-freebsd",
                "powerpc-unknown-freebsd", "powerpc64-unknown-freebsd",
                "powerpc64le-unknown-freebsd", "riscv64gc-unknown-freebsd",
                "x86_64-unknown-freebsd", "x86_64-unknown-dragonfly",
                "aarch64-unknown-openbsd", "i686-unknown-openbsd",
                "powerpc-unknown-openbsd", "powerpc64-unknown-openbsd",
                "riscv64gc-unknown-openbsd", "sparc64-unknown-openbsd",
                "x86_64-unknown-openbsd", "aarch64-unknown-netbsd",
                "aarch64_be-unknown-netbsd", "armv6-unknown-netbsd-eabihf",
                "armv7-unknown-netbsd-eabihf", "i586-unknown-netbsd",
                "i686-unknown-netbsd", "mipsel-unknown-netbsd",
                "powerpc-unknown-netbsd", "riscv64gc-unknown-netbsd",
                "sparc64-unknown-netbsd", "x86_64-unknown-netbsd",
                "i686-unknown-haiku", "x86_64-unknown-haiku",
                "aarch64-unknown-helenos", "i686-unknown-helenos",
                "powerpc-unknown-helenos", "sparc64-unknown-helenos",
                "x86_64-unknown-helenos", "i686-unknown-hurd-gnu",
                "x86_64-unknown-hurd-gnu", "aarch64-apple-darwin",
                "arm64e-apple-darwin", "x86_64-apple-darwin",
                "x86_64h-apple-darwin", "i686-apple-darwin",
                "aarch64-unknown-fuchsia", "riscv64gc-unknown-fuchsia",
                "x86_64-unknown-fuchsia", "avr-none",
                "x86_64-unknown-l4re-uclibc", "aarch64-unknown-redox",
                "i586-unknown-redox", "riscv64gc-unknown-redox",
                "x86_64-unknown-redox", "x86_64-unknown-managarm-mlibc",
                "aarch64-unknown-managarm-mlibc",
                "riscv64gc-unknown-managarm-mlibc", "i386-apple-ios",
                "x86_64-apple-ios", "aarch64-apple-ios", "arm64e-apple-ios",
                "armv7s-apple-ios", "x86_64-apple-ios-macabi",
                "aarch64-apple-ios-macabi", "aarch64-apple-ios-sim",
                "aarch64-apple-tvos", "aarch64-apple-tvos-sim",
                "arm64e-apple-tvos", "x86_64-apple-tvos",
                "armv7k-apple-watchos", "arm64_32-apple-watchos",
                "x86_64-apple-watchos-sim", "aarch64-apple-watchos",
                "aarch64-apple-watchos-sim", "aarch64-apple-visionos",
                "aarch64-apple-visionos-sim", "armebv7r-none-eabi",
                "armebv7r-none-eabihf", "armv7r-none-eabi",
                "thumbv7r-none-eabi", "armv7r-none-eabihf",
                "thumbv7r-none-eabihf", "armv8r-none-eabihf",
                "thumbv8r-none-eabihf", "armv7-rtems-eabihf",
                "x86_64-pc-solaris", "sparcv9-sun-solaris",
                "x86_64-unknown-illumos", "aarch64-unknown-illumos",
                "x86_64-pc-windows-gnu", "x86_64-uwp-windows-gnu",
                "x86_64-win7-windows-gnu", "i686-pc-windows-gnu",
                "i686-uwp-windows-gnu", "i686-win7-windows-gnu",
                "aarch64-pc-windows-gnullvm", "i686-pc-windows-gnullvm",
                "x86_64-pc-windows-gnullvm", "aarch64-pc-windows-msvc",
                "aarch64-uwp-windows-msvc", "arm64ec-pc-windows-msvc",
                "x86_64-pc-windows-msvc", "x86_64-uwp-windows-msvc",
                "x86_64-win7-windows-msvc", "i686-pc-windows-msvc",
                "i686-uwp-windows-msvc", "i686-win7-windows-msvc",
                "thumbv7a-pc-windows-msvc", "thumbv7a-uwp-windows-msvc",
                "wasm32-unknown-emscripten", "wasm32-unknown-unknown",
                "wasm32v1-none", "wasm32-wasip1", "wasm32-wasip2",
                "wasm32-wasip3", "wasm32-wasip1-threads",
                "wasm32-wali-linux-musl", "wasm64-unknown-unknown",
                "thumbv6m-none-eabi", "thumbv7m-none-eabi",
                "thumbv7em-none-eabi", "thumbv7em-none-eabihf",
                "thumbv8m.base-none-eabi", "thumbv8m.main-none-eabi",
                "thumbv8m.main-none-eabihf", "armv7a-none-eabi",
                "thumbv7a-none-eabi", "armv7a-none-eabihf",
                "thumbv7a-none-eabihf", "armv7a-nuttx-eabi",
                "armv7a-nuttx-eabihf", "armv7a-vex-v5", "msp430-none-elf",
                "aarch64_be-unknown-hermit", "aarch64-unknown-hermit",
                "riscv64gc-unknown-hermit", "x86_64-unknown-hermit",
                "x86_64-unknown-motor", "x86_64-unikraft-linux-musl",
                "armv7-unknown-trusty", "aarch64-unknown-trusty",
                "x86_64-unknown-trusty", "riscv32i-unknown-none-elf",
                "riscv32im-risc0-zkvm-elf", "riscv32im-unknown-none-elf",
                "riscv32ima-unknown-none-elf", "riscv32imc-unknown-none-elf",
                "riscv32imfc-unknown-none-elf", "riscv32imc-esp-espidf",
                "riscv32imac-esp-espidf", "riscv32imafc-esp-espidf",
                "riscv32e-unknown-none-elf", "riscv32em-unknown-none-elf",
                "riscv32emc-unknown-none-elf", "riscv32imac-unknown-none-elf",
                "riscv32imafc-unknown-none-elf",
                "riscv32imac-unknown-xous-elf", "riscv32gc-unknown-linux-gnu",
                "riscv32gc-unknown-linux-musl", "riscv64im-unknown-none-elf",
                "riscv64imac-unknown-none-elf", "riscv64gc-unknown-none-elf",
                "riscv64gc-unknown-linux-gnu", "riscv64gc-unknown-linux-musl",
                "riscv64a23-unknown-linux-gnu", "sparc-unknown-none-elf",
                "loongarch32-unknown-none",
                "loongarch32-unknown-none-softfloat",
                "loongarch64-unknown-none",
                "loongarch64-unknown-none-softfloat", "aarch64-unknown-none",
                "aarch64-unknown-none-softfloat",
                "aarch64_be-unknown-none-softfloat", "aarch64-unknown-nuttx",
                "aarch64v8r-unknown-none",
                "aarch64v8r-unknown-none-softfloat",
                "x86_64-fortanix-unknown-sgx", "x86_64-unknown-uefi",
                "i686-unknown-uefi", "aarch64-unknown-uefi",
                "nvptx64-nvidia-cuda", "amdgcn-amd-amdhsa",
                "xtensa-esp32-none-elf", "xtensa-esp32-espidf",
                "xtensa-esp32s2-none-elf", "xtensa-esp32s2-espidf",
                "xtensa-esp32s3-none-elf", "xtensa-esp32s3-espidf",
                "i686-wrs-vxworks", "x86_64-wrs-vxworks",
                "armv7-wrs-vxworks-eabihf", "aarch64-wrs-vxworks",
                "powerpc-wrs-vxworks", "powerpc-wrs-vxworks-spe",
                "powerpc64-wrs-vxworks", "riscv32-wrs-vxworks",
                "riscv64-wrs-vxworks", "aarch64-kmc-solid_asp3",
                "armv7a-kmc-solid_asp3-eabi", "armv7a-kmc-solid_asp3-eabihf",
                "mipsel-sony-psp", "mipsel-sony-psx", "mipsel-unknown-none",
                "mips-mti-none-elf", "mipsel-mti-none-elf",
                "armv4t-none-eabi", "armv5te-none-eabi", "armv6-none-eabi",
                "armv6-none-eabihf", "thumbv4t-none-eabi",
                "thumbv5te-none-eabi", "thumbv6-none-eabi",
                "aarch64_be-unknown-linux-gnu",
                "aarch64-unknown-linux-gnu_ilp32",
                "aarch64_be-unknown-linux-gnu_ilp32", "bpfeb-unknown-none",
                "bpfel-unknown-none", "armv6k-nintendo-3ds",
                "aarch64-nintendo-switch-freestanding",
                "armv7-sony-vita-newlibeabihf",
                "armv7-unknown-linux-uclibceabi",
                "armv7-unknown-linux-uclibceabihf", "x86_64-unknown-none",
                "aarch64-unknown-teeos", "mips64-openwrt-linux-musl",
                "aarch64-unknown-nto-qnx700", "aarch64-unknown-nto-qnx710",
                "aarch64-unknown-nto-qnx710_iosock", "aarch64-unknown-qnx",
                "x86_64-pc-nto-qnx710", "x86_64-pc-nto-qnx710_iosock",
                "x86_64-pc-qnx", "i686-pc-nto-qnx700",
                "aarch64-unknown-linux-ohos", "armv7-unknown-linux-ohos",
                "loongarch64-unknown-linux-ohos", "x86_64-unknown-linux-ohos",
                "x86_64-unknown-linux-none", "thumbv6m-nuttx-eabi",
                "thumbv7a-nuttx-eabi", "thumbv7a-nuttx-eabihf",
                "thumbv7m-nuttx-eabi", "thumbv7em-nuttx-eabi",
                "thumbv7em-nuttx-eabihf", "thumbv8m.base-nuttx-eabi",
                "thumbv8m.main-nuttx-eabi", "thumbv8m.main-nuttx-eabihf",
                "riscv32imc-unknown-nuttx-elf",
                "riscv32imac-unknown-nuttx-elf",
                "riscv32imafc-unknown-nuttx-elf",
                "riscv64imac-unknown-nuttx-elf",
                "riscv64gc-unknown-nuttx-elf", "x86_64-lynx-lynxos178",
                "x86_64-pc-cygwin", "x86_64-unknown-linux-gnuasan",
                "x86_64-unknown-linux-gnumsan",
                "x86_64-unknown-linux-gnutsan", "aarch64-oe-linux-gnu",
                "armv7-oe-linux-gnueabihf", "i686-oe-linux-gnu",
                "riscv64-oe-linux-gnu", "x86_64-oe-linux-gnu"];
fn load_builtin(target: &str) -> Option<Target> {
    let t =
        match target {
            "x86_64-unknown-linux-gnu" =>
                targets::x86_64_unknown_linux_gnu::target(),
            "x86_64-unknown-linux-gnux32" =>
                targets::x86_64_unknown_linux_gnux32::target(),
            "i686-unknown-linux-gnu" =>
                targets::i686_unknown_linux_gnu::target(),
            "i586-unknown-linux-gnu" =>
                targets::i586_unknown_linux_gnu::target(),
            "loongarch64-unknown-linux-gnu" =>
                targets::loongarch64_unknown_linux_gnu::target(),
            "loongarch64-unknown-linux-musl" =>
                targets::loongarch64_unknown_linux_musl::target(),
            "m68k-unknown-linux-gnu" =>
                targets::m68k_unknown_linux_gnu::target(),
            "m68k-unknown-none-elf" =>
                targets::m68k_unknown_none_elf::target(),
            "csky-unknown-linux-gnuabiv2" =>
                targets::csky_unknown_linux_gnuabiv2::target(),
            "csky-unknown-linux-gnuabiv2hf" =>
                targets::csky_unknown_linux_gnuabiv2hf::target(),
            "mips-unknown-linux-gnu" =>
                targets::mips_unknown_linux_gnu::target(),
            "mips64-unknown-linux-gnuabi64" =>
                targets::mips64_unknown_linux_gnuabi64::target(),
            "mips64el-unknown-linux-gnuabi64" =>
                targets::mips64el_unknown_linux_gnuabi64::target(),
            "mipsisa32r6-unknown-linux-gnu" =>
                targets::mipsisa32r6_unknown_linux_gnu::target(),
            "mipsisa32r6el-unknown-linux-gnu" =>
                targets::mipsisa32r6el_unknown_linux_gnu::target(),
            "mipsisa64r6-unknown-linux-gnuabi64" =>
                targets::mipsisa64r6_unknown_linux_gnuabi64::target(),
            "mipsisa64r6el-unknown-linux-gnuabi64" =>
                targets::mipsisa64r6el_unknown_linux_gnuabi64::target(),
            "mipsel-unknown-linux-gnu" =>
                targets::mipsel_unknown_linux_gnu::target(),
            "powerpc-unknown-linux-gnu" =>
                targets::powerpc_unknown_linux_gnu::target(),
            "powerpc-unknown-linux-gnuspe" =>
                targets::powerpc_unknown_linux_gnuspe::target(),
            "powerpc-unknown-linux-musl" =>
                targets::powerpc_unknown_linux_musl::target(),
            "powerpc-unknown-linux-muslspe" =>
                targets::powerpc_unknown_linux_muslspe::target(),
            "powerpc64-ibm-aix" => targets::powerpc64_ibm_aix::target(),
            "powerpc64-unknown-linux-gnu" =>
                targets::powerpc64_unknown_linux_gnu::target(),
            "powerpc64-unknown-linux-gnuelfv2" =>
                targets::powerpc64_unknown_linux_gnuelfv2::target(),
            "powerpc64-unknown-linux-musl" =>
                targets::powerpc64_unknown_linux_musl::target(),
            "powerpc64le-unknown-linux-gnu" =>
                targets::powerpc64le_unknown_linux_gnu::target(),
            "powerpc64le-unknown-linux-musl" =>
                targets::powerpc64le_unknown_linux_musl::target(),
            "s390x-unknown-linux-gnu" =>
                targets::s390x_unknown_linux_gnu::target(),
            "s390x-unknown-none-softfloat" =>
                targets::s390x_unknown_none_softfloat::target(),
            "s390x-unknown-linux-musl" =>
                targets::s390x_unknown_linux_musl::target(),
            "sparc-unknown-linux-gnu" =>
                targets::sparc_unknown_linux_gnu::target(),
            "sparc64-unknown-linux-gnu" =>
                targets::sparc64_unknown_linux_gnu::target(),
            "arm-unknown-linux-gnueabi" =>
                targets::arm_unknown_linux_gnueabi::target(),
            "arm-unknown-linux-gnueabihf" =>
                targets::arm_unknown_linux_gnueabihf::target(),
            "armeb-unknown-linux-gnueabi" =>
                targets::armeb_unknown_linux_gnueabi::target(),
            "arm-unknown-linux-musleabi" =>
                targets::arm_unknown_linux_musleabi::target(),
            "arm-unknown-linux-musleabihf" =>
                targets::arm_unknown_linux_musleabihf::target(),
            "armv4t-unknown-linux-gnueabi" =>
                targets::armv4t_unknown_linux_gnueabi::target(),
            "armv5te-unknown-linux-gnueabi" =>
                targets::armv5te_unknown_linux_gnueabi::target(),
            "armv5te-unknown-linux-musleabi" =>
                targets::armv5te_unknown_linux_musleabi::target(),
            "armv5te-unknown-linux-uclibceabi" =>
                targets::armv5te_unknown_linux_uclibceabi::target(),
            "armv7-unknown-linux-gnueabi" =>
                targets::armv7_unknown_linux_gnueabi::target(),
            "armv7-unknown-linux-gnueabihf" =>
                targets::armv7_unknown_linux_gnueabihf::target(),
            "thumbv7neon-unknown-linux-gnueabihf" =>
                targets::thumbv7neon_unknown_linux_gnueabihf::target(),
            "thumbv7neon-unknown-linux-musleabihf" =>
                targets::thumbv7neon_unknown_linux_musleabihf::target(),
            "armv7-unknown-linux-musleabi" =>
                targets::armv7_unknown_linux_musleabi::target(),
            "armv7-unknown-linux-musleabihf" =>
                targets::armv7_unknown_linux_musleabihf::target(),
            "aarch64-unknown-linux-gnu" =>
                targets::aarch64_unknown_linux_gnu::target(),
            "aarch64-unknown-linux-musl" =>
                targets::aarch64_unknown_linux_musl::target(),
            "aarch64-unknown-linux-pauthtest" =>
                targets::aarch64_unknown_linux_pauthtest::target(),
            "aarch64_be-unknown-linux-musl" =>
                targets::aarch64_be_unknown_linux_musl::target(),
            "x86_64-unknown-linux-musl" =>
                targets::x86_64_unknown_linux_musl::target(),
            "i686-unknown-linux-musl" =>
                targets::i686_unknown_linux_musl::target(),
            "i586-unknown-linux-musl" =>
                targets::i586_unknown_linux_musl::target(),
            "mips-unknown-linux-musl" =>
                targets::mips_unknown_linux_musl::target(),
            "mipsel-unknown-linux-musl" =>
                targets::mipsel_unknown_linux_musl::target(),
            "mips64-unknown-linux-muslabi64" =>
                targets::mips64_unknown_linux_muslabi64::target(),
            "mips64el-unknown-linux-muslabi64" =>
                targets::mips64el_unknown_linux_muslabi64::target(),
            "hexagon-unknown-linux-musl" =>
                targets::hexagon_unknown_linux_musl::target(),
            "hexagon-unknown-none-elf" =>
                targets::hexagon_unknown_none_elf::target(),
            "hexagon-unknown-qurt" => targets::hexagon_unknown_qurt::target(),
            "mips-unknown-linux-uclibc" =>
                targets::mips_unknown_linux_uclibc::target(),
            "mipsel-unknown-linux-uclibc" =>
                targets::mipsel_unknown_linux_uclibc::target(),
            "i686-linux-android" => targets::i686_linux_android::target(),
            "x86_64-linux-android" => targets::x86_64_linux_android::target(),
            "arm-linux-androideabi" =>
                targets::arm_linux_androideabi::target(),
            "armv7-linux-androideabi" =>
                targets::armv7_linux_androideabi::target(),
            "thumbv7neon-linux-androideabi" =>
                targets::thumbv7neon_linux_androideabi::target(),
            "aarch64-linux-android" =>
                targets::aarch64_linux_android::target(),
            "riscv64-linux-android" =>
                targets::riscv64_linux_android::target(),
            "aarch64-unknown-freebsd" =>
                targets::aarch64_unknown_freebsd::target(),
            "armv6-unknown-freebsd" =>
                targets::armv6_unknown_freebsd::target(),
            "armv7-unknown-freebsd" =>
                targets::armv7_unknown_freebsd::target(),
            "i686-unknown-freebsd" => targets::i686_unknown_freebsd::target(),
            "powerpc-unknown-freebsd" =>
                targets::powerpc_unknown_freebsd::target(),
            "powerpc64-unknown-freebsd" =>
                targets::powerpc64_unknown_freebsd::target(),
            "powerpc64le-unknown-freebsd" =>
                targets::powerpc64le_unknown_freebsd::target(),
            "riscv64gc-unknown-freebsd" =>
                targets::riscv64gc_unknown_freebsd::target(),
            "x86_64-unknown-freebsd" =>
                targets::x86_64_unknown_freebsd::target(),
            "x86_64-unknown-dragonfly" =>
                targets::x86_64_unknown_dragonfly::target(),
            "aarch64-unknown-openbsd" =>
                targets::aarch64_unknown_openbsd::target(),
            "i686-unknown-openbsd" => targets::i686_unknown_openbsd::target(),
            "powerpc-unknown-openbsd" =>
                targets::powerpc_unknown_openbsd::target(),
            "powerpc64-unknown-openbsd" =>
                targets::powerpc64_unknown_openbsd::target(),
            "riscv64gc-unknown-openbsd" =>
                targets::riscv64gc_unknown_openbsd::target(),
            "sparc64-unknown-openbsd" =>
                targets::sparc64_unknown_openbsd::target(),
            "x86_64-unknown-openbsd" =>
                targets::x86_64_unknown_openbsd::target(),
            "aarch64-unknown-netbsd" =>
                targets::aarch64_unknown_netbsd::target(),
            "aarch64_be-unknown-netbsd" =>
                targets::aarch64_be_unknown_netbsd::target(),
            "armv6-unknown-netbsd-eabihf" =>
                targets::armv6_unknown_netbsd_eabihf::target(),
            "armv7-unknown-netbsd-eabihf" =>
                targets::armv7_unknown_netbsd_eabihf::target(),
            "i586-unknown-netbsd" => targets::i586_unknown_netbsd::target(),
            "i686-unknown-netbsd" => targets::i686_unknown_netbsd::target(),
            "mipsel-unknown-netbsd" =>
                targets::mipsel_unknown_netbsd::target(),
            "powerpc-unknown-netbsd" =>
                targets::powerpc_unknown_netbsd::target(),
            "riscv64gc-unknown-netbsd" =>
                targets::riscv64gc_unknown_netbsd::target(),
            "sparc64-unknown-netbsd" =>
                targets::sparc64_unknown_netbsd::target(),
            "x86_64-unknown-netbsd" =>
                targets::x86_64_unknown_netbsd::target(),
            "i686-unknown-haiku" => targets::i686_unknown_haiku::target(),
            "x86_64-unknown-haiku" => targets::x86_64_unknown_haiku::target(),
            "aarch64-unknown-helenos" =>
                targets::aarch64_unknown_helenos::target(),
            "i686-unknown-helenos" => targets::i686_unknown_helenos::target(),
            "powerpc-unknown-helenos" =>
                targets::powerpc_unknown_helenos::target(),
            "sparc64-unknown-helenos" =>
                targets::sparc64_unknown_helenos::target(),
            "x86_64-unknown-helenos" =>
                targets::x86_64_unknown_helenos::target(),
            "i686-unknown-hurd-gnu" =>
                targets::i686_unknown_hurd_gnu::target(),
            "x86_64-unknown-hurd-gnu" =>
                targets::x86_64_unknown_hurd_gnu::target(),
            "aarch64-apple-darwin" => targets::aarch64_apple_darwin::target(),
            "arm64e-apple-darwin" => targets::arm64e_apple_darwin::target(),
            "x86_64-apple-darwin" => targets::x86_64_apple_darwin::target(),
            "x86_64h-apple-darwin" => targets::x86_64h_apple_darwin::target(),
            "i686-apple-darwin" => targets::i686_apple_darwin::target(),
            "aarch64-unknown-fuchsia" =>
                targets::aarch64_unknown_fuchsia::target(),
            "riscv64gc-unknown-fuchsia" =>
                targets::riscv64gc_unknown_fuchsia::target(),
            "x86_64-unknown-fuchsia" =>
                targets::x86_64_unknown_fuchsia::target(),
            "avr-none" => targets::avr_none::target(),
            "x86_64-unknown-l4re-uclibc" =>
                targets::x86_64_unknown_l4re_uclibc::target(),
            "aarch64-unknown-redox" =>
                targets::aarch64_unknown_redox::target(),
            "i586-unknown-redox" => targets::i586_unknown_redox::target(),
            "riscv64gc-unknown-redox" =>
                targets::riscv64gc_unknown_redox::target(),
            "x86_64-unknown-redox" => targets::x86_64_unknown_redox::target(),
            "x86_64-unknown-managarm-mlibc" =>
                targets::x86_64_unknown_managarm_mlibc::target(),
            "aarch64-unknown-managarm-mlibc" =>
                targets::aarch64_unknown_managarm_mlibc::target(),
            "riscv64gc-unknown-managarm-mlibc" =>
                targets::riscv64gc_unknown_managarm_mlibc::target(),
            "i386-apple-ios" => targets::i386_apple_ios::target(),
            "x86_64-apple-ios" => targets::x86_64_apple_ios::target(),
            "aarch64-apple-ios" => targets::aarch64_apple_ios::target(),
            "arm64e-apple-ios" => targets::arm64e_apple_ios::target(),
            "armv7s-apple-ios" => targets::armv7s_apple_ios::target(),
            "x86_64-apple-ios-macabi" =>
                targets::x86_64_apple_ios_macabi::target(),
            "aarch64-apple-ios-macabi" =>
                targets::aarch64_apple_ios_macabi::target(),
            "aarch64-apple-ios-sim" =>
                targets::aarch64_apple_ios_sim::target(),
            "aarch64-apple-tvos" => targets::aarch64_apple_tvos::target(),
            "aarch64-apple-tvos-sim" =>
                targets::aarch64_apple_tvos_sim::target(),
            "arm64e-apple-tvos" => targets::arm64e_apple_tvos::target(),
            "x86_64-apple-tvos" => targets::x86_64_apple_tvos::target(),
            "armv7k-apple-watchos" => targets::armv7k_apple_watchos::target(),
            "arm64_32-apple-watchos" =>
                targets::arm64_32_apple_watchos::target(),
            "x86_64-apple-watchos-sim" =>
                targets::x86_64_apple_watchos_sim::target(),
            "aarch64-apple-watchos" =>
                targets::aarch64_apple_watchos::target(),
            "aarch64-apple-watchos-sim" =>
                targets::aarch64_apple_watchos_sim::target(),
            "aarch64-apple-visionos" =>
                targets::aarch64_apple_visionos::target(),
            "aarch64-apple-visionos-sim" =>
                targets::aarch64_apple_visionos_sim::target(),
            "armebv7r-none-eabi" => targets::armebv7r_none_eabi::target(),
            "armebv7r-none-eabihf" => targets::armebv7r_none_eabihf::target(),
            "armv7r-none-eabi" => targets::armv7r_none_eabi::target(),
            "thumbv7r-none-eabi" => targets::thumbv7r_none_eabi::target(),
            "armv7r-none-eabihf" => targets::armv7r_none_eabihf::target(),
            "thumbv7r-none-eabihf" => targets::thumbv7r_none_eabihf::target(),
            "armv8r-none-eabihf" => targets::armv8r_none_eabihf::target(),
            "thumbv8r-none-eabihf" => targets::thumbv8r_none_eabihf::target(),
            "armv7-rtems-eabihf" => targets::armv7_rtems_eabihf::target(),
            "x86_64-pc-solaris" => targets::x86_64_pc_solaris::target(),
            "sparcv9-sun-solaris" => targets::sparcv9_sun_solaris::target(),
            "x86_64-unknown-illumos" =>
                targets::x86_64_unknown_illumos::target(),
            "aarch64-unknown-illumos" =>
                targets::aarch64_unknown_illumos::target(),
            "x86_64-pc-windows-gnu" =>
                targets::x86_64_pc_windows_gnu::target(),
            "x86_64-uwp-windows-gnu" =>
                targets::x86_64_uwp_windows_gnu::target(),
            "x86_64-win7-windows-gnu" =>
                targets::x86_64_win7_windows_gnu::target(),
            "i686-pc-windows-gnu" => targets::i686_pc_windows_gnu::target(),
            "i686-uwp-windows-gnu" => targets::i686_uwp_windows_gnu::target(),
            "i686-win7-windows-gnu" =>
                targets::i686_win7_windows_gnu::target(),
            "aarch64-pc-windows-gnullvm" =>
                targets::aarch64_pc_windows_gnullvm::target(),
            "i686-pc-windows-gnullvm" =>
                targets::i686_pc_windows_gnullvm::target(),
            "x86_64-pc-windows-gnullvm" =>
                targets::x86_64_pc_windows_gnullvm::target(),
            "aarch64-pc-windows-msvc" =>
                targets::aarch64_pc_windows_msvc::target(),
            "aarch64-uwp-windows-msvc" =>
                targets::aarch64_uwp_windows_msvc::target(),
            "arm64ec-pc-windows-msvc" =>
                targets::arm64ec_pc_windows_msvc::target(),
            "x86_64-pc-windows-msvc" =>
                targets::x86_64_pc_windows_msvc::target(),
            "x86_64-uwp-windows-msvc" =>
                targets::x86_64_uwp_windows_msvc::target(),
            "x86_64-win7-windows-msvc" =>
                targets::x86_64_win7_windows_msvc::target(),
            "i686-pc-windows-msvc" => targets::i686_pc_windows_msvc::target(),
            "i686-uwp-windows-msvc" =>
                targets::i686_uwp_windows_msvc::target(),
            "i686-win7-windows-msvc" =>
                targets::i686_win7_windows_msvc::target(),
            "thumbv7a-pc-windows-msvc" =>
                targets::thumbv7a_pc_windows_msvc::target(),
            "thumbv7a-uwp-windows-msvc" =>
                targets::thumbv7a_uwp_windows_msvc::target(),
            "wasm32-unknown-emscripten" =>
                targets::wasm32_unknown_emscripten::target(),
            "wasm32-unknown-unknown" =>
                targets::wasm32_unknown_unknown::target(),
            "wasm32v1-none" => targets::wasm32v1_none::target(),
            "wasm32-wasip1" => targets::wasm32_wasip1::target(),
            "wasm32-wasip2" => targets::wasm32_wasip2::target(),
            "wasm32-wasip3" => targets::wasm32_wasip3::target(),
            "wasm32-wasip1-threads" =>
                targets::wasm32_wasip1_threads::target(),
            "wasm32-wali-linux-musl" =>
                targets::wasm32_wali_linux_musl::target(),
            "wasm64-unknown-unknown" =>
                targets::wasm64_unknown_unknown::target(),
            "thumbv6m-none-eabi" => targets::thumbv6m_none_eabi::target(),
            "thumbv7m-none-eabi" => targets::thumbv7m_none_eabi::target(),
            "thumbv7em-none-eabi" => targets::thumbv7em_none_eabi::target(),
            "thumbv7em-none-eabihf" =>
                targets::thumbv7em_none_eabihf::target(),
            "thumbv8m.base-none-eabi" =>
                targets::thumbv8m_base_none_eabi::target(),
            "thumbv8m.main-none-eabi" =>
                targets::thumbv8m_main_none_eabi::target(),
            "thumbv8m.main-none-eabihf" =>
                targets::thumbv8m_main_none_eabihf::target(),
            "armv7a-none-eabi" => targets::armv7a_none_eabi::target(),
            "thumbv7a-none-eabi" => targets::thumbv7a_none_eabi::target(),
            "armv7a-none-eabihf" => targets::armv7a_none_eabihf::target(),
            "thumbv7a-none-eabihf" => targets::thumbv7a_none_eabihf::target(),
            "armv7a-nuttx-eabi" => targets::armv7a_nuttx_eabi::target(),
            "armv7a-nuttx-eabihf" => targets::armv7a_nuttx_eabihf::target(),
            "armv7a-vex-v5" => targets::armv7a_vex_v5::target(),
            "msp430-none-elf" => targets::msp430_none_elf::target(),
            "aarch64_be-unknown-hermit" =>
                targets::aarch64_be_unknown_hermit::target(),
            "aarch64-unknown-hermit" =>
                targets::aarch64_unknown_hermit::target(),
            "riscv64gc-unknown-hermit" =>
                targets::riscv64gc_unknown_hermit::target(),
            "x86_64-unknown-hermit" =>
                targets::x86_64_unknown_hermit::target(),
            "x86_64-unknown-motor" => targets::x86_64_unknown_motor::target(),
            "x86_64-unikraft-linux-musl" =>
                targets::x86_64_unikraft_linux_musl::target(),
            "armv7-unknown-trusty" => targets::armv7_unknown_trusty::target(),
            "aarch64-unknown-trusty" =>
                targets::aarch64_unknown_trusty::target(),
            "x86_64-unknown-trusty" =>
                targets::x86_64_unknown_trusty::target(),
            "riscv32i-unknown-none-elf" =>
                targets::riscv32i_unknown_none_elf::target(),
            "riscv32im-risc0-zkvm-elf" =>
                targets::riscv32im_risc0_zkvm_elf::target(),
            "riscv32im-unknown-none-elf" =>
                targets::riscv32im_unknown_none_elf::target(),
            "riscv32ima-unknown-none-elf" =>
                targets::riscv32ima_unknown_none_elf::target(),
            "riscv32imc-unknown-none-elf" =>
                targets::riscv32imc_unknown_none_elf::target(),
            "riscv32imfc-unknown-none-elf" =>
                targets::riscv32imfc_unknown_none_elf::target(),
            "riscv32imc-esp-espidf" =>
                targets::riscv32imc_esp_espidf::target(),
            "riscv32imac-esp-espidf" =>
                targets::riscv32imac_esp_espidf::target(),
            "riscv32imafc-esp-espidf" =>
                targets::riscv32imafc_esp_espidf::target(),
            "riscv32e-unknown-none-elf" =>
                targets::riscv32e_unknown_none_elf::target(),
            "riscv32em-unknown-none-elf" =>
                targets::riscv32em_unknown_none_elf::target(),
            "riscv32emc-unknown-none-elf" =>
                targets::riscv32emc_unknown_none_elf::target(),
            "riscv32imac-unknown-none-elf" =>
                targets::riscv32imac_unknown_none_elf::target(),
            "riscv32imafc-unknown-none-elf" =>
                targets::riscv32imafc_unknown_none_elf::target(),
            "riscv32imac-unknown-xous-elf" =>
                targets::riscv32imac_unknown_xous_elf::target(),
            "riscv32gc-unknown-linux-gnu" =>
                targets::riscv32gc_unknown_linux_gnu::target(),
            "riscv32gc-unknown-linux-musl" =>
                targets::riscv32gc_unknown_linux_musl::target(),
            "riscv64im-unknown-none-elf" =>
                targets::riscv64im_unknown_none_elf::target(),
            "riscv64imac-unknown-none-elf" =>
                targets::riscv64imac_unknown_none_elf::target(),
            "riscv64gc-unknown-none-elf" =>
                targets::riscv64gc_unknown_none_elf::target(),
            "riscv64gc-unknown-linux-gnu" =>
                targets::riscv64gc_unknown_linux_gnu::target(),
            "riscv64gc-unknown-linux-musl" =>
                targets::riscv64gc_unknown_linux_musl::target(),
            "riscv64a23-unknown-linux-gnu" =>
                targets::riscv64a23_unknown_linux_gnu::target(),
            "sparc-unknown-none-elf" =>
                targets::sparc_unknown_none_elf::target(),
            "loongarch32-unknown-none" =>
                targets::loongarch32_unknown_none::target(),
            "loongarch32-unknown-none-softfloat" =>
                targets::loongarch32_unknown_none_softfloat::target(),
            "loongarch64-unknown-none" =>
                targets::loongarch64_unknown_none::target(),
            "loongarch64-unknown-none-softfloat" =>
                targets::loongarch64_unknown_none_softfloat::target(),
            "aarch64-unknown-none" => targets::aarch64_unknown_none::target(),
            "aarch64-unknown-none-softfloat" =>
                targets::aarch64_unknown_none_softfloat::target(),
            "aarch64_be-unknown-none-softfloat" =>
                targets::aarch64_be_unknown_none_softfloat::target(),
            "aarch64-unknown-nuttx" =>
                targets::aarch64_unknown_nuttx::target(),
            "aarch64v8r-unknown-none" =>
                targets::aarch64v8r_unknown_none::target(),
            "aarch64v8r-unknown-none-softfloat" =>
                targets::aarch64v8r_unknown_none_softfloat::target(),
            "x86_64-fortanix-unknown-sgx" =>
                targets::x86_64_fortanix_unknown_sgx::target(),
            "x86_64-unknown-uefi" => targets::x86_64_unknown_uefi::target(),
            "i686-unknown-uefi" => targets::i686_unknown_uefi::target(),
            "aarch64-unknown-uefi" => targets::aarch64_unknown_uefi::target(),
            "nvptx64-nvidia-cuda" => targets::nvptx64_nvidia_cuda::target(),
            "amdgcn-amd-amdhsa" => targets::amdgcn_amd_amdhsa::target(),
            "xtensa-esp32-none-elf" =>
                targets::xtensa_esp32_none_elf::target(),
            "xtensa-esp32-espidf" => targets::xtensa_esp32_espidf::target(),
            "xtensa-esp32s2-none-elf" =>
                targets::xtensa_esp32s2_none_elf::target(),
            "xtensa-esp32s2-espidf" =>
                targets::xtensa_esp32s2_espidf::target(),
            "xtensa-esp32s3-none-elf" =>
                targets::xtensa_esp32s3_none_elf::target(),
            "xtensa-esp32s3-espidf" =>
                targets::xtensa_esp32s3_espidf::target(),
            "i686-wrs-vxworks" => targets::i686_wrs_vxworks::target(),
            "x86_64-wrs-vxworks" => targets::x86_64_wrs_vxworks::target(),
            "armv7-wrs-vxworks-eabihf" =>
                targets::armv7_wrs_vxworks_eabihf::target(),
            "aarch64-wrs-vxworks" => targets::aarch64_wrs_vxworks::target(),
            "powerpc-wrs-vxworks" => targets::powerpc_wrs_vxworks::target(),
            "powerpc-wrs-vxworks-spe" =>
                targets::powerpc_wrs_vxworks_spe::target(),
            "powerpc64-wrs-vxworks" =>
                targets::powerpc64_wrs_vxworks::target(),
            "riscv32-wrs-vxworks" => targets::riscv32_wrs_vxworks::target(),
            "riscv64-wrs-vxworks" => targets::riscv64_wrs_vxworks::target(),
            "aarch64-kmc-solid_asp3" =>
                targets::aarch64_kmc_solid_asp3::target(),
            "armv7a-kmc-solid_asp3-eabi" =>
                targets::armv7a_kmc_solid_asp3_eabi::target(),
            "armv7a-kmc-solid_asp3-eabihf" =>
                targets::armv7a_kmc_solid_asp3_eabihf::target(),
            "mipsel-sony-psp" => targets::mipsel_sony_psp::target(),
            "mipsel-sony-psx" => targets::mipsel_sony_psx::target(),
            "mipsel-unknown-none" => targets::mipsel_unknown_none::target(),
            "mips-mti-none-elf" => targets::mips_mti_none_elf::target(),
            "mipsel-mti-none-elf" => targets::mipsel_mti_none_elf::target(),
            "armv4t-none-eabi" => targets::armv4t_none_eabi::target(),
            "armv5te-none-eabi" => targets::armv5te_none_eabi::target(),
            "armv6-none-eabi" => targets::armv6_none_eabi::target(),
            "armv6-none-eabihf" => targets::armv6_none_eabihf::target(),
            "thumbv4t-none-eabi" => targets::thumbv4t_none_eabi::target(),
            "thumbv5te-none-eabi" => targets::thumbv5te_none_eabi::target(),
            "thumbv6-none-eabi" => targets::thumbv6_none_eabi::target(),
            "aarch64_be-unknown-linux-gnu" =>
                targets::aarch64_be_unknown_linux_gnu::target(),
            "aarch64-unknown-linux-gnu_ilp32" =>
                targets::aarch64_unknown_linux_gnu_ilp32::target(),
            "aarch64_be-unknown-linux-gnu_ilp32" =>
                targets::aarch64_be_unknown_linux_gnu_ilp32::target(),
            "bpfeb-unknown-none" => targets::bpfeb_unknown_none::target(),
            "bpfel-unknown-none" => targets::bpfel_unknown_none::target(),
            "armv6k-nintendo-3ds" => targets::armv6k_nintendo_3ds::target(),
            "aarch64-nintendo-switch-freestanding" =>
                targets::aarch64_nintendo_switch_freestanding::target(),
            "armv7-sony-vita-newlibeabihf" =>
                targets::armv7_sony_vita_newlibeabihf::target(),
            "armv7-unknown-linux-uclibceabi" =>
                targets::armv7_unknown_linux_uclibceabi::target(),
            "armv7-unknown-linux-uclibceabihf" =>
                targets::armv7_unknown_linux_uclibceabihf::target(),
            "x86_64-unknown-none" => targets::x86_64_unknown_none::target(),
            "aarch64-unknown-teeos" =>
                targets::aarch64_unknown_teeos::target(),
            "mips64-openwrt-linux-musl" =>
                targets::mips64_openwrt_linux_musl::target(),
            "aarch64-unknown-nto-qnx700" =>
                targets::aarch64_unknown_nto_qnx700::target(),
            "aarch64-unknown-nto-qnx710" =>
                targets::aarch64_unknown_nto_qnx710::target(),
            "aarch64-unknown-nto-qnx710_iosock" =>
                targets::aarch64_unknown_nto_qnx710_iosock::target(),
            "aarch64-unknown-qnx" => targets::aarch64_unknown_qnx::target(),
            "x86_64-pc-nto-qnx710" => targets::x86_64_pc_nto_qnx710::target(),
            "x86_64-pc-nto-qnx710_iosock" =>
                targets::x86_64_pc_nto_qnx710_iosock::target(),
            "x86_64-pc-qnx" => targets::x86_64_pc_qnx::target(),
            "i686-pc-nto-qnx700" => targets::i686_pc_nto_qnx700::target(),
            "aarch64-unknown-linux-ohos" =>
                targets::aarch64_unknown_linux_ohos::target(),
            "armv7-unknown-linux-ohos" =>
                targets::armv7_unknown_linux_ohos::target(),
            "loongarch64-unknown-linux-ohos" =>
                targets::loongarch64_unknown_linux_ohos::target(),
            "x86_64-unknown-linux-ohos" =>
                targets::x86_64_unknown_linux_ohos::target(),
            "x86_64-unknown-linux-none" =>
                targets::x86_64_unknown_linux_none::target(),
            "thumbv6m-nuttx-eabi" => targets::thumbv6m_nuttx_eabi::target(),
            "thumbv7a-nuttx-eabi" => targets::thumbv7a_nuttx_eabi::target(),
            "thumbv7a-nuttx-eabihf" =>
                targets::thumbv7a_nuttx_eabihf::target(),
            "thumbv7m-nuttx-eabi" => targets::thumbv7m_nuttx_eabi::target(),
            "thumbv7em-nuttx-eabi" => targets::thumbv7em_nuttx_eabi::target(),
            "thumbv7em-nuttx-eabihf" =>
                targets::thumbv7em_nuttx_eabihf::target(),
            "thumbv8m.base-nuttx-eabi" =>
                targets::thumbv8m_base_nuttx_eabi::target(),
            "thumbv8m.main-nuttx-eabi" =>
                targets::thumbv8m_main_nuttx_eabi::target(),
            "thumbv8m.main-nuttx-eabihf" =>
                targets::thumbv8m_main_nuttx_eabihf::target(),
            "riscv32imc-unknown-nuttx-elf" =>
                targets::riscv32imc_unknown_nuttx_elf::target(),
            "riscv32imac-unknown-nuttx-elf" =>
                targets::riscv32imac_unknown_nuttx_elf::target(),
            "riscv32imafc-unknown-nuttx-elf" =>
                targets::riscv32imafc_unknown_nuttx_elf::target(),
            "riscv64imac-unknown-nuttx-elf" =>
                targets::riscv64imac_unknown_nuttx_elf::target(),
            "riscv64gc-unknown-nuttx-elf" =>
                targets::riscv64gc_unknown_nuttx_elf::target(),
            "x86_64-lynx-lynxos178" =>
                targets::x86_64_lynx_lynxos178::target(),
            "x86_64-pc-cygwin" => targets::x86_64_pc_cygwin::target(),
            "x86_64-unknown-linux-gnuasan" =>
                targets::x86_64_unknown_linux_gnuasan::target(),
            "x86_64-unknown-linux-gnumsan" =>
                targets::x86_64_unknown_linux_gnumsan::target(),
            "x86_64-unknown-linux-gnutsan" =>
                targets::x86_64_unknown_linux_gnutsan::target(),
            "aarch64-oe-linux-gnu" => targets::aarch64_oe_linux_gnu::target(),
            "armv7-oe-linux-gnueabihf" =>
                targets::armv7_oe_linux_gnueabihf::target(),
            "i686-oe-linux-gnu" => targets::i686_oe_linux_gnu::target(),
            "riscv64-oe-linux-gnu" => targets::riscv64_oe_linux_gnu::target(),
            "x86_64-oe-linux-gnu" => targets::x86_64_oe_linux_gnu::target(),
            _ => return None,
        };
    {
        use ::tracing::__macro_support::Callsite as _;
        static __CALLSITE: ::tracing::callsite::DefaultCallsite =
            {
                static META: ::tracing::Metadata<'static> =
                    {
                        ::tracing_core::metadata::Metadata::new("event compiler/rustc_target/src/spec/mod.rs:1441",
                            "rustc_target::spec", ::tracing::Level::DEBUG,
                            ::tracing_core::__macro_support::Option::Some("compiler/rustc_target/src/spec/mod.rs"),
                            ::tracing_core::__macro_support::Option::Some(1441u32),
                            ::tracing_core::__macro_support::Option::Some("rustc_target::spec"),
                            ::tracing_core::field::FieldSet::new(&["message"],
                                ::tracing_core::callsite::Identifier(&__CALLSITE)),
                            ::tracing::metadata::Kind::EVENT)
                    };
                ::tracing::callsite::DefaultCallsite::new(&META)
            };
        let enabled =
            ::tracing::Level::DEBUG <=
                        ::tracing::level_filters::STATIC_MAX_LEVEL &&
                    ::tracing::Level::DEBUG <=
                        ::tracing::level_filters::LevelFilter::current() &&
                {
                    let interest = __CALLSITE.interest();
                    !interest.is_never() &&
                        ::tracing::__macro_support::__is_enabled(__CALLSITE.metadata(),
                            interest)
                };
        if enabled {
            (|value_set: ::tracing::field::ValueSet|
                        {
                            let meta = __CALLSITE.metadata();
                            ::tracing::Event::dispatch(meta, &value_set);
                            ;
                        })({
                    #[allow(unused_imports)]
                    use ::tracing::field::{debug, display, Value};
                    __CALLSITE.metadata().fields().value_set_all(&[(::tracing::__macro_support::Option::Some(&format_args!("got builtin target: {0:?}",
                                                        t) as &dyn ::tracing::field::Value))])
                });
        } else { ; }
    };
    Some(t)
}
fn load_all_builtins() -> impl Iterator<Item = Target> {
    [targets::x86_64_unknown_linux_gnu::target,
                    targets::x86_64_unknown_linux_gnux32::target,
                    targets::i686_unknown_linux_gnu::target,
                    targets::i586_unknown_linux_gnu::target,
                    targets::loongarch64_unknown_linux_gnu::target,
                    targets::loongarch64_unknown_linux_musl::target,
                    targets::m68k_unknown_linux_gnu::target,
                    targets::m68k_unknown_none_elf::target,
                    targets::csky_unknown_linux_gnuabiv2::target,
                    targets::csky_unknown_linux_gnuabiv2hf::target,
                    targets::mips_unknown_linux_gnu::target,
                    targets::mips64_unknown_linux_gnuabi64::target,
                    targets::mips64el_unknown_linux_gnuabi64::target,
                    targets::mipsisa32r6_unknown_linux_gnu::target,
                    targets::mipsisa32r6el_unknown_linux_gnu::target,
                    targets::mipsisa64r6_unknown_linux_gnuabi64::target,
                    targets::mipsisa64r6el_unknown_linux_gnuabi64::target,
                    targets::mipsel_unknown_linux_gnu::target,
                    targets::powerpc_unknown_linux_gnu::target,
                    targets::powerpc_unknown_linux_gnuspe::target,
                    targets::powerpc_unknown_linux_musl::target,
                    targets::powerpc_unknown_linux_muslspe::target,
                    targets::powerpc64_ibm_aix::target,
                    targets::powerpc64_unknown_linux_gnu::target,
                    targets::powerpc64_unknown_linux_gnuelfv2::target,
                    targets::powerpc64_unknown_linux_musl::target,
                    targets::powerpc64le_unknown_linux_gnu::target,
                    targets::powerpc64le_unknown_linux_musl::target,
                    targets::s390x_unknown_linux_gnu::target,
                    targets::s390x_unknown_none_softfloat::target,
                    targets::s390x_unknown_linux_musl::target,
                    targets::sparc_unknown_linux_gnu::target,
                    targets::sparc64_unknown_linux_gnu::target,
                    targets::arm_unknown_linux_gnueabi::target,
                    targets::arm_unknown_linux_gnueabihf::target,
                    targets::armeb_unknown_linux_gnueabi::target,
                    targets::arm_unknown_linux_musleabi::target,
                    targets::arm_unknown_linux_musleabihf::target,
                    targets::armv4t_unknown_linux_gnueabi::target,
                    targets::armv5te_unknown_linux_gnueabi::target,
                    targets::armv5te_unknown_linux_musleabi::target,
                    targets::armv5te_unknown_linux_uclibceabi::target,
                    targets::armv7_unknown_linux_gnueabi::target,
                    targets::armv7_unknown_linux_gnueabihf::target,
                    targets::thumbv7neon_unknown_linux_gnueabihf::target,
                    targets::thumbv7neon_unknown_linux_musleabihf::target,
                    targets::armv7_unknown_linux_musleabi::target,
                    targets::armv7_unknown_linux_musleabihf::target,
                    targets::aarch64_unknown_linux_gnu::target,
                    targets::aarch64_unknown_linux_musl::target,
                    targets::aarch64_unknown_linux_pauthtest::target,
                    targets::aarch64_be_unknown_linux_musl::target,
                    targets::x86_64_unknown_linux_musl::target,
                    targets::i686_unknown_linux_musl::target,
                    targets::i586_unknown_linux_musl::target,
                    targets::mips_unknown_linux_musl::target,
                    targets::mipsel_unknown_linux_musl::target,
                    targets::mips64_unknown_linux_muslabi64::target,
                    targets::mips64el_unknown_linux_muslabi64::target,
                    targets::hexagon_unknown_linux_musl::target,
                    targets::hexagon_unknown_none_elf::target,
                    targets::hexagon_unknown_qurt::target,
                    targets::mips_unknown_linux_uclibc::target,
                    targets::mipsel_unknown_linux_uclibc::target,
                    targets::i686_linux_android::target,
                    targets::x86_64_linux_android::target,
                    targets::arm_linux_androideabi::target,
                    targets::armv7_linux_androideabi::target,
                    targets::thumbv7neon_linux_androideabi::target,
                    targets::aarch64_linux_android::target,
                    targets::riscv64_linux_android::target,
                    targets::aarch64_unknown_freebsd::target,
                    targets::armv6_unknown_freebsd::target,
                    targets::armv7_unknown_freebsd::target,
                    targets::i686_unknown_freebsd::target,
                    targets::powerpc_unknown_freebsd::target,
                    targets::powerpc64_unknown_freebsd::target,
                    targets::powerpc64le_unknown_freebsd::target,
                    targets::riscv64gc_unknown_freebsd::target,
                    targets::x86_64_unknown_freebsd::target,
                    targets::x86_64_unknown_dragonfly::target,
                    targets::aarch64_unknown_openbsd::target,
                    targets::i686_unknown_openbsd::target,
                    targets::powerpc_unknown_openbsd::target,
                    targets::powerpc64_unknown_openbsd::target,
                    targets::riscv64gc_unknown_openbsd::target,
                    targets::sparc64_unknown_openbsd::target,
                    targets::x86_64_unknown_openbsd::target,
                    targets::aarch64_unknown_netbsd::target,
                    targets::aarch64_be_unknown_netbsd::target,
                    targets::armv6_unknown_netbsd_eabihf::target,
                    targets::armv7_unknown_netbsd_eabihf::target,
                    targets::i586_unknown_netbsd::target,
                    targets::i686_unknown_netbsd::target,
                    targets::mipsel_unknown_netbsd::target,
                    targets::powerpc_unknown_netbsd::target,
                    targets::riscv64gc_unknown_netbsd::target,
                    targets::sparc64_unknown_netbsd::target,
                    targets::x86_64_unknown_netbsd::target,
                    targets::i686_unknown_haiku::target,
                    targets::x86_64_unknown_haiku::target,
                    targets::aarch64_unknown_helenos::target,
                    targets::i686_unknown_helenos::target,
                    targets::powerpc_unknown_helenos::target,
                    targets::sparc64_unknown_helenos::target,
                    targets::x86_64_unknown_helenos::target,
                    targets::i686_unknown_hurd_gnu::target,
                    targets::x86_64_unknown_hurd_gnu::target,
                    targets::aarch64_apple_darwin::target,
                    targets::arm64e_apple_darwin::target,
                    targets::x86_64_apple_darwin::target,
                    targets::x86_64h_apple_darwin::target,
                    targets::i686_apple_darwin::target,
                    targets::aarch64_unknown_fuchsia::target,
                    targets::riscv64gc_unknown_fuchsia::target,
                    targets::x86_64_unknown_fuchsia::target,
                    targets::avr_none::target,
                    targets::x86_64_unknown_l4re_uclibc::target,
                    targets::aarch64_unknown_redox::target,
                    targets::i586_unknown_redox::target,
                    targets::riscv64gc_unknown_redox::target,
                    targets::x86_64_unknown_redox::target,
                    targets::x86_64_unknown_managarm_mlibc::target,
                    targets::aarch64_unknown_managarm_mlibc::target,
                    targets::riscv64gc_unknown_managarm_mlibc::target,
                    targets::i386_apple_ios::target,
                    targets::x86_64_apple_ios::target,
                    targets::aarch64_apple_ios::target,
                    targets::arm64e_apple_ios::target,
                    targets::armv7s_apple_ios::target,
                    targets::x86_64_apple_ios_macabi::target,
                    targets::aarch64_apple_ios_macabi::target,
                    targets::aarch64_apple_ios_sim::target,
                    targets::aarch64_apple_tvos::target,
                    targets::aarch64_apple_tvos_sim::target,
                    targets::arm64e_apple_tvos::target,
                    targets::x86_64_apple_tvos::target,
                    targets::armv7k_apple_watchos::target,
                    targets::arm64_32_apple_watchos::target,
                    targets::x86_64_apple_watchos_sim::target,
                    targets::aarch64_apple_watchos::target,
                    targets::aarch64_apple_watchos_sim::target,
                    targets::aarch64_apple_visionos::target,
                    targets::aarch64_apple_visionos_sim::target,
                    targets::armebv7r_none_eabi::target,
                    targets::armebv7r_none_eabihf::target,
                    targets::armv7r_none_eabi::target,
                    targets::thumbv7r_none_eabi::target,
                    targets::armv7r_none_eabihf::target,
                    targets::thumbv7r_none_eabihf::target,
                    targets::armv8r_none_eabihf::target,
                    targets::thumbv8r_none_eabihf::target,
                    targets::armv7_rtems_eabihf::target,
                    targets::x86_64_pc_solaris::target,
                    targets::sparcv9_sun_solaris::target,
                    targets::x86_64_unknown_illumos::target,
                    targets::aarch64_unknown_illumos::target,
                    targets::x86_64_pc_windows_gnu::target,
                    targets::x86_64_uwp_windows_gnu::target,
                    targets::x86_64_win7_windows_gnu::target,
                    targets::i686_pc_windows_gnu::target,
                    targets::i686_uwp_windows_gnu::target,
                    targets::i686_win7_windows_gnu::target,
                    targets::aarch64_pc_windows_gnullvm::target,
                    targets::i686_pc_windows_gnullvm::target,
                    targets::x86_64_pc_windows_gnullvm::target,
                    targets::aarch64_pc_windows_msvc::target,
                    targets::aarch64_uwp_windows_msvc::target,
                    targets::arm64ec_pc_windows_msvc::target,
                    targets::x86_64_pc_windows_msvc::target,
                    targets::x86_64_uwp_windows_msvc::target,
                    targets::x86_64_win7_windows_msvc::target,
                    targets::i686_pc_windows_msvc::target,
                    targets::i686_uwp_windows_msvc::target,
                    targets::i686_win7_windows_msvc::target,
                    targets::thumbv7a_pc_windows_msvc::target,
                    targets::thumbv7a_uwp_windows_msvc::target,
                    targets::wasm32_unknown_emscripten::target,
                    targets::wasm32_unknown_unknown::target,
                    targets::wasm32v1_none::target,
                    targets::wasm32_wasip1::target,
                    targets::wasm32_wasip2::target,
                    targets::wasm32_wasip3::target,
                    targets::wasm32_wasip1_threads::target,
                    targets::wasm32_wali_linux_musl::target,
                    targets::wasm64_unknown_unknown::target,
                    targets::thumbv6m_none_eabi::target,
                    targets::thumbv7m_none_eabi::target,
                    targets::thumbv7em_none_eabi::target,
                    targets::thumbv7em_none_eabihf::target,
                    targets::thumbv8m_base_none_eabi::target,
                    targets::thumbv8m_main_none_eabi::target,
                    targets::thumbv8m_main_none_eabihf::target,
                    targets::armv7a_none_eabi::target,
                    targets::thumbv7a_none_eabi::target,
                    targets::armv7a_none_eabihf::target,
                    targets::thumbv7a_none_eabihf::target,
                    targets::armv7a_nuttx_eabi::target,
                    targets::armv7a_nuttx_eabihf::target,
                    targets::armv7a_vex_v5::target,
                    targets::msp430_none_elf::target,
                    targets::aarch64_be_unknown_hermit::target,
                    targets::aarch64_unknown_hermit::target,
                    targets::riscv64gc_unknown_hermit::target,
                    targets::x86_64_unknown_hermit::target,
                    targets::x86_64_unknown_motor::target,
                    targets::x86_64_unikraft_linux_musl::target,
                    targets::armv7_unknown_trusty::target,
                    targets::aarch64_unknown_trusty::target,
                    targets::x86_64_unknown_trusty::target,
                    targets::riscv32i_unknown_none_elf::target,
                    targets::riscv32im_risc0_zkvm_elf::target,
                    targets::riscv32im_unknown_none_elf::target,
                    targets::riscv32ima_unknown_none_elf::target,
                    targets::riscv32imc_unknown_none_elf::target,
                    targets::riscv32imfc_unknown_none_elf::target,
                    targets::riscv32imc_esp_espidf::target,
                    targets::riscv32imac_esp_espidf::target,
                    targets::riscv32imafc_esp_espidf::target,
                    targets::riscv32e_unknown_none_elf::target,
                    targets::riscv32em_unknown_none_elf::target,
                    targets::riscv32emc_unknown_none_elf::target,
                    targets::riscv32imac_unknown_none_elf::target,
                    targets::riscv32imafc_unknown_none_elf::target,
                    targets::riscv32imac_unknown_xous_elf::target,
                    targets::riscv32gc_unknown_linux_gnu::target,
                    targets::riscv32gc_unknown_linux_musl::target,
                    targets::riscv64im_unknown_none_elf::target,
                    targets::riscv64imac_unknown_none_elf::target,
                    targets::riscv64gc_unknown_none_elf::target,
                    targets::riscv64gc_unknown_linux_gnu::target,
                    targets::riscv64gc_unknown_linux_musl::target,
                    targets::riscv64a23_unknown_linux_gnu::target,
                    targets::sparc_unknown_none_elf::target,
                    targets::loongarch32_unknown_none::target,
                    targets::loongarch32_unknown_none_softfloat::target,
                    targets::loongarch64_unknown_none::target,
                    targets::loongarch64_unknown_none_softfloat::target,
                    targets::aarch64_unknown_none::target,
                    targets::aarch64_unknown_none_softfloat::target,
                    targets::aarch64_be_unknown_none_softfloat::target,
                    targets::aarch64_unknown_nuttx::target,
                    targets::aarch64v8r_unknown_none::target,
                    targets::aarch64v8r_unknown_none_softfloat::target,
                    targets::x86_64_fortanix_unknown_sgx::target,
                    targets::x86_64_unknown_uefi::target,
                    targets::i686_unknown_uefi::target,
                    targets::aarch64_unknown_uefi::target,
                    targets::nvptx64_nvidia_cuda::target,
                    targets::amdgcn_amd_amdhsa::target,
                    targets::xtensa_esp32_none_elf::target,
                    targets::xtensa_esp32_espidf::target,
                    targets::xtensa_esp32s2_none_elf::target,
                    targets::xtensa_esp32s2_espidf::target,
                    targets::xtensa_esp32s3_none_elf::target,
                    targets::xtensa_esp32s3_espidf::target,
                    targets::i686_wrs_vxworks::target,
                    targets::x86_64_wrs_vxworks::target,
                    targets::armv7_wrs_vxworks_eabihf::target,
                    targets::aarch64_wrs_vxworks::target,
                    targets::powerpc_wrs_vxworks::target,
                    targets::powerpc_wrs_vxworks_spe::target,
                    targets::powerpc64_wrs_vxworks::target,
                    targets::riscv32_wrs_vxworks::target,
                    targets::riscv64_wrs_vxworks::target,
                    targets::aarch64_kmc_solid_asp3::target,
                    targets::armv7a_kmc_solid_asp3_eabi::target,
                    targets::armv7a_kmc_solid_asp3_eabihf::target,
                    targets::mipsel_sony_psp::target,
                    targets::mipsel_sony_psx::target,
                    targets::mipsel_unknown_none::target,
                    targets::mips_mti_none_elf::target,
                    targets::mipsel_mti_none_elf::target,
                    targets::armv4t_none_eabi::target,
                    targets::armv5te_none_eabi::target,
                    targets::armv6_none_eabi::target,
                    targets::armv6_none_eabihf::target,
                    targets::thumbv4t_none_eabi::target,
                    targets::thumbv5te_none_eabi::target,
                    targets::thumbv6_none_eabi::target,
                    targets::aarch64_be_unknown_linux_gnu::target,
                    targets::aarch64_unknown_linux_gnu_ilp32::target,
                    targets::aarch64_be_unknown_linux_gnu_ilp32::target,
                    targets::bpfeb_unknown_none::target,
                    targets::bpfel_unknown_none::target,
                    targets::armv6k_nintendo_3ds::target,
                    targets::aarch64_nintendo_switch_freestanding::target,
                    targets::armv7_sony_vita_newlibeabihf::target,
                    targets::armv7_unknown_linux_uclibceabi::target,
                    targets::armv7_unknown_linux_uclibceabihf::target,
                    targets::x86_64_unknown_none::target,
                    targets::aarch64_unknown_teeos::target,
                    targets::mips64_openwrt_linux_musl::target,
                    targets::aarch64_unknown_nto_qnx700::target,
                    targets::aarch64_unknown_nto_qnx710::target,
                    targets::aarch64_unknown_nto_qnx710_iosock::target,
                    targets::aarch64_unknown_qnx::target,
                    targets::x86_64_pc_nto_qnx710::target,
                    targets::x86_64_pc_nto_qnx710_iosock::target,
                    targets::x86_64_pc_qnx::target,
                    targets::i686_pc_nto_qnx700::target,
                    targets::aarch64_unknown_linux_ohos::target,
                    targets::armv7_unknown_linux_ohos::target,
                    targets::loongarch64_unknown_linux_ohos::target,
                    targets::x86_64_unknown_linux_ohos::target,
                    targets::x86_64_unknown_linux_none::target,
                    targets::thumbv6m_nuttx_eabi::target,
                    targets::thumbv7a_nuttx_eabi::target,
                    targets::thumbv7a_nuttx_eabihf::target,
                    targets::thumbv7m_nuttx_eabi::target,
                    targets::thumbv7em_nuttx_eabi::target,
                    targets::thumbv7em_nuttx_eabihf::target,
                    targets::thumbv8m_base_nuttx_eabi::target,
                    targets::thumbv8m_main_nuttx_eabi::target,
                    targets::thumbv8m_main_nuttx_eabihf::target,
                    targets::riscv32imc_unknown_nuttx_elf::target,
                    targets::riscv32imac_unknown_nuttx_elf::target,
                    targets::riscv32imafc_unknown_nuttx_elf::target,
                    targets::riscv64imac_unknown_nuttx_elf::target,
                    targets::riscv64gc_unknown_nuttx_elf::target,
                    targets::x86_64_lynx_lynxos178::target,
                    targets::x86_64_pc_cygwin::target,
                    targets::x86_64_unknown_linux_gnuasan::target,
                    targets::x86_64_unknown_linux_gnumsan::target,
                    targets::x86_64_unknown_linux_gnutsan::target,
                    targets::aarch64_oe_linux_gnu::target,
                    targets::armv7_oe_linux_gnueabihf::target,
                    targets::i686_oe_linux_gnu::target,
                    targets::riscv64_oe_linux_gnu::target,
                    targets::x86_64_oe_linux_gnu::target].into_iter().map(|f|
            f())
}supported_targets! {
1442    ("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
1443    ("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32),
1444    ("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
1445    ("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
1446    ("loongarch64-unknown-linux-gnu", loongarch64_unknown_linux_gnu),
1447    ("loongarch64-unknown-linux-musl", loongarch64_unknown_linux_musl),
1448    ("m68k-unknown-linux-gnu", m68k_unknown_linux_gnu),
1449    ("m68k-unknown-none-elf", m68k_unknown_none_elf),
1450    ("csky-unknown-linux-gnuabiv2", csky_unknown_linux_gnuabiv2),
1451    ("csky-unknown-linux-gnuabiv2hf", csky_unknown_linux_gnuabiv2hf),
1452    ("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
1453    ("mips64-unknown-linux-gnuabi64", mips64_unknown_linux_gnuabi64),
1454    ("mips64el-unknown-linux-gnuabi64", mips64el_unknown_linux_gnuabi64),
1455    ("mipsisa32r6-unknown-linux-gnu", mipsisa32r6_unknown_linux_gnu),
1456    ("mipsisa32r6el-unknown-linux-gnu", mipsisa32r6el_unknown_linux_gnu),
1457    ("mipsisa64r6-unknown-linux-gnuabi64", mipsisa64r6_unknown_linux_gnuabi64),
1458    ("mipsisa64r6el-unknown-linux-gnuabi64", mipsisa64r6el_unknown_linux_gnuabi64),
1459    ("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
1460    ("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),
1461    ("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe),
1462    ("powerpc-unknown-linux-musl", powerpc_unknown_linux_musl),
1463    ("powerpc-unknown-linux-muslspe", powerpc_unknown_linux_muslspe),
1464    ("powerpc64-ibm-aix", powerpc64_ibm_aix),
1465    ("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
1466    ("powerpc64-unknown-linux-gnuelfv2", powerpc64_unknown_linux_gnuelfv2),
1467    ("powerpc64-unknown-linux-musl", powerpc64_unknown_linux_musl),
1468    ("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
1469    ("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl),
1470    ("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
1471    ("s390x-unknown-none-softfloat", s390x_unknown_none_softfloat),
1472    ("s390x-unknown-linux-musl", s390x_unknown_linux_musl),
1473    ("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu),
1474    ("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
1475    ("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi),
1476    ("arm-unknown-linux-gnueabihf", arm_unknown_linux_gnueabihf),
1477    ("armeb-unknown-linux-gnueabi", armeb_unknown_linux_gnueabi),
1478    ("arm-unknown-linux-musleabi", arm_unknown_linux_musleabi),
1479    ("arm-unknown-linux-musleabihf", arm_unknown_linux_musleabihf),
1480    ("armv4t-unknown-linux-gnueabi", armv4t_unknown_linux_gnueabi),
1481    ("armv5te-unknown-linux-gnueabi", armv5te_unknown_linux_gnueabi),
1482    ("armv5te-unknown-linux-musleabi", armv5te_unknown_linux_musleabi),
1483    ("armv5te-unknown-linux-uclibceabi", armv5te_unknown_linux_uclibceabi),
1484    ("armv7-unknown-linux-gnueabi", armv7_unknown_linux_gnueabi),
1485    ("armv7-unknown-linux-gnueabihf", armv7_unknown_linux_gnueabihf),
1486    ("thumbv7neon-unknown-linux-gnueabihf", thumbv7neon_unknown_linux_gnueabihf),
1487    ("thumbv7neon-unknown-linux-musleabihf", thumbv7neon_unknown_linux_musleabihf),
1488    ("armv7-unknown-linux-musleabi", armv7_unknown_linux_musleabi),
1489    ("armv7-unknown-linux-musleabihf", armv7_unknown_linux_musleabihf),
1490    ("aarch64-unknown-linux-gnu", aarch64_unknown_linux_gnu),
1491    ("aarch64-unknown-linux-musl", aarch64_unknown_linux_musl),
1492    ("aarch64-unknown-linux-pauthtest", aarch64_unknown_linux_pauthtest),
1493    ("aarch64_be-unknown-linux-musl", aarch64_be_unknown_linux_musl),
1494    ("x86_64-unknown-linux-musl", x86_64_unknown_linux_musl),
1495    ("i686-unknown-linux-musl", i686_unknown_linux_musl),
1496    ("i586-unknown-linux-musl", i586_unknown_linux_musl),
1497    ("mips-unknown-linux-musl", mips_unknown_linux_musl),
1498    ("mipsel-unknown-linux-musl", mipsel_unknown_linux_musl),
1499    ("mips64-unknown-linux-muslabi64", mips64_unknown_linux_muslabi64),
1500    ("mips64el-unknown-linux-muslabi64", mips64el_unknown_linux_muslabi64),
1501    ("hexagon-unknown-linux-musl", hexagon_unknown_linux_musl),
1502    ("hexagon-unknown-none-elf", hexagon_unknown_none_elf),
1503    ("hexagon-unknown-qurt", hexagon_unknown_qurt),
1504
1505    ("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
1506    ("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),
1507
1508    ("i686-linux-android", i686_linux_android),
1509    ("x86_64-linux-android", x86_64_linux_android),
1510    ("arm-linux-androideabi", arm_linux_androideabi),
1511    ("armv7-linux-androideabi", armv7_linux_androideabi),
1512    ("thumbv7neon-linux-androideabi", thumbv7neon_linux_androideabi),
1513    ("aarch64-linux-android", aarch64_linux_android),
1514    ("riscv64-linux-android", riscv64_linux_android),
1515
1516    ("aarch64-unknown-freebsd", aarch64_unknown_freebsd),
1517    ("armv6-unknown-freebsd", armv6_unknown_freebsd),
1518    ("armv7-unknown-freebsd", armv7_unknown_freebsd),
1519    ("i686-unknown-freebsd", i686_unknown_freebsd),
1520    ("powerpc-unknown-freebsd", powerpc_unknown_freebsd),
1521    ("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd),
1522    ("powerpc64le-unknown-freebsd", powerpc64le_unknown_freebsd),
1523    ("riscv64gc-unknown-freebsd", riscv64gc_unknown_freebsd),
1524    ("x86_64-unknown-freebsd", x86_64_unknown_freebsd),
1525
1526    ("x86_64-unknown-dragonfly", x86_64_unknown_dragonfly),
1527
1528    ("aarch64-unknown-openbsd", aarch64_unknown_openbsd),
1529    ("i686-unknown-openbsd", i686_unknown_openbsd),
1530    ("powerpc-unknown-openbsd", powerpc_unknown_openbsd),
1531    ("powerpc64-unknown-openbsd", powerpc64_unknown_openbsd),
1532    ("riscv64gc-unknown-openbsd", riscv64gc_unknown_openbsd),
1533    ("sparc64-unknown-openbsd", sparc64_unknown_openbsd),
1534    ("x86_64-unknown-openbsd", x86_64_unknown_openbsd),
1535
1536    ("aarch64-unknown-netbsd", aarch64_unknown_netbsd),
1537    ("aarch64_be-unknown-netbsd", aarch64_be_unknown_netbsd),
1538    ("armv6-unknown-netbsd-eabihf", armv6_unknown_netbsd_eabihf),
1539    ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
1540    ("i586-unknown-netbsd", i586_unknown_netbsd),
1541    ("i686-unknown-netbsd", i686_unknown_netbsd),
1542    ("mipsel-unknown-netbsd", mipsel_unknown_netbsd),
1543    ("powerpc-unknown-netbsd", powerpc_unknown_netbsd),
1544    ("riscv64gc-unknown-netbsd", riscv64gc_unknown_netbsd),
1545    ("sparc64-unknown-netbsd", sparc64_unknown_netbsd),
1546    ("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
1547
1548    ("i686-unknown-haiku", i686_unknown_haiku),
1549    ("x86_64-unknown-haiku", x86_64_unknown_haiku),
1550
1551    ("aarch64-unknown-helenos", aarch64_unknown_helenos),
1552    ("i686-unknown-helenos", i686_unknown_helenos),
1553    ("powerpc-unknown-helenos", powerpc_unknown_helenos),
1554    ("sparc64-unknown-helenos", sparc64_unknown_helenos),
1555    ("x86_64-unknown-helenos", x86_64_unknown_helenos),
1556
1557    ("i686-unknown-hurd-gnu", i686_unknown_hurd_gnu),
1558    ("x86_64-unknown-hurd-gnu", x86_64_unknown_hurd_gnu),
1559
1560    ("aarch64-apple-darwin", aarch64_apple_darwin),
1561    ("arm64e-apple-darwin", arm64e_apple_darwin),
1562    ("x86_64-apple-darwin", x86_64_apple_darwin),
1563    ("x86_64h-apple-darwin", x86_64h_apple_darwin),
1564    ("i686-apple-darwin", i686_apple_darwin),
1565
1566    ("aarch64-unknown-fuchsia", aarch64_unknown_fuchsia),
1567    ("riscv64gc-unknown-fuchsia", riscv64gc_unknown_fuchsia),
1568    ("x86_64-unknown-fuchsia", x86_64_unknown_fuchsia),
1569
1570    ("avr-none", avr_none),
1571
1572    ("x86_64-unknown-l4re-uclibc", x86_64_unknown_l4re_uclibc),
1573
1574    ("aarch64-unknown-redox", aarch64_unknown_redox),
1575    ("i586-unknown-redox", i586_unknown_redox),
1576    ("riscv64gc-unknown-redox", riscv64gc_unknown_redox),
1577    ("x86_64-unknown-redox", x86_64_unknown_redox),
1578
1579    ("x86_64-unknown-managarm-mlibc", x86_64_unknown_managarm_mlibc),
1580    ("aarch64-unknown-managarm-mlibc", aarch64_unknown_managarm_mlibc),
1581    ("riscv64gc-unknown-managarm-mlibc", riscv64gc_unknown_managarm_mlibc),
1582
1583    ("i386-apple-ios", i386_apple_ios),
1584    ("x86_64-apple-ios", x86_64_apple_ios),
1585    ("aarch64-apple-ios", aarch64_apple_ios),
1586    ("arm64e-apple-ios", arm64e_apple_ios),
1587    ("armv7s-apple-ios", armv7s_apple_ios),
1588    ("x86_64-apple-ios-macabi", x86_64_apple_ios_macabi),
1589    ("aarch64-apple-ios-macabi", aarch64_apple_ios_macabi),
1590    ("aarch64-apple-ios-sim", aarch64_apple_ios_sim),
1591
1592    ("aarch64-apple-tvos", aarch64_apple_tvos),
1593    ("aarch64-apple-tvos-sim", aarch64_apple_tvos_sim),
1594    ("arm64e-apple-tvos", arm64e_apple_tvos),
1595    ("x86_64-apple-tvos", x86_64_apple_tvos),
1596
1597    ("armv7k-apple-watchos", armv7k_apple_watchos),
1598    ("arm64_32-apple-watchos", arm64_32_apple_watchos),
1599    ("x86_64-apple-watchos-sim", x86_64_apple_watchos_sim),
1600    ("aarch64-apple-watchos", aarch64_apple_watchos),
1601    ("aarch64-apple-watchos-sim", aarch64_apple_watchos_sim),
1602
1603    ("aarch64-apple-visionos", aarch64_apple_visionos),
1604    ("aarch64-apple-visionos-sim", aarch64_apple_visionos_sim),
1605
1606    ("armebv7r-none-eabi", armebv7r_none_eabi),
1607    ("armebv7r-none-eabihf", armebv7r_none_eabihf),
1608    ("armv7r-none-eabi", armv7r_none_eabi),
1609    ("thumbv7r-none-eabi", thumbv7r_none_eabi),
1610    ("armv7r-none-eabihf", armv7r_none_eabihf),
1611    ("thumbv7r-none-eabihf", thumbv7r_none_eabihf),
1612    ("armv8r-none-eabihf", armv8r_none_eabihf),
1613    ("thumbv8r-none-eabihf", thumbv8r_none_eabihf),
1614
1615    ("armv7-rtems-eabihf", armv7_rtems_eabihf),
1616
1617    ("x86_64-pc-solaris", x86_64_pc_solaris),
1618    ("sparcv9-sun-solaris", sparcv9_sun_solaris),
1619
1620    ("x86_64-unknown-illumos", x86_64_unknown_illumos),
1621    ("aarch64-unknown-illumos", aarch64_unknown_illumos),
1622
1623    ("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu),
1624    ("x86_64-uwp-windows-gnu", x86_64_uwp_windows_gnu),
1625    ("x86_64-win7-windows-gnu", x86_64_win7_windows_gnu),
1626    ("i686-pc-windows-gnu", i686_pc_windows_gnu),
1627    ("i686-uwp-windows-gnu", i686_uwp_windows_gnu),
1628    ("i686-win7-windows-gnu", i686_win7_windows_gnu),
1629
1630    ("aarch64-pc-windows-gnullvm", aarch64_pc_windows_gnullvm),
1631    ("i686-pc-windows-gnullvm", i686_pc_windows_gnullvm),
1632    ("x86_64-pc-windows-gnullvm", x86_64_pc_windows_gnullvm),
1633
1634    ("aarch64-pc-windows-msvc", aarch64_pc_windows_msvc),
1635    ("aarch64-uwp-windows-msvc", aarch64_uwp_windows_msvc),
1636    ("arm64ec-pc-windows-msvc", arm64ec_pc_windows_msvc),
1637    ("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc),
1638    ("x86_64-uwp-windows-msvc", x86_64_uwp_windows_msvc),
1639    ("x86_64-win7-windows-msvc", x86_64_win7_windows_msvc),
1640    ("i686-pc-windows-msvc", i686_pc_windows_msvc),
1641    ("i686-uwp-windows-msvc", i686_uwp_windows_msvc),
1642    ("i686-win7-windows-msvc", i686_win7_windows_msvc),
1643    ("thumbv7a-pc-windows-msvc", thumbv7a_pc_windows_msvc),
1644    ("thumbv7a-uwp-windows-msvc", thumbv7a_uwp_windows_msvc),
1645
1646    ("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
1647    ("wasm32-unknown-unknown", wasm32_unknown_unknown),
1648    ("wasm32v1-none", wasm32v1_none),
1649    ("wasm32-wasip1", wasm32_wasip1),
1650    ("wasm32-wasip2", wasm32_wasip2),
1651    ("wasm32-wasip3", wasm32_wasip3),
1652    ("wasm32-wasip1-threads", wasm32_wasip1_threads),
1653    ("wasm32-wali-linux-musl", wasm32_wali_linux_musl),
1654    ("wasm64-unknown-unknown", wasm64_unknown_unknown),
1655
1656    ("thumbv6m-none-eabi", thumbv6m_none_eabi),
1657    ("thumbv7m-none-eabi", thumbv7m_none_eabi),
1658    ("thumbv7em-none-eabi", thumbv7em_none_eabi),
1659    ("thumbv7em-none-eabihf", thumbv7em_none_eabihf),
1660    ("thumbv8m.base-none-eabi", thumbv8m_base_none_eabi),
1661    ("thumbv8m.main-none-eabi", thumbv8m_main_none_eabi),
1662    ("thumbv8m.main-none-eabihf", thumbv8m_main_none_eabihf),
1663
1664    ("armv7a-none-eabi", armv7a_none_eabi),
1665    ("thumbv7a-none-eabi", thumbv7a_none_eabi),
1666    ("armv7a-none-eabihf", armv7a_none_eabihf),
1667    ("thumbv7a-none-eabihf", thumbv7a_none_eabihf),
1668    ("armv7a-nuttx-eabi", armv7a_nuttx_eabi),
1669    ("armv7a-nuttx-eabihf", armv7a_nuttx_eabihf),
1670    ("armv7a-vex-v5", armv7a_vex_v5),
1671
1672    ("msp430-none-elf", msp430_none_elf),
1673
1674    ("aarch64_be-unknown-hermit", aarch64_be_unknown_hermit),
1675    ("aarch64-unknown-hermit", aarch64_unknown_hermit),
1676    ("riscv64gc-unknown-hermit", riscv64gc_unknown_hermit),
1677    ("x86_64-unknown-hermit", x86_64_unknown_hermit),
1678    ("x86_64-unknown-motor", x86_64_unknown_motor),
1679
1680    ("x86_64-unikraft-linux-musl", x86_64_unikraft_linux_musl),
1681
1682    ("armv7-unknown-trusty", armv7_unknown_trusty),
1683    ("aarch64-unknown-trusty", aarch64_unknown_trusty),
1684    ("x86_64-unknown-trusty", x86_64_unknown_trusty),
1685
1686    ("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
1687    ("riscv32im-risc0-zkvm-elf", riscv32im_risc0_zkvm_elf),
1688    ("riscv32im-unknown-none-elf", riscv32im_unknown_none_elf),
1689    ("riscv32ima-unknown-none-elf", riscv32ima_unknown_none_elf),
1690    ("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
1691    ("riscv32imfc-unknown-none-elf", riscv32imfc_unknown_none_elf),
1692    ("riscv32imc-esp-espidf", riscv32imc_esp_espidf),
1693    ("riscv32imac-esp-espidf", riscv32imac_esp_espidf),
1694    ("riscv32imafc-esp-espidf", riscv32imafc_esp_espidf),
1695
1696    ("riscv32e-unknown-none-elf", riscv32e_unknown_none_elf),
1697    ("riscv32em-unknown-none-elf", riscv32em_unknown_none_elf),
1698    ("riscv32emc-unknown-none-elf", riscv32emc_unknown_none_elf),
1699
1700    ("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
1701    ("riscv32imafc-unknown-none-elf", riscv32imafc_unknown_none_elf),
1702    ("riscv32imac-unknown-xous-elf", riscv32imac_unknown_xous_elf),
1703    ("riscv32gc-unknown-linux-gnu", riscv32gc_unknown_linux_gnu),
1704    ("riscv32gc-unknown-linux-musl", riscv32gc_unknown_linux_musl),
1705    ("riscv64im-unknown-none-elf", riscv64im_unknown_none_elf),
1706    ("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
1707    ("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
1708    ("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu),
1709    ("riscv64gc-unknown-linux-musl", riscv64gc_unknown_linux_musl),
1710    ("riscv64a23-unknown-linux-gnu", riscv64a23_unknown_linux_gnu),
1711
1712    ("sparc-unknown-none-elf", sparc_unknown_none_elf),
1713
1714    ("loongarch32-unknown-none", loongarch32_unknown_none),
1715    ("loongarch32-unknown-none-softfloat", loongarch32_unknown_none_softfloat),
1716    ("loongarch64-unknown-none", loongarch64_unknown_none),
1717    ("loongarch64-unknown-none-softfloat", loongarch64_unknown_none_softfloat),
1718
1719    ("aarch64-unknown-none", aarch64_unknown_none),
1720    ("aarch64-unknown-none-softfloat", aarch64_unknown_none_softfloat),
1721    ("aarch64_be-unknown-none-softfloat", aarch64_be_unknown_none_softfloat),
1722    ("aarch64-unknown-nuttx", aarch64_unknown_nuttx),
1723    ("aarch64v8r-unknown-none", aarch64v8r_unknown_none),
1724    ("aarch64v8r-unknown-none-softfloat", aarch64v8r_unknown_none_softfloat),
1725
1726    ("x86_64-fortanix-unknown-sgx", x86_64_fortanix_unknown_sgx),
1727
1728    ("x86_64-unknown-uefi", x86_64_unknown_uefi),
1729    ("i686-unknown-uefi", i686_unknown_uefi),
1730    ("aarch64-unknown-uefi", aarch64_unknown_uefi),
1731
1732    ("nvptx64-nvidia-cuda", nvptx64_nvidia_cuda),
1733
1734    ("amdgcn-amd-amdhsa", amdgcn_amd_amdhsa),
1735
1736    ("xtensa-esp32-none-elf", xtensa_esp32_none_elf),
1737    ("xtensa-esp32-espidf", xtensa_esp32_espidf),
1738    ("xtensa-esp32s2-none-elf", xtensa_esp32s2_none_elf),
1739    ("xtensa-esp32s2-espidf", xtensa_esp32s2_espidf),
1740    ("xtensa-esp32s3-none-elf", xtensa_esp32s3_none_elf),
1741    ("xtensa-esp32s3-espidf", xtensa_esp32s3_espidf),
1742
1743    ("i686-wrs-vxworks", i686_wrs_vxworks),
1744    ("x86_64-wrs-vxworks", x86_64_wrs_vxworks),
1745    ("armv7-wrs-vxworks-eabihf", armv7_wrs_vxworks_eabihf),
1746    ("aarch64-wrs-vxworks", aarch64_wrs_vxworks),
1747    ("powerpc-wrs-vxworks", powerpc_wrs_vxworks),
1748    ("powerpc-wrs-vxworks-spe", powerpc_wrs_vxworks_spe),
1749    ("powerpc64-wrs-vxworks", powerpc64_wrs_vxworks),
1750    ("riscv32-wrs-vxworks", riscv32_wrs_vxworks),
1751    ("riscv64-wrs-vxworks", riscv64_wrs_vxworks),
1752
1753    ("aarch64-kmc-solid_asp3", aarch64_kmc_solid_asp3),
1754    ("armv7a-kmc-solid_asp3-eabi", armv7a_kmc_solid_asp3_eabi),
1755    ("armv7a-kmc-solid_asp3-eabihf", armv7a_kmc_solid_asp3_eabihf),
1756
1757    ("mipsel-sony-psp", mipsel_sony_psp),
1758    ("mipsel-sony-psx", mipsel_sony_psx),
1759    ("mipsel-unknown-none", mipsel_unknown_none),
1760    ("mips-mti-none-elf", mips_mti_none_elf),
1761    ("mipsel-mti-none-elf", mipsel_mti_none_elf),
1762
1763    ("armv4t-none-eabi", armv4t_none_eabi),
1764    ("armv5te-none-eabi", armv5te_none_eabi),
1765    ("armv6-none-eabi", armv6_none_eabi),
1766    ("armv6-none-eabihf", armv6_none_eabihf),
1767    ("thumbv4t-none-eabi", thumbv4t_none_eabi),
1768    ("thumbv5te-none-eabi", thumbv5te_none_eabi),
1769    ("thumbv6-none-eabi", thumbv6_none_eabi),
1770
1771    ("aarch64_be-unknown-linux-gnu", aarch64_be_unknown_linux_gnu),
1772    ("aarch64-unknown-linux-gnu_ilp32", aarch64_unknown_linux_gnu_ilp32),
1773    ("aarch64_be-unknown-linux-gnu_ilp32", aarch64_be_unknown_linux_gnu_ilp32),
1774
1775    ("bpfeb-unknown-none", bpfeb_unknown_none),
1776    ("bpfel-unknown-none", bpfel_unknown_none),
1777
1778    ("armv6k-nintendo-3ds", armv6k_nintendo_3ds),
1779
1780    ("aarch64-nintendo-switch-freestanding", aarch64_nintendo_switch_freestanding),
1781
1782    ("armv7-sony-vita-newlibeabihf", armv7_sony_vita_newlibeabihf),
1783
1784    ("armv7-unknown-linux-uclibceabi", armv7_unknown_linux_uclibceabi),
1785    ("armv7-unknown-linux-uclibceabihf", armv7_unknown_linux_uclibceabihf),
1786
1787    ("x86_64-unknown-none", x86_64_unknown_none),
1788
1789    ("aarch64-unknown-teeos", aarch64_unknown_teeos),
1790
1791    ("mips64-openwrt-linux-musl", mips64_openwrt_linux_musl),
1792
1793    ("aarch64-unknown-nto-qnx700", aarch64_unknown_nto_qnx700),
1794    ("aarch64-unknown-nto-qnx710", aarch64_unknown_nto_qnx710),
1795    ("aarch64-unknown-nto-qnx710_iosock", aarch64_unknown_nto_qnx710_iosock),
1796    ("aarch64-unknown-qnx", aarch64_unknown_qnx),
1797    ("x86_64-pc-nto-qnx710", x86_64_pc_nto_qnx710),
1798    ("x86_64-pc-nto-qnx710_iosock", x86_64_pc_nto_qnx710_iosock),
1799    ("x86_64-pc-qnx", x86_64_pc_qnx),
1800    ("i686-pc-nto-qnx700", i686_pc_nto_qnx700),
1801
1802    ("aarch64-unknown-linux-ohos", aarch64_unknown_linux_ohos),
1803    ("armv7-unknown-linux-ohos", armv7_unknown_linux_ohos),
1804    ("loongarch64-unknown-linux-ohos", loongarch64_unknown_linux_ohos),
1805    ("x86_64-unknown-linux-ohos", x86_64_unknown_linux_ohos),
1806
1807    ("x86_64-unknown-linux-none", x86_64_unknown_linux_none),
1808
1809    ("thumbv6m-nuttx-eabi", thumbv6m_nuttx_eabi),
1810    ("thumbv7a-nuttx-eabi", thumbv7a_nuttx_eabi),
1811    ("thumbv7a-nuttx-eabihf", thumbv7a_nuttx_eabihf),
1812    ("thumbv7m-nuttx-eabi", thumbv7m_nuttx_eabi),
1813    ("thumbv7em-nuttx-eabi", thumbv7em_nuttx_eabi),
1814    ("thumbv7em-nuttx-eabihf", thumbv7em_nuttx_eabihf),
1815    ("thumbv8m.base-nuttx-eabi", thumbv8m_base_nuttx_eabi),
1816    ("thumbv8m.main-nuttx-eabi", thumbv8m_main_nuttx_eabi),
1817    ("thumbv8m.main-nuttx-eabihf", thumbv8m_main_nuttx_eabihf),
1818    ("riscv32imc-unknown-nuttx-elf", riscv32imc_unknown_nuttx_elf),
1819    ("riscv32imac-unknown-nuttx-elf", riscv32imac_unknown_nuttx_elf),
1820    ("riscv32imafc-unknown-nuttx-elf", riscv32imafc_unknown_nuttx_elf),
1821    ("riscv64imac-unknown-nuttx-elf", riscv64imac_unknown_nuttx_elf),
1822    ("riscv64gc-unknown-nuttx-elf", riscv64gc_unknown_nuttx_elf),
1823    ("x86_64-lynx-lynxos178", x86_64_lynx_lynxos178),
1824
1825    ("x86_64-pc-cygwin", x86_64_pc_cygwin),
1826
1827    ("x86_64-unknown-linux-gnuasan", x86_64_unknown_linux_gnuasan),
1828    ("x86_64-unknown-linux-gnumsan", x86_64_unknown_linux_gnumsan),
1829    ("x86_64-unknown-linux-gnutsan", x86_64_unknown_linux_gnutsan),
1830
1831    ("aarch64-oe-linux-gnu", aarch64_oe_linux_gnu),
1832    ("armv7-oe-linux-gnueabihf", armv7_oe_linux_gnueabihf),
1833    ("i686-oe-linux-gnu", i686_oe_linux_gnu),
1834    ("riscv64-oe-linux-gnu", riscv64_oe_linux_gnu),
1835    ("x86_64-oe-linux-gnu", x86_64_oe_linux_gnu),
1836}
1837
1838/// Cow-Vec-Str: Cow<'static, [Cow<'static, str>]>
1839macro_rules! cvs {
1840    () => {
1841        ::std::borrow::Cow::Borrowed(&[])
1842    };
1843    ($($x:expr),+ $(,)?) => {
1844        ::std::borrow::Cow::Borrowed(&[
1845            $(
1846                ::std::borrow::Cow::Borrowed($x),
1847            )*
1848        ])
1849    };
1850}
1851
1852pub(crate) use cvs;
1853
1854/// Warnings encountered when parsing the target `json`.
1855///
1856/// Includes fields that weren't recognized and fields that don't have the expected type.
1857#[derive(#[automatically_derived]
impl ::core::fmt::Debug for TargetWarnings {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field1_finish(f,
            "TargetWarnings", "unused_fields", &&self.unused_fields)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for TargetWarnings {
    #[inline]
    fn eq(&self, other: &TargetWarnings) -> bool {
        self.unused_fields == other.unused_fields
    }
}PartialEq)]
1858pub struct TargetWarnings {
1859    unused_fields: Vec<String>,
1860}
1861
1862impl TargetWarnings {
1863    pub fn empty() -> Self {
1864        Self { unused_fields: Vec::new() }
1865    }
1866
1867    pub fn warning_messages(&self) -> Vec<String> {
1868        let mut warnings = ::alloc::vec::Vec::new()vec![];
1869        if !self.unused_fields.is_empty() {
1870            warnings.push(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target json file contains unused fields: {0}",
                self.unused_fields.join(", ")))
    })format!(
1871                "target json file contains unused fields: {}",
1872                self.unused_fields.join(", ")
1873            ));
1874        }
1875        warnings
1876    }
1877}
1878
1879/// For the [`Target::check_consistency`] function, determines whether the given target is a builtin or a JSON
1880/// target.
1881#[derive(#[automatically_derived]
impl ::core::marker::Copy for TargetKind { }Copy, #[automatically_derived]
impl ::core::clone::Clone for TargetKind {
    #[inline]
    fn clone(&self) -> TargetKind { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for TargetKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                TargetKind::Json => "Json",
                TargetKind::Builtin => "Builtin",
            })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for TargetKind {
    #[inline]
    fn eq(&self, other: &TargetKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq)]
1882enum TargetKind {
1883    Json,
1884    Builtin,
1885}
1886
1887pub enum Arch {
    AArch64,
    AmdGpu,
    Arm,
    Arm64EC,
    Avr,
    Bpf,
    CSky,
    Hexagon,
    LoongArch32,
    LoongArch64,
    M68k,
    Mips,
    Mips32r6,
    Mips64,
    Mips64r6,
    Msp430,
    Nvptx64,
    PowerPC,
    PowerPC64,
    RiscV32,
    RiscV64,
    S390x,
    Sparc,
    Sparc64,
    SpirV,
    Wasm32,
    Wasm64,
    X86,
    X86_64,
    Xtensa,

    /// The vast majority of the time, the compiler deals with a fixed
    /// set of values, so it is convenient for them to be represented in
    /// an enum. However, it is possible to have arbitrary values in a
    /// target JSON file (which can be parsed when `--target` is
    /// specified). This might occur, for example, for an out-of-tree
    /// codegen backend that supports a value (e.g. architecture or OS)
    /// that rustc currently doesn't know about. This variant exists as
    /// an escape hatch for such cases.
    Other(crate::spec::StaticCow<str>),
}
#[automatically_derived]
impl ::core::clone::Clone for Arch {
    #[inline]
    fn clone(&self) -> Arch {
        match self {
            Arch::AArch64 => Arch::AArch64,
            Arch::AmdGpu => Arch::AmdGpu,
            Arch::Arm => Arch::Arm,
            Arch::Arm64EC => Arch::Arm64EC,
            Arch::Avr => Arch::Avr,
            Arch::Bpf => Arch::Bpf,
            Arch::CSky => Arch::CSky,
            Arch::Hexagon => Arch::Hexagon,
            Arch::LoongArch32 => Arch::LoongArch32,
            Arch::LoongArch64 => Arch::LoongArch64,
            Arch::M68k => Arch::M68k,
            Arch::Mips => Arch::Mips,
            Arch::Mips32r6 => Arch::Mips32r6,
            Arch::Mips64 => Arch::Mips64,
            Arch::Mips64r6 => Arch::Mips64r6,
            Arch::Msp430 => Arch::Msp430,
            Arch::Nvptx64 => Arch::Nvptx64,
            Arch::PowerPC => Arch::PowerPC,
            Arch::PowerPC64 => Arch::PowerPC64,
            Arch::RiscV32 => Arch::RiscV32,
            Arch::RiscV64 => Arch::RiscV64,
            Arch::S390x => Arch::S390x,
            Arch::Sparc => Arch::Sparc,
            Arch::Sparc64 => Arch::Sparc64,
            Arch::SpirV => Arch::SpirV,
            Arch::Wasm32 => Arch::Wasm32,
            Arch::Wasm64 => Arch::Wasm64,
            Arch::X86 => Arch::X86,
            Arch::X86_64 => Arch::X86_64,
            Arch::Xtensa => Arch::Xtensa,
            Arch::Other(__self_0) =>
                Arch::Other(::core::clone::Clone::clone(__self_0)),
        }
    }
}
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for Arch { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Arch {
    #[inline]
    fn eq(&self, other: &Arch) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (Arch::Other(__self_0), Arch::Other(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for Arch {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<crate::spec::StaticCow<str>>;
    }
}
#[automatically_derived]
impl ::core::hash::Hash for Arch {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            Arch::Other(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for Arch {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Arch::AArch64 => ::core::fmt::Formatter::write_str(f, "AArch64"),
            Arch::AmdGpu => ::core::fmt::Formatter::write_str(f, "AmdGpu"),
            Arch::Arm => ::core::fmt::Formatter::write_str(f, "Arm"),
            Arch::Arm64EC => ::core::fmt::Formatter::write_str(f, "Arm64EC"),
            Arch::Avr => ::core::fmt::Formatter::write_str(f, "Avr"),
            Arch::Bpf => ::core::fmt::Formatter::write_str(f, "Bpf"),
            Arch::CSky => ::core::fmt::Formatter::write_str(f, "CSky"),
            Arch::Hexagon => ::core::fmt::Formatter::write_str(f, "Hexagon"),
            Arch::LoongArch32 =>
                ::core::fmt::Formatter::write_str(f, "LoongArch32"),
            Arch::LoongArch64 =>
                ::core::fmt::Formatter::write_str(f, "LoongArch64"),
            Arch::M68k => ::core::fmt::Formatter::write_str(f, "M68k"),
            Arch::Mips => ::core::fmt::Formatter::write_str(f, "Mips"),
            Arch::Mips32r6 =>
                ::core::fmt::Formatter::write_str(f, "Mips32r6"),
            Arch::Mips64 => ::core::fmt::Formatter::write_str(f, "Mips64"),
            Arch::Mips64r6 =>
                ::core::fmt::Formatter::write_str(f, "Mips64r6"),
            Arch::Msp430 => ::core::fmt::Formatter::write_str(f, "Msp430"),
            Arch::Nvptx64 => ::core::fmt::Formatter::write_str(f, "Nvptx64"),
            Arch::PowerPC => ::core::fmt::Formatter::write_str(f, "PowerPC"),
            Arch::PowerPC64 =>
                ::core::fmt::Formatter::write_str(f, "PowerPC64"),
            Arch::RiscV32 => ::core::fmt::Formatter::write_str(f, "RiscV32"),
            Arch::RiscV64 => ::core::fmt::Formatter::write_str(f, "RiscV64"),
            Arch::S390x => ::core::fmt::Formatter::write_str(f, "S390x"),
            Arch::Sparc => ::core::fmt::Formatter::write_str(f, "Sparc"),
            Arch::Sparc64 => ::core::fmt::Formatter::write_str(f, "Sparc64"),
            Arch::SpirV => ::core::fmt::Formatter::write_str(f, "SpirV"),
            Arch::Wasm32 => ::core::fmt::Formatter::write_str(f, "Wasm32"),
            Arch::Wasm64 => ::core::fmt::Formatter::write_str(f, "Wasm64"),
            Arch::X86 => ::core::fmt::Formatter::write_str(f, "X86"),
            Arch::X86_64 => ::core::fmt::Formatter::write_str(f, "X86_64"),
            Arch::Xtensa => ::core::fmt::Formatter::write_str(f, "Xtensa"),
            Arch::Other(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Other",
                    &__self_0),
        }
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for Arch {
    #[inline]
    fn partial_cmp(&self, other: &Arch)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for Arch {
    #[inline]
    fn cmp(&self, other: &Arch) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (Arch::Other(__self_0), Arch::Other(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}
impl schemars::JsonSchema for Arch {
    fn schema_name() -> std::borrow::Cow<'static, str> {
        std::borrow::Cow::Borrowed("Arch")
    }
    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
        <::schemars::Schema as
                    ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                        let mut object = ::serde_json::Map::new();
                        let _ =
                            object.insert(("type").into(),
                                ::serde_json::to_value(&"string").unwrap());
                        object
                    })).unwrap()
    }
}
impl FromStr for Arch {
    type Err = core::convert::Infallible;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "aarch64" => Self::AArch64,
                "amdgpu" => Self::AmdGpu,
                "arm" => Self::Arm,
                "arm64ec" => Self::Arm64EC,
                "avr" => Self::Avr,
                "bpf" => Self::Bpf,
                "csky" => Self::CSky,
                "hexagon" => Self::Hexagon,
                "loongarch32" => Self::LoongArch32,
                "loongarch64" => Self::LoongArch64,
                "m68k" => Self::M68k,
                "mips" => Self::Mips,
                "mips32r6" => Self::Mips32r6,
                "mips64" => Self::Mips64,
                "mips64r6" => Self::Mips64r6,
                "msp430" => Self::Msp430,
                "nvptx64" => Self::Nvptx64,
                "powerpc" => Self::PowerPC,
                "powerpc64" => Self::PowerPC64,
                "riscv32" => Self::RiscV32,
                "riscv64" => Self::RiscV64,
                "s390x" => Self::S390x,
                "sparc" => Self::Sparc,
                "sparc64" => Self::Sparc64,
                "spirv" => Self::SpirV,
                "wasm32" => Self::Wasm32,
                "wasm64" => Self::Wasm64,
                "x86" => Self::X86,
                "x86_64" => Self::X86_64,
                "xtensa" => Self::Xtensa,
                _ => Self::Other(s.to_owned().into()),
            })
    }
}
impl Arch {
    pub fn desc(&self) -> &str {
        match self {
            Self::AArch64 => "aarch64",
            Self::AmdGpu => "amdgpu",
            Self::Arm => "arm",
            Self::Arm64EC => "arm64ec",
            Self::Avr => "avr",
            Self::Bpf => "bpf",
            Self::CSky => "csky",
            Self::Hexagon => "hexagon",
            Self::LoongArch32 => "loongarch32",
            Self::LoongArch64 => "loongarch64",
            Self::M68k => "m68k",
            Self::Mips => "mips",
            Self::Mips32r6 => "mips32r6",
            Self::Mips64 => "mips64",
            Self::Mips64r6 => "mips64r6",
            Self::Msp430 => "msp430",
            Self::Nvptx64 => "nvptx64",
            Self::PowerPC => "powerpc",
            Self::PowerPC64 => "powerpc64",
            Self::RiscV32 => "riscv32",
            Self::RiscV64 => "riscv64",
            Self::S390x => "s390x",
            Self::Sparc => "sparc",
            Self::Sparc64 => "sparc64",
            Self::SpirV => "spirv",
            Self::Wasm32 => "wasm32",
            Self::Wasm64 => "wasm64",
            Self::X86 => "x86",
            Self::X86_64 => "x86_64",
            Self::Xtensa => "xtensa",
            Self::Other(name) => name.as_ref(),
        }
    }
}
impl crate::json::ToJson for Arch {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for Arch {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for Arch {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1888    pub enum Arch {
1889        AArch64 = "aarch64",
1890        AmdGpu = "amdgpu",
1891        Arm = "arm",
1892        Arm64EC = "arm64ec",
1893        Avr = "avr",
1894        Bpf = "bpf",
1895        CSky = "csky",
1896        Hexagon = "hexagon",
1897        LoongArch32 = "loongarch32",
1898        LoongArch64 = "loongarch64",
1899        M68k = "m68k",
1900        Mips = "mips",
1901        Mips32r6 = "mips32r6",
1902        Mips64 = "mips64",
1903        Mips64r6 = "mips64r6",
1904        Msp430 = "msp430",
1905        Nvptx64 = "nvptx64",
1906        PowerPC = "powerpc",
1907        PowerPC64 = "powerpc64",
1908        RiscV32 = "riscv32",
1909        RiscV64 = "riscv64",
1910        S390x = "s390x",
1911        Sparc = "sparc",
1912        Sparc64 = "sparc64",
1913        SpirV = "spirv",
1914        Wasm32 = "wasm32",
1915        Wasm64 = "wasm64",
1916        X86 = "x86",
1917        X86_64 = "x86_64",
1918        Xtensa = "xtensa",
1919    }
1920    other_variant = Other;
1921}
1922
1923impl Arch {
1924    pub fn desc_symbol(&self) -> Symbol {
1925        match self {
1926            Self::AArch64 => sym::aarch64,
1927            Self::AmdGpu => sym::amdgpu,
1928            Self::Arm => sym::arm,
1929            Self::Arm64EC => sym::arm64ec,
1930            Self::Avr => sym::avr,
1931            Self::Bpf => sym::bpf,
1932            Self::CSky => sym::csky,
1933            Self::Hexagon => sym::hexagon,
1934            Self::LoongArch32 => sym::loongarch32,
1935            Self::LoongArch64 => sym::loongarch64,
1936            Self::M68k => sym::m68k,
1937            Self::Mips => sym::mips,
1938            Self::Mips32r6 => sym::mips32r6,
1939            Self::Mips64 => sym::mips64,
1940            Self::Mips64r6 => sym::mips64r6,
1941            Self::Msp430 => sym::msp430,
1942            Self::Nvptx64 => sym::nvptx64,
1943            Self::PowerPC => sym::powerpc,
1944            Self::PowerPC64 => sym::powerpc64,
1945            Self::RiscV32 => sym::riscv32,
1946            Self::RiscV64 => sym::riscv64,
1947            Self::S390x => sym::s390x,
1948            Self::Sparc => sym::sparc,
1949            Self::Sparc64 => sym::sparc64,
1950            Self::SpirV => sym::spirv,
1951            Self::Wasm32 => sym::wasm32,
1952            Self::Wasm64 => sym::wasm64,
1953            Self::X86 => sym::x86,
1954            Self::X86_64 => sym::x86_64,
1955            Self::Xtensa => sym::xtensa,
1956            Self::Other(name) => rustc_span::Symbol::intern(name),
1957        }
1958    }
1959
1960    /// Whether `#[rustc_scalable_vector]` is supported for a target architecture
1961    pub fn supports_scalable_vectors(&self) -> bool {
1962        use Arch::*;
1963
1964        match self {
1965            AArch64 | RiscV32 | RiscV64 => true,
1966            AmdGpu | Arm | Arm64EC | Avr | Bpf | CSky | Hexagon | LoongArch32 | LoongArch64
1967            | M68k | Mips | Mips32r6 | Mips64 | Mips64r6 | Msp430 | Nvptx64 | PowerPC
1968            | PowerPC64 | S390x | Sparc | Sparc64 | SpirV | Wasm32 | Wasm64 | X86 | X86_64
1969            | Xtensa | Other(_) => false,
1970        }
1971    }
1972}
1973
1974pub enum Os {
    Aix,
    AmdHsa,
    Android,
    Cuda,
    Cygwin,
    Dragonfly,
    Emscripten,
    EspIdf,
    FreeBsd,
    Fuchsia,
    Haiku,
    HelenOs,
    Hermit,
    Horizon,
    Hurd,
    Illumos,
    IOs,
    L4Re,
    Linux,
    LynxOs178,
    MacOs,
    Managarm,
    Motor,
    NetBsd,
    None,
    Nto,
    NuttX,
    OpenBsd,
    Psp,
    Psx,
    Qnx,
    Qurt,
    Redox,
    Rtems,
    Solaris,
    SolidAsp3,
    TeeOs,
    Trusty,
    TvOs,
    Uefi,
    VexOs,
    VisionOs,
    Vita,
    VxWorks,
    Wasi,
    WatchOs,
    Windows,
    Xous,
    Zkvm,
    Unknown,

    /// The vast majority of the time, the compiler deals with a fixed
    /// set of values, so it is convenient for them to be represented in
    /// an enum. However, it is possible to have arbitrary values in a
    /// target JSON file (which can be parsed when `--target` is
    /// specified). This might occur, for example, for an out-of-tree
    /// codegen backend that supports a value (e.g. architecture or OS)
    /// that rustc currently doesn't know about. This variant exists as
    /// an escape hatch for such cases.
    Other(crate::spec::StaticCow<str>),
}
#[automatically_derived]
impl ::core::clone::Clone for Os {
    #[inline]
    fn clone(&self) -> Os {
        match self {
            Os::Aix => Os::Aix,
            Os::AmdHsa => Os::AmdHsa,
            Os::Android => Os::Android,
            Os::Cuda => Os::Cuda,
            Os::Cygwin => Os::Cygwin,
            Os::Dragonfly => Os::Dragonfly,
            Os::Emscripten => Os::Emscripten,
            Os::EspIdf => Os::EspIdf,
            Os::FreeBsd => Os::FreeBsd,
            Os::Fuchsia => Os::Fuchsia,
            Os::Haiku => Os::Haiku,
            Os::HelenOs => Os::HelenOs,
            Os::Hermit => Os::Hermit,
            Os::Horizon => Os::Horizon,
            Os::Hurd => Os::Hurd,
            Os::Illumos => Os::Illumos,
            Os::IOs => Os::IOs,
            Os::L4Re => Os::L4Re,
            Os::Linux => Os::Linux,
            Os::LynxOs178 => Os::LynxOs178,
            Os::MacOs => Os::MacOs,
            Os::Managarm => Os::Managarm,
            Os::Motor => Os::Motor,
            Os::NetBsd => Os::NetBsd,
            Os::None => Os::None,
            Os::Nto => Os::Nto,
            Os::NuttX => Os::NuttX,
            Os::OpenBsd => Os::OpenBsd,
            Os::Psp => Os::Psp,
            Os::Psx => Os::Psx,
            Os::Qnx => Os::Qnx,
            Os::Qurt => Os::Qurt,
            Os::Redox => Os::Redox,
            Os::Rtems => Os::Rtems,
            Os::Solaris => Os::Solaris,
            Os::SolidAsp3 => Os::SolidAsp3,
            Os::TeeOs => Os::TeeOs,
            Os::Trusty => Os::Trusty,
            Os::TvOs => Os::TvOs,
            Os::Uefi => Os::Uefi,
            Os::VexOs => Os::VexOs,
            Os::VisionOs => Os::VisionOs,
            Os::Vita => Os::Vita,
            Os::VxWorks => Os::VxWorks,
            Os::Wasi => Os::Wasi,
            Os::WatchOs => Os::WatchOs,
            Os::Windows => Os::Windows,
            Os::Xous => Os::Xous,
            Os::Zkvm => Os::Zkvm,
            Os::Unknown => Os::Unknown,
            Os::Other(__self_0) =>
                Os::Other(::core::clone::Clone::clone(__self_0)),
        }
    }
}
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for Os { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Os {
    #[inline]
    fn eq(&self, other: &Os) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (Os::Other(__self_0), Os::Other(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for Os {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<crate::spec::StaticCow<str>>;
    }
}
#[automatically_derived]
impl ::core::hash::Hash for Os {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            Os::Other(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for Os {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Os::Aix => ::core::fmt::Formatter::write_str(f, "Aix"),
            Os::AmdHsa => ::core::fmt::Formatter::write_str(f, "AmdHsa"),
            Os::Android => ::core::fmt::Formatter::write_str(f, "Android"),
            Os::Cuda => ::core::fmt::Formatter::write_str(f, "Cuda"),
            Os::Cygwin => ::core::fmt::Formatter::write_str(f, "Cygwin"),
            Os::Dragonfly =>
                ::core::fmt::Formatter::write_str(f, "Dragonfly"),
            Os::Emscripten =>
                ::core::fmt::Formatter::write_str(f, "Emscripten"),
            Os::EspIdf => ::core::fmt::Formatter::write_str(f, "EspIdf"),
            Os::FreeBsd => ::core::fmt::Formatter::write_str(f, "FreeBsd"),
            Os::Fuchsia => ::core::fmt::Formatter::write_str(f, "Fuchsia"),
            Os::Haiku => ::core::fmt::Formatter::write_str(f, "Haiku"),
            Os::HelenOs => ::core::fmt::Formatter::write_str(f, "HelenOs"),
            Os::Hermit => ::core::fmt::Formatter::write_str(f, "Hermit"),
            Os::Horizon => ::core::fmt::Formatter::write_str(f, "Horizon"),
            Os::Hurd => ::core::fmt::Formatter::write_str(f, "Hurd"),
            Os::Illumos => ::core::fmt::Formatter::write_str(f, "Illumos"),
            Os::IOs => ::core::fmt::Formatter::write_str(f, "IOs"),
            Os::L4Re => ::core::fmt::Formatter::write_str(f, "L4Re"),
            Os::Linux => ::core::fmt::Formatter::write_str(f, "Linux"),
            Os::LynxOs178 =>
                ::core::fmt::Formatter::write_str(f, "LynxOs178"),
            Os::MacOs => ::core::fmt::Formatter::write_str(f, "MacOs"),
            Os::Managarm => ::core::fmt::Formatter::write_str(f, "Managarm"),
            Os::Motor => ::core::fmt::Formatter::write_str(f, "Motor"),
            Os::NetBsd => ::core::fmt::Formatter::write_str(f, "NetBsd"),
            Os::None => ::core::fmt::Formatter::write_str(f, "None"),
            Os::Nto => ::core::fmt::Formatter::write_str(f, "Nto"),
            Os::NuttX => ::core::fmt::Formatter::write_str(f, "NuttX"),
            Os::OpenBsd => ::core::fmt::Formatter::write_str(f, "OpenBsd"),
            Os::Psp => ::core::fmt::Formatter::write_str(f, "Psp"),
            Os::Psx => ::core::fmt::Formatter::write_str(f, "Psx"),
            Os::Qnx => ::core::fmt::Formatter::write_str(f, "Qnx"),
            Os::Qurt => ::core::fmt::Formatter::write_str(f, "Qurt"),
            Os::Redox => ::core::fmt::Formatter::write_str(f, "Redox"),
            Os::Rtems => ::core::fmt::Formatter::write_str(f, "Rtems"),
            Os::Solaris => ::core::fmt::Formatter::write_str(f, "Solaris"),
            Os::SolidAsp3 =>
                ::core::fmt::Formatter::write_str(f, "SolidAsp3"),
            Os::TeeOs => ::core::fmt::Formatter::write_str(f, "TeeOs"),
            Os::Trusty => ::core::fmt::Formatter::write_str(f, "Trusty"),
            Os::TvOs => ::core::fmt::Formatter::write_str(f, "TvOs"),
            Os::Uefi => ::core::fmt::Formatter::write_str(f, "Uefi"),
            Os::VexOs => ::core::fmt::Formatter::write_str(f, "VexOs"),
            Os::VisionOs => ::core::fmt::Formatter::write_str(f, "VisionOs"),
            Os::Vita => ::core::fmt::Formatter::write_str(f, "Vita"),
            Os::VxWorks => ::core::fmt::Formatter::write_str(f, "VxWorks"),
            Os::Wasi => ::core::fmt::Formatter::write_str(f, "Wasi"),
            Os::WatchOs => ::core::fmt::Formatter::write_str(f, "WatchOs"),
            Os::Windows => ::core::fmt::Formatter::write_str(f, "Windows"),
            Os::Xous => ::core::fmt::Formatter::write_str(f, "Xous"),
            Os::Zkvm => ::core::fmt::Formatter::write_str(f, "Zkvm"),
            Os::Unknown => ::core::fmt::Formatter::write_str(f, "Unknown"),
            Os::Other(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Other",
                    &__self_0),
        }
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for Os {
    #[inline]
    fn partial_cmp(&self, other: &Os)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for Os {
    #[inline]
    fn cmp(&self, other: &Os) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (Os::Other(__self_0), Os::Other(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}
impl schemars::JsonSchema for Os {
    fn schema_name() -> std::borrow::Cow<'static, str> {
        std::borrow::Cow::Borrowed("Os")
    }
    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
        <::schemars::Schema as
                    ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                        let mut object = ::serde_json::Map::new();
                        let _ =
                            object.insert(("type").into(),
                                ::serde_json::to_value(&"string").unwrap());
                        object
                    })).unwrap()
    }
}
impl FromStr for Os {
    type Err = core::convert::Infallible;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "aix" => Self::Aix,
                "amdhsa" => Self::AmdHsa,
                "android" => Self::Android,
                "cuda" => Self::Cuda,
                "cygwin" => Self::Cygwin,
                "dragonfly" => Self::Dragonfly,
                "emscripten" => Self::Emscripten,
                "espidf" => Self::EspIdf,
                "freebsd" => Self::FreeBsd,
                "fuchsia" => Self::Fuchsia,
                "haiku" => Self::Haiku,
                "helenos" => Self::HelenOs,
                "hermit" => Self::Hermit,
                "horizon" => Self::Horizon,
                "hurd" => Self::Hurd,
                "illumos" => Self::Illumos,
                "ios" => Self::IOs,
                "l4re" => Self::L4Re,
                "linux" => Self::Linux,
                "lynxos178" => Self::LynxOs178,
                "macos" => Self::MacOs,
                "managarm" => Self::Managarm,
                "motor" => Self::Motor,
                "netbsd" => Self::NetBsd,
                "none" => Self::None,
                "nto" => Self::Nto,
                "nuttx" => Self::NuttX,
                "openbsd" => Self::OpenBsd,
                "psp" => Self::Psp,
                "psx" => Self::Psx,
                "qnx" => Self::Qnx,
                "qurt" => Self::Qurt,
                "redox" => Self::Redox,
                "rtems" => Self::Rtems,
                "solaris" => Self::Solaris,
                "solid_asp3" => Self::SolidAsp3,
                "teeos" => Self::TeeOs,
                "trusty" => Self::Trusty,
                "tvos" => Self::TvOs,
                "uefi" => Self::Uefi,
                "vexos" => Self::VexOs,
                "visionos" => Self::VisionOs,
                "vita" => Self::Vita,
                "vxworks" => Self::VxWorks,
                "wasi" => Self::Wasi,
                "watchos" => Self::WatchOs,
                "windows" => Self::Windows,
                "xous" => Self::Xous,
                "zkvm" => Self::Zkvm,
                "unknown" => Self::Unknown,
                _ => Self::Other(s.to_owned().into()),
            })
    }
}
impl Os {
    pub fn desc(&self) -> &str {
        match self {
            Self::Aix => "aix",
            Self::AmdHsa => "amdhsa",
            Self::Android => "android",
            Self::Cuda => "cuda",
            Self::Cygwin => "cygwin",
            Self::Dragonfly => "dragonfly",
            Self::Emscripten => "emscripten",
            Self::EspIdf => "espidf",
            Self::FreeBsd => "freebsd",
            Self::Fuchsia => "fuchsia",
            Self::Haiku => "haiku",
            Self::HelenOs => "helenos",
            Self::Hermit => "hermit",
            Self::Horizon => "horizon",
            Self::Hurd => "hurd",
            Self::Illumos => "illumos",
            Self::IOs => "ios",
            Self::L4Re => "l4re",
            Self::Linux => "linux",
            Self::LynxOs178 => "lynxos178",
            Self::MacOs => "macos",
            Self::Managarm => "managarm",
            Self::Motor => "motor",
            Self::NetBsd => "netbsd",
            Self::None => "none",
            Self::Nto => "nto",
            Self::NuttX => "nuttx",
            Self::OpenBsd => "openbsd",
            Self::Psp => "psp",
            Self::Psx => "psx",
            Self::Qnx => "qnx",
            Self::Qurt => "qurt",
            Self::Redox => "redox",
            Self::Rtems => "rtems",
            Self::Solaris => "solaris",
            Self::SolidAsp3 => "solid_asp3",
            Self::TeeOs => "teeos",
            Self::Trusty => "trusty",
            Self::TvOs => "tvos",
            Self::Uefi => "uefi",
            Self::VexOs => "vexos",
            Self::VisionOs => "visionos",
            Self::Vita => "vita",
            Self::VxWorks => "vxworks",
            Self::Wasi => "wasi",
            Self::WatchOs => "watchos",
            Self::Windows => "windows",
            Self::Xous => "xous",
            Self::Zkvm => "zkvm",
            Self::Unknown => "unknown",
            Self::Other(name) => name.as_ref(),
        }
    }
}
impl crate::json::ToJson for Os {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for Os {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for Os {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
1975    pub enum Os {
1976        Aix = "aix",
1977        AmdHsa = "amdhsa",
1978        Android = "android",
1979        Cuda = "cuda",
1980        Cygwin = "cygwin",
1981        Dragonfly = "dragonfly",
1982        Emscripten = "emscripten",
1983        EspIdf = "espidf",
1984        FreeBsd = "freebsd",
1985        Fuchsia = "fuchsia",
1986        Haiku = "haiku",
1987        HelenOs = "helenos",
1988        Hermit = "hermit",
1989        Horizon = "horizon",
1990        Hurd = "hurd",
1991        Illumos = "illumos",
1992        IOs = "ios",
1993        L4Re = "l4re",
1994        Linux = "linux",
1995        LynxOs178 = "lynxos178",
1996        MacOs = "macos",
1997        Managarm = "managarm",
1998        Motor = "motor",
1999        NetBsd = "netbsd",
2000        None = "none",
2001        Nto = "nto",
2002        NuttX = "nuttx",
2003        OpenBsd = "openbsd",
2004        Psp = "psp",
2005        Psx = "psx",
2006        Qnx = "qnx",
2007        Qurt = "qurt",
2008        Redox = "redox",
2009        Rtems = "rtems",
2010        Solaris = "solaris",
2011        SolidAsp3 = "solid_asp3",
2012        TeeOs = "teeos",
2013        Trusty = "trusty",
2014        TvOs = "tvos",
2015        Uefi = "uefi",
2016        VexOs = "vexos",
2017        VisionOs = "visionos",
2018        Vita = "vita",
2019        VxWorks = "vxworks",
2020        Wasi = "wasi",
2021        WatchOs = "watchos",
2022        Windows = "windows",
2023        Xous = "xous",
2024        Zkvm = "zkvm",
2025        Unknown = "unknown",
2026    }
2027    other_variant = Other;
2028}
2029
2030impl Os {
2031    pub fn desc_symbol(&self) -> Symbol {
2032        Symbol::intern(self.desc())
2033    }
2034}
2035
2036pub enum Env {
    Gnu,
    MacAbi,
    Mlibc,
    Msvc,
    Musl,
    Newlib,
    Nto70,
    Nto71,
    Nto71IoSock,
    Ohos,
    Relibc,
    Sgx,
    Sim,
    P1,
    P2,
    P3,
    Uclibc,
    V5,
    Unspecified,

    /// The vast majority of the time, the compiler deals with a fixed
    /// set of values, so it is convenient for them to be represented in
    /// an enum. However, it is possible to have arbitrary values in a
    /// target JSON file (which can be parsed when `--target` is
    /// specified). This might occur, for example, for an out-of-tree
    /// codegen backend that supports a value (e.g. architecture or OS)
    /// that rustc currently doesn't know about. This variant exists as
    /// an escape hatch for such cases.
    Other(crate::spec::StaticCow<str>),
}
#[automatically_derived]
impl ::core::clone::Clone for Env {
    #[inline]
    fn clone(&self) -> Env {
        match self {
            Env::Gnu => Env::Gnu,
            Env::MacAbi => Env::MacAbi,
            Env::Mlibc => Env::Mlibc,
            Env::Msvc => Env::Msvc,
            Env::Musl => Env::Musl,
            Env::Newlib => Env::Newlib,
            Env::Nto70 => Env::Nto70,
            Env::Nto71 => Env::Nto71,
            Env::Nto71IoSock => Env::Nto71IoSock,
            Env::Ohos => Env::Ohos,
            Env::Relibc => Env::Relibc,
            Env::Sgx => Env::Sgx,
            Env::Sim => Env::Sim,
            Env::P1 => Env::P1,
            Env::P2 => Env::P2,
            Env::P3 => Env::P3,
            Env::Uclibc => Env::Uclibc,
            Env::V5 => Env::V5,
            Env::Unspecified => Env::Unspecified,
            Env::Other(__self_0) =>
                Env::Other(::core::clone::Clone::clone(__self_0)),
        }
    }
}
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for Env { }
#[automatically_derived]
impl ::core::cmp::PartialEq for Env {
    #[inline]
    fn eq(&self, other: &Env) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (Env::Other(__self_0), Env::Other(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for Env {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<crate::spec::StaticCow<str>>;
    }
}
#[automatically_derived]
impl ::core::hash::Hash for Env {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            Env::Other(__self_0) => ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for Env {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            Env::Gnu => ::core::fmt::Formatter::write_str(f, "Gnu"),
            Env::MacAbi => ::core::fmt::Formatter::write_str(f, "MacAbi"),
            Env::Mlibc => ::core::fmt::Formatter::write_str(f, "Mlibc"),
            Env::Msvc => ::core::fmt::Formatter::write_str(f, "Msvc"),
            Env::Musl => ::core::fmt::Formatter::write_str(f, "Musl"),
            Env::Newlib => ::core::fmt::Formatter::write_str(f, "Newlib"),
            Env::Nto70 => ::core::fmt::Formatter::write_str(f, "Nto70"),
            Env::Nto71 => ::core::fmt::Formatter::write_str(f, "Nto71"),
            Env::Nto71IoSock =>
                ::core::fmt::Formatter::write_str(f, "Nto71IoSock"),
            Env::Ohos => ::core::fmt::Formatter::write_str(f, "Ohos"),
            Env::Relibc => ::core::fmt::Formatter::write_str(f, "Relibc"),
            Env::Sgx => ::core::fmt::Formatter::write_str(f, "Sgx"),
            Env::Sim => ::core::fmt::Formatter::write_str(f, "Sim"),
            Env::P1 => ::core::fmt::Formatter::write_str(f, "P1"),
            Env::P2 => ::core::fmt::Formatter::write_str(f, "P2"),
            Env::P3 => ::core::fmt::Formatter::write_str(f, "P3"),
            Env::Uclibc => ::core::fmt::Formatter::write_str(f, "Uclibc"),
            Env::V5 => ::core::fmt::Formatter::write_str(f, "V5"),
            Env::Unspecified =>
                ::core::fmt::Formatter::write_str(f, "Unspecified"),
            Env::Other(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Other",
                    &__self_0),
        }
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for Env {
    #[inline]
    fn partial_cmp(&self, other: &Env)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for Env {
    #[inline]
    fn cmp(&self, other: &Env) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (Env::Other(__self_0), Env::Other(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}
impl schemars::JsonSchema for Env {
    fn schema_name() -> std::borrow::Cow<'static, str> {
        std::borrow::Cow::Borrowed("Env")
    }
    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
        <::schemars::Schema as
                    ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                        let mut object = ::serde_json::Map::new();
                        let _ =
                            object.insert(("type").into(),
                                ::serde_json::to_value(&"string").unwrap());
                        object
                    })).unwrap()
    }
}
impl FromStr for Env {
    type Err = core::convert::Infallible;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "gnu" => Self::Gnu,
                "macabi" => Self::MacAbi,
                "mlibc" => Self::Mlibc,
                "msvc" => Self::Msvc,
                "musl" => Self::Musl,
                "newlib" => Self::Newlib,
                "nto70" => Self::Nto70,
                "nto71" => Self::Nto71,
                "nto71_iosock" => Self::Nto71IoSock,
                "ohos" => Self::Ohos,
                "relibc" => Self::Relibc,
                "sgx" => Self::Sgx,
                "sim" => Self::Sim,
                "p1" => Self::P1,
                "p2" => Self::P2,
                "p3" => Self::P3,
                "uclibc" => Self::Uclibc,
                "v5" => Self::V5,
                "" => Self::Unspecified,
                _ => Self::Other(s.to_owned().into()),
            })
    }
}
impl Env {
    pub fn desc(&self) -> &str {
        match self {
            Self::Gnu => "gnu",
            Self::MacAbi => "macabi",
            Self::Mlibc => "mlibc",
            Self::Msvc => "msvc",
            Self::Musl => "musl",
            Self::Newlib => "newlib",
            Self::Nto70 => "nto70",
            Self::Nto71 => "nto71",
            Self::Nto71IoSock => "nto71_iosock",
            Self::Ohos => "ohos",
            Self::Relibc => "relibc",
            Self::Sgx => "sgx",
            Self::Sim => "sim",
            Self::P1 => "p1",
            Self::P2 => "p2",
            Self::P3 => "p3",
            Self::Uclibc => "uclibc",
            Self::V5 => "v5",
            Self::Unspecified => "",
            Self::Other(name) => name.as_ref(),
        }
    }
}
impl crate::json::ToJson for Env {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for Env {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for Env {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
2037    pub enum Env {
2038        Gnu = "gnu",
2039        MacAbi = "macabi",
2040        Mlibc = "mlibc",
2041        Msvc = "msvc",
2042        Musl = "musl",
2043        Newlib = "newlib",
2044        Nto70 = "nto70",
2045        Nto71 = "nto71",
2046        Nto71IoSock = "nto71_iosock",
2047        Ohos = "ohos",
2048        Relibc = "relibc",
2049        Sgx = "sgx",
2050        Sim = "sim",
2051        P1 = "p1",
2052        P2 = "p2",
2053        P3 = "p3",
2054        Uclibc = "uclibc",
2055        V5 = "v5",
2056        Unspecified = "",
2057    }
2058    other_variant = Other;
2059}
2060
2061impl Env {
2062    pub fn desc_symbol(&self) -> Symbol {
2063        Symbol::intern(self.desc())
2064    }
2065}
2066
2067#[doc = r" An enum representing possible values for `cfg(target_abi)`."]
#[doc =
r" This field is not forwarded to LLVM so it does not by itself affect codegen."]
#[doc = r" See the `cfg_abi` field of [`TargetOptions`] for more details."]
pub enum CfgAbi {
    Abi64,
    AbiV2,
    AbiV2Hf,
    Eabi,
    EabiHf,
    ElfV1,
    ElfV2,
    Fortanix,
    Ilp32,
    Ilp32e,
    Llvm,
    MacAbi,
    Pauthtest,
    Sim,
    SoftFloat,
    Spe,
    Uwp,
    VecDefault,
    VecExtAbi,
    X32,
    Unspecified,

    /// The vast majority of the time, the compiler deals with a fixed
    /// set of values, so it is convenient for them to be represented in
    /// an enum. However, it is possible to have arbitrary values in a
    /// target JSON file (which can be parsed when `--target` is
    /// specified). This might occur, for example, for an out-of-tree
    /// codegen backend that supports a value (e.g. architecture or OS)
    /// that rustc currently doesn't know about. This variant exists as
    /// an escape hatch for such cases.
    Other(crate::spec::StaticCow<str>),
}
#[automatically_derived]
impl ::core::clone::Clone for CfgAbi {
    #[inline]
    fn clone(&self) -> CfgAbi {
        match self {
            CfgAbi::Abi64 => CfgAbi::Abi64,
            CfgAbi::AbiV2 => CfgAbi::AbiV2,
            CfgAbi::AbiV2Hf => CfgAbi::AbiV2Hf,
            CfgAbi::Eabi => CfgAbi::Eabi,
            CfgAbi::EabiHf => CfgAbi::EabiHf,
            CfgAbi::ElfV1 => CfgAbi::ElfV1,
            CfgAbi::ElfV2 => CfgAbi::ElfV2,
            CfgAbi::Fortanix => CfgAbi::Fortanix,
            CfgAbi::Ilp32 => CfgAbi::Ilp32,
            CfgAbi::Ilp32e => CfgAbi::Ilp32e,
            CfgAbi::Llvm => CfgAbi::Llvm,
            CfgAbi::MacAbi => CfgAbi::MacAbi,
            CfgAbi::Pauthtest => CfgAbi::Pauthtest,
            CfgAbi::Sim => CfgAbi::Sim,
            CfgAbi::SoftFloat => CfgAbi::SoftFloat,
            CfgAbi::Spe => CfgAbi::Spe,
            CfgAbi::Uwp => CfgAbi::Uwp,
            CfgAbi::VecDefault => CfgAbi::VecDefault,
            CfgAbi::VecExtAbi => CfgAbi::VecExtAbi,
            CfgAbi::X32 => CfgAbi::X32,
            CfgAbi::Unspecified => CfgAbi::Unspecified,
            CfgAbi::Other(__self_0) =>
                CfgAbi::Other(::core::clone::Clone::clone(__self_0)),
        }
    }
}
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for CfgAbi { }
#[automatically_derived]
impl ::core::cmp::PartialEq for CfgAbi {
    #[inline]
    fn eq(&self, other: &CfgAbi) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (CfgAbi::Other(__self_0), CfgAbi::Other(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for CfgAbi {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<crate::spec::StaticCow<str>>;
    }
}
#[automatically_derived]
impl ::core::hash::Hash for CfgAbi {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            CfgAbi::Other(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for CfgAbi {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            CfgAbi::Abi64 => ::core::fmt::Formatter::write_str(f, "Abi64"),
            CfgAbi::AbiV2 => ::core::fmt::Formatter::write_str(f, "AbiV2"),
            CfgAbi::AbiV2Hf =>
                ::core::fmt::Formatter::write_str(f, "AbiV2Hf"),
            CfgAbi::Eabi => ::core::fmt::Formatter::write_str(f, "Eabi"),
            CfgAbi::EabiHf => ::core::fmt::Formatter::write_str(f, "EabiHf"),
            CfgAbi::ElfV1 => ::core::fmt::Formatter::write_str(f, "ElfV1"),
            CfgAbi::ElfV2 => ::core::fmt::Formatter::write_str(f, "ElfV2"),
            CfgAbi::Fortanix =>
                ::core::fmt::Formatter::write_str(f, "Fortanix"),
            CfgAbi::Ilp32 => ::core::fmt::Formatter::write_str(f, "Ilp32"),
            CfgAbi::Ilp32e => ::core::fmt::Formatter::write_str(f, "Ilp32e"),
            CfgAbi::Llvm => ::core::fmt::Formatter::write_str(f, "Llvm"),
            CfgAbi::MacAbi => ::core::fmt::Formatter::write_str(f, "MacAbi"),
            CfgAbi::Pauthtest =>
                ::core::fmt::Formatter::write_str(f, "Pauthtest"),
            CfgAbi::Sim => ::core::fmt::Formatter::write_str(f, "Sim"),
            CfgAbi::SoftFloat =>
                ::core::fmt::Formatter::write_str(f, "SoftFloat"),
            CfgAbi::Spe => ::core::fmt::Formatter::write_str(f, "Spe"),
            CfgAbi::Uwp => ::core::fmt::Formatter::write_str(f, "Uwp"),
            CfgAbi::VecDefault =>
                ::core::fmt::Formatter::write_str(f, "VecDefault"),
            CfgAbi::VecExtAbi =>
                ::core::fmt::Formatter::write_str(f, "VecExtAbi"),
            CfgAbi::X32 => ::core::fmt::Formatter::write_str(f, "X32"),
            CfgAbi::Unspecified =>
                ::core::fmt::Formatter::write_str(f, "Unspecified"),
            CfgAbi::Other(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Other",
                    &__self_0),
        }
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for CfgAbi {
    #[inline]
    fn partial_cmp(&self, other: &CfgAbi)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for CfgAbi {
    #[inline]
    fn cmp(&self, other: &CfgAbi) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (CfgAbi::Other(__self_0), CfgAbi::Other(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}
impl schemars::JsonSchema for CfgAbi {
    fn schema_name() -> std::borrow::Cow<'static, str> {
        std::borrow::Cow::Borrowed("CfgAbi")
    }
    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
        <::schemars::Schema as
                    ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                        let mut object = ::serde_json::Map::new();
                        let _ =
                            object.insert(("type").into(),
                                ::serde_json::to_value(&"string").unwrap());
                        object
                    })).unwrap()
    }
}
impl FromStr for CfgAbi {
    type Err = core::convert::Infallible;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "abi64" => Self::Abi64,
                "abiv2" => Self::AbiV2,
                "abiv2hf" => Self::AbiV2Hf,
                "eabi" => Self::Eabi,
                "eabihf" => Self::EabiHf,
                "elfv1" => Self::ElfV1,
                "elfv2" => Self::ElfV2,
                "fortanix" => Self::Fortanix,
                "ilp32" => Self::Ilp32,
                "ilp32e" => Self::Ilp32e,
                "llvm" => Self::Llvm,
                "macabi" => Self::MacAbi,
                "pauthtest" => Self::Pauthtest,
                "sim" => Self::Sim,
                "softfloat" => Self::SoftFloat,
                "spe" => Self::Spe,
                "uwp" => Self::Uwp,
                "vec-default" => Self::VecDefault,
                "vec-extabi" => Self::VecExtAbi,
                "x32" => Self::X32,
                "" => Self::Unspecified,
                _ => Self::Other(s.to_owned().into()),
            })
    }
}
impl CfgAbi {
    pub fn desc(&self) -> &str {
        match self {
            Self::Abi64 => "abi64",
            Self::AbiV2 => "abiv2",
            Self::AbiV2Hf => "abiv2hf",
            Self::Eabi => "eabi",
            Self::EabiHf => "eabihf",
            Self::ElfV1 => "elfv1",
            Self::ElfV2 => "elfv2",
            Self::Fortanix => "fortanix",
            Self::Ilp32 => "ilp32",
            Self::Ilp32e => "ilp32e",
            Self::Llvm => "llvm",
            Self::MacAbi => "macabi",
            Self::Pauthtest => "pauthtest",
            Self::Sim => "sim",
            Self::SoftFloat => "softfloat",
            Self::Spe => "spe",
            Self::Uwp => "uwp",
            Self::VecDefault => "vec-default",
            Self::VecExtAbi => "vec-extabi",
            Self::X32 => "x32",
            Self::Unspecified => "",
            Self::Other(name) => name.as_ref(),
        }
    }
}
impl crate::json::ToJson for CfgAbi {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for CfgAbi {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for CfgAbi {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
2068    /// An enum representing possible values for `cfg(target_abi)`.
2069    /// This field is not forwarded to LLVM so it does not by itself affect codegen.
2070    /// See the `cfg_abi` field of [`TargetOptions`] for more details.
2071    pub enum CfgAbi {
2072        Abi64 = "abi64",
2073        AbiV2 = "abiv2",
2074        AbiV2Hf = "abiv2hf",
2075        Eabi = "eabi",
2076        EabiHf = "eabihf",
2077        ElfV1 = "elfv1",
2078        ElfV2 = "elfv2",
2079        Fortanix = "fortanix",
2080        Ilp32 = "ilp32",
2081        Ilp32e = "ilp32e",
2082        Llvm = "llvm",
2083        MacAbi = "macabi",
2084        Pauthtest = "pauthtest",
2085        Sim = "sim",
2086        SoftFloat = "softfloat",
2087        Spe = "spe",
2088        Uwp = "uwp",
2089        VecDefault = "vec-default",
2090        VecExtAbi = "vec-extabi",
2091        X32 = "x32",
2092        Unspecified = "",
2093    }
2094    other_variant = Other;
2095}
2096
2097impl CfgAbi {
2098    pub fn desc_symbol(&self) -> Symbol {
2099        Symbol::intern(self.desc())
2100    }
2101}
2102
2103#[doc =
r" An enum representing possible values for the `llvm_abiname` field of [`TargetOptions`]."]
#[doc =
r" This field is used by LLVM on some targets to control which ABI to use."]
pub enum LlvmAbi {
    Ilp32,
    Ilp32f,
    Ilp32d,
    Ilp32e,
    Ilp32s,
    Lp64,
    Lp64f,
    Lp64d,
    Lp64e,
    Lp64s,
    O32,
    N32,
    N64,
    ElfV1,
    ElfV2,
    Pauthtest,
    Unspecified,

    /// The vast majority of the time, the compiler deals with a fixed
    /// set of values, so it is convenient for them to be represented in
    /// an enum. However, it is possible to have arbitrary values in a
    /// target JSON file (which can be parsed when `--target` is
    /// specified). This might occur, for example, for an out-of-tree
    /// codegen backend that supports a value (e.g. architecture or OS)
    /// that rustc currently doesn't know about. This variant exists as
    /// an escape hatch for such cases.
    Other(crate::spec::StaticCow<str>),
}
#[automatically_derived]
impl ::core::clone::Clone for LlvmAbi {
    #[inline]
    fn clone(&self) -> LlvmAbi {
        match self {
            LlvmAbi::Ilp32 => LlvmAbi::Ilp32,
            LlvmAbi::Ilp32f => LlvmAbi::Ilp32f,
            LlvmAbi::Ilp32d => LlvmAbi::Ilp32d,
            LlvmAbi::Ilp32e => LlvmAbi::Ilp32e,
            LlvmAbi::Ilp32s => LlvmAbi::Ilp32s,
            LlvmAbi::Lp64 => LlvmAbi::Lp64,
            LlvmAbi::Lp64f => LlvmAbi::Lp64f,
            LlvmAbi::Lp64d => LlvmAbi::Lp64d,
            LlvmAbi::Lp64e => LlvmAbi::Lp64e,
            LlvmAbi::Lp64s => LlvmAbi::Lp64s,
            LlvmAbi::O32 => LlvmAbi::O32,
            LlvmAbi::N32 => LlvmAbi::N32,
            LlvmAbi::N64 => LlvmAbi::N64,
            LlvmAbi::ElfV1 => LlvmAbi::ElfV1,
            LlvmAbi::ElfV2 => LlvmAbi::ElfV2,
            LlvmAbi::Pauthtest => LlvmAbi::Pauthtest,
            LlvmAbi::Unspecified => LlvmAbi::Unspecified,
            LlvmAbi::Other(__self_0) =>
                LlvmAbi::Other(::core::clone::Clone::clone(__self_0)),
        }
    }
}
#[automatically_derived]
impl ::core::marker::StructuralPartialEq for LlvmAbi { }
#[automatically_derived]
impl ::core::cmp::PartialEq for LlvmAbi {
    #[inline]
    fn eq(&self, other: &LlvmAbi) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (LlvmAbi::Other(__self_0), LlvmAbi::Other(__arg1_0)) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}
#[automatically_derived]
impl ::core::cmp::Eq for LlvmAbi {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<crate::spec::StaticCow<str>>;
    }
}
#[automatically_derived]
impl ::core::hash::Hash for LlvmAbi {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            LlvmAbi::Other(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}
#[automatically_derived]
impl ::core::fmt::Debug for LlvmAbi {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            LlvmAbi::Ilp32 => ::core::fmt::Formatter::write_str(f, "Ilp32"),
            LlvmAbi::Ilp32f => ::core::fmt::Formatter::write_str(f, "Ilp32f"),
            LlvmAbi::Ilp32d => ::core::fmt::Formatter::write_str(f, "Ilp32d"),
            LlvmAbi::Ilp32e => ::core::fmt::Formatter::write_str(f, "Ilp32e"),
            LlvmAbi::Ilp32s => ::core::fmt::Formatter::write_str(f, "Ilp32s"),
            LlvmAbi::Lp64 => ::core::fmt::Formatter::write_str(f, "Lp64"),
            LlvmAbi::Lp64f => ::core::fmt::Formatter::write_str(f, "Lp64f"),
            LlvmAbi::Lp64d => ::core::fmt::Formatter::write_str(f, "Lp64d"),
            LlvmAbi::Lp64e => ::core::fmt::Formatter::write_str(f, "Lp64e"),
            LlvmAbi::Lp64s => ::core::fmt::Formatter::write_str(f, "Lp64s"),
            LlvmAbi::O32 => ::core::fmt::Formatter::write_str(f, "O32"),
            LlvmAbi::N32 => ::core::fmt::Formatter::write_str(f, "N32"),
            LlvmAbi::N64 => ::core::fmt::Formatter::write_str(f, "N64"),
            LlvmAbi::ElfV1 => ::core::fmt::Formatter::write_str(f, "ElfV1"),
            LlvmAbi::ElfV2 => ::core::fmt::Formatter::write_str(f, "ElfV2"),
            LlvmAbi::Pauthtest =>
                ::core::fmt::Formatter::write_str(f, "Pauthtest"),
            LlvmAbi::Unspecified =>
                ::core::fmt::Formatter::write_str(f, "Unspecified"),
            LlvmAbi::Other(__self_0) =>
                ::core::fmt::Formatter::debug_tuple_field1_finish(f, "Other",
                    &__self_0),
        }
    }
}
#[automatically_derived]
impl ::core::cmp::PartialOrd for LlvmAbi {
    #[inline]
    fn partial_cmp(&self, other: &LlvmAbi)
        -> ::core::option::Option<::core::cmp::Ordering> {
        ::core::option::Option::Some(::core::cmp::Ord::cmp(self, other))
    }
}
#[automatically_derived]
impl ::core::cmp::Ord for LlvmAbi {
    #[inline]
    fn cmp(&self, other: &LlvmAbi) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (LlvmAbi::Other(__self_0), LlvmAbi::Other(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}
impl schemars::JsonSchema for LlvmAbi {
    fn schema_name() -> std::borrow::Cow<'static, str> {
        std::borrow::Cow::Borrowed("LlvmAbi")
    }
    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
        <::schemars::Schema as
                    ::core::convert::TryFrom<_>>::try_from(::serde_json::Value::Object({
                        let mut object = ::serde_json::Map::new();
                        let _ =
                            object.insert(("type").into(),
                                ::serde_json::to_value(&"string").unwrap());
                        object
                    })).unwrap()
    }
}
impl FromStr for LlvmAbi {
    type Err = core::convert::Infallible;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        Ok(match s {
                "ilp32" => Self::Ilp32,
                "ilp32f" => Self::Ilp32f,
                "ilp32d" => Self::Ilp32d,
                "ilp32e" => Self::Ilp32e,
                "ilp32s" => Self::Ilp32s,
                "lp64" => Self::Lp64,
                "lp64f" => Self::Lp64f,
                "lp64d" => Self::Lp64d,
                "lp64e" => Self::Lp64e,
                "lp64s" => Self::Lp64s,
                "o32" => Self::O32,
                "n32" => Self::N32,
                "n64" => Self::N64,
                "elfv1" => Self::ElfV1,
                "elfv2" => Self::ElfV2,
                "pauthtest" => Self::Pauthtest,
                "" => Self::Unspecified,
                _ => Self::Other(s.to_owned().into()),
            })
    }
}
impl LlvmAbi {
    pub fn desc(&self) -> &str {
        match self {
            Self::Ilp32 => "ilp32",
            Self::Ilp32f => "ilp32f",
            Self::Ilp32d => "ilp32d",
            Self::Ilp32e => "ilp32e",
            Self::Ilp32s => "ilp32s",
            Self::Lp64 => "lp64",
            Self::Lp64f => "lp64f",
            Self::Lp64d => "lp64d",
            Self::Lp64e => "lp64e",
            Self::Lp64s => "lp64s",
            Self::O32 => "o32",
            Self::N32 => "n32",
            Self::N64 => "n64",
            Self::ElfV1 => "elfv1",
            Self::ElfV2 => "elfv2",
            Self::Pauthtest => "pauthtest",
            Self::Unspecified => "",
            Self::Other(name) => name.as_ref(),
        }
    }
}
impl crate::json::ToJson for LlvmAbi {
    fn to_json(&self) -> crate::json::Json { self.desc().to_json() }
}
impl<'de> serde::Deserialize<'de> for LlvmAbi {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
        D: serde::Deserializer<'de> {
        let s = String::deserialize(deserializer)?;
        FromStr::from_str(&s).map_err(serde::de::Error::custom)
    }
}
impl std::fmt::Display for LlvmAbi {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.write_str(self.desc())
    }
}crate::target_spec_enum! {
2104    /// An enum representing possible values for the `llvm_abiname` field of [`TargetOptions`].
2105    /// This field is used by LLVM on some targets to control which ABI to use.
2106    pub enum LlvmAbi {
2107        // RISC-V and LoongArch
2108        Ilp32 = "ilp32",
2109        Ilp32f = "ilp32f",
2110        Ilp32d = "ilp32d",
2111        Ilp32e = "ilp32e",
2112        Ilp32s = "ilp32s",
2113        Lp64 = "lp64",
2114        Lp64f = "lp64f",
2115        Lp64d = "lp64d",
2116        Lp64e = "lp64e",
2117        Lp64s = "lp64s",
2118        // MIPS
2119        O32 = "o32",
2120        N32 = "n32",
2121        N64 = "n64",
2122        // PowerPC
2123        ElfV1 = "elfv1",
2124        ElfV2 = "elfv2",
2125        // Pointer authentication: Pauthtest
2126        Pauthtest = "pauthtest",
2127
2128        Unspecified = "",
2129    }
2130    other_variant = Other;
2131}
2132
2133/// Everything `rustc` knows about how to compile for a specific target.
2134///
2135/// Every field here must be specified, and has no default value.
2136#[derive(#[automatically_derived]
impl ::core::cmp::PartialEq for Target {
    #[inline]
    fn eq(&self, other: &Target) -> bool {
        self.pointer_width == other.pointer_width &&
                            self.llvm_target == other.llvm_target &&
                        self.metadata == other.metadata && self.arch == other.arch
                && self.data_layout == other.data_layout &&
            self.options == other.options
    }
}PartialEq, #[automatically_derived]
impl ::core::clone::Clone for Target {
    #[inline]
    fn clone(&self) -> Target {
        Target {
            llvm_target: ::core::clone::Clone::clone(&self.llvm_target),
            metadata: ::core::clone::Clone::clone(&self.metadata),
            pointer_width: ::core::clone::Clone::clone(&self.pointer_width),
            arch: ::core::clone::Clone::clone(&self.arch),
            data_layout: ::core::clone::Clone::clone(&self.data_layout),
            options: ::core::clone::Clone::clone(&self.options),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Target {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        let names: &'static _ =
            &["llvm_target", "metadata", "pointer_width", "arch",
                        "data_layout", "options"];
        let values: &[&dyn ::core::fmt::Debug] =
            &[&self.llvm_target, &self.metadata, &self.pointer_width,
                        &self.arch, &self.data_layout, &&self.options];
        ::core::fmt::Formatter::debug_struct_fields_finish(f, "Target", names,
            values)
    }
}Debug)]
2137pub struct Target {
2138    /// Unversioned target tuple to pass to LLVM.
2139    ///
2140    /// Target tuples can optionally contain an OS version (notably Apple targets), which rustc
2141    /// cannot know without querying the environment.
2142    ///
2143    /// Use `rustc_codegen_ssa::back::versioned_llvm_target` if you need the full LLVM target.
2144    pub llvm_target: StaticCow<str>,
2145    /// Metadata about a target, for example the description or tier.
2146    /// Used for generating target documentation.
2147    pub metadata: TargetMetadata,
2148    /// Number of bits in a pointer. Influences the `target_pointer_width` `cfg` variable.
2149    pub pointer_width: u16,
2150    /// Architecture to use for ABI considerations. Valid options include: "x86",
2151    /// "x86_64", "arm", "aarch64", "mips", "powerpc", "powerpc64", and others.
2152    pub arch: Arch,
2153    /// [Data layout](https://llvm.org/docs/LangRef.html#data-layout) to pass to LLVM.
2154    pub data_layout: StaticCow<str>,
2155    /// Optional settings with defaults.
2156    pub options: TargetOptions,
2157}
2158
2159/// Metadata about a target like the description or tier.
2160/// Part of #120745.
2161/// All fields are optional for now, but intended to be required in the future.
2162#[derive(#[automatically_derived]
impl ::core::default::Default for TargetMetadata {
    #[inline]
    fn default() -> TargetMetadata {
        TargetMetadata {
            description: ::core::default::Default::default(),
            tier: ::core::default::Default::default(),
            host_tools: ::core::default::Default::default(),
            std: ::core::default::Default::default(),
        }
    }
}Default, #[automatically_derived]
impl ::core::cmp::PartialEq for TargetMetadata {
    #[inline]
    fn eq(&self, other: &TargetMetadata) -> bool {
        self.description == other.description && self.tier == other.tier &&
                self.host_tools == other.host_tools && self.std == other.std
    }
}PartialEq, #[automatically_derived]
impl ::core::clone::Clone for TargetMetadata {
    #[inline]
    fn clone(&self) -> TargetMetadata {
        TargetMetadata {
            description: ::core::clone::Clone::clone(&self.description),
            tier: ::core::clone::Clone::clone(&self.tier),
            host_tools: ::core::clone::Clone::clone(&self.host_tools),
            std: ::core::clone::Clone::clone(&self.std),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for TargetMetadata {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "TargetMetadata", "description", &self.description, "tier",
            &self.tier, "host_tools", &self.host_tools, "std", &&self.std)
    }
}Debug)]
2163pub struct TargetMetadata {
2164    /// A short description of the target including platform requirements,
2165    /// for example "64-bit Linux (kernel 3.2+, glibc 2.17+)".
2166    pub description: Option<StaticCow<str>>,
2167    /// The tier of the target. 1, 2 or 3.
2168    pub tier: Option<u64>,
2169    /// Whether the Rust project ships host tools for a target.
2170    pub host_tools: Option<bool>,
2171    /// Whether a target has the `std` library. This is usually true for targets running
2172    /// on an operating system.
2173    pub std: Option<bool>,
2174}
2175
2176impl Target {
2177    pub fn parse_data_layout(&self) -> Result<TargetDataLayout, TargetDataLayoutError<'_>> {
2178        let mut dl = TargetDataLayout::parse_from_llvm_datalayout_string(
2179            &self.data_layout,
2180            self.options.default_address_space,
2181        )?;
2182
2183        // Perform consistency checks against the Target information.
2184        if dl.endian != self.endian {
2185            return Err(TargetDataLayoutError::InconsistentTargetArchitecture {
2186                dl: dl.endian.as_str(),
2187                target: self.endian.as_str(),
2188            });
2189        }
2190
2191        let target_pointer_width: u64 = self.pointer_width.into();
2192        let dl_pointer_size: u64 = dl.pointer_size().bits();
2193        if dl_pointer_size != target_pointer_width {
2194            return Err(TargetDataLayoutError::InconsistentTargetPointerWidth {
2195                pointer_size: dl_pointer_size,
2196                target: self.pointer_width,
2197            });
2198        }
2199
2200        dl.c_enum_min_size = Integer::from_size(Size::from_bits(
2201            self.c_enum_min_bits.unwrap_or(self.c_int_width as _),
2202        ))
2203        .map_err(|err| TargetDataLayoutError::InvalidBitsSize { err })?;
2204
2205        Ok(dl)
2206    }
2207
2208    pub fn supports_c_variadic_definitions(&self) -> CVariadicStatus {
2209        use Arch::*;
2210
2211        match self.arch {
2212            // These targets just inherently do not support c-variadic definitions.
2213            Bpf | SpirV => CVariadicStatus::NotSupported,
2214
2215            // The c-variadic ABI for this target may change in the future, per this comment in
2216            // clang:
2217            //
2218            // > To be compatible with GCC's behaviors, we force arguments with
2219            // > 2×XLEN-bit alignment and size at most 2×XLEN bits like `long long`,
2220            // > `unsigned long long` and `double` to have 4-byte alignment. This
2221            // > behavior may be changed when RV32E/ILP32E is ratified.
2222            RiscV32 if self.llvm_abiname == LlvmAbi::Ilp32e => {
2223                CVariadicStatus::Unstable { feature: sym::c_variadic_experimental_arch }
2224            }
2225
2226            // We don't know how c-variadics work for this target. Using the default LLVM
2227            // fallback implementation probably works, but we can't guarantee it.
2228            Other(_) => CVariadicStatus::Unstable { feature: sym::c_variadic_experimental_arch },
2229
2230            // These targets require more testing before we commit to c-variadic definitions
2231            // being stable.
2232            //
2233            // To stabilize c-variadic functions for one of these targets, the following
2234            // requirements must be met:
2235            //
2236            // - Check that `core::ffi::VaArgSafe` is (un)implemented for all the correct types.
2237            // - Add an assembly test to `tests/assembly-llvm/c-variadic` that tests the assembly
2238            // for all implementers of `VaArgSafe`. The generated assembly should either match
2239            // `clang`, or we should understand and document why it deviates.
2240            // - Ensure that `va_arg` is implemented in rustc. For stable targets we don't rely on
2241            // the LLVM implementation, it has historically caused miscompilations.
2242            // - Ensure that LLVM's `va_end` for this target is a NOP.
2243            // - Ensure that LLVM's `va_copy` for this target is equivalent to `memcpy`.
2244            // - The `tests/ui/c-variadic/roundtrip.rs` test must pass for the target. It may
2245            // need slight modifications for embedded targets, that's fine.
2246            // - Check that calling c-variadic functions defined in Rust can be called from C.
2247            // For most targets `tests/run-make/c-link-to-rust-va-list-fn` can be used here.
2248            // For no_std targets a manual setup may be needed.
2249            Sparc | Avr | M68k | Msp430 => {
2250                CVariadicStatus::Unstable { feature: sym::c_variadic_experimental_arch }
2251            }
2252
2253            AArch64 | AmdGpu | Arm | Arm64EC | CSky | Hexagon | LoongArch32 | LoongArch64
2254            | Mips | Mips32r6 | Mips64 | Mips64r6 | Nvptx64 | PowerPC | PowerPC64 | RiscV32
2255            | RiscV64 | S390x | Sparc64 | Wasm32 | Wasm64 | X86 | X86_64 | Xtensa => {
2256                CVariadicStatus::Stable
2257            }
2258        }
2259    }
2260
2261    /// Is this target single-threaded?
2262    ///
2263    /// This affects both optimizations (e.g., atomics can be lowered to regular operations) and
2264    /// is also exposed as cfg(target_has_threads).
2265    pub fn singlethread(&self, target_features: &FxIndexSet<Symbol>) -> bool {
2266        // On the wasm target once the `atomics` feature is enabled that means that
2267        // we're no longer single-threaded, or otherwise we don't want LLVM to
2268        // lower atomic operations to single-threaded operations.
2269        //
2270        // FIXME: This (probably?) implies that atomics should be a target modifier, at which point
2271        // it probably makes sense to be a separate target to ship precompiled artifacts for it?
2272        //
2273        // cc #77839 (tracking issue for wasm atomics)
2274        if self.singlethread && self.is_like_wasm && target_features.contains(&sym::atomics) {
2275            return false;
2276        }
2277
2278        self.singlethread
2279    }
2280}
2281
2282pub trait HasTargetSpec {
2283    fn target_spec(&self) -> &Target;
2284}
2285
2286impl HasTargetSpec for Target {
2287    #[inline]
2288    fn target_spec(&self) -> &Target {
2289        self
2290    }
2291}
2292
2293/// x86 (32-bit) abi options.
2294#[derive(#[automatically_derived]
impl ::core::fmt::Debug for X86Abi {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "X86Abi",
            "regparm", &self.regparm, "reg_struct_return",
            &&self.reg_struct_return)
    }
}Debug, #[automatically_derived]
impl ::core::marker::Copy for X86Abi { }Copy, #[automatically_derived]
impl ::core::clone::Clone for X86Abi {
    #[inline]
    fn clone(&self) -> X86Abi {
        let _: ::core::clone::AssertParamIsClone<Option<u32>>;
        let _: ::core::clone::AssertParamIsClone<bool>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::hash::Hash for X86Abi {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) {
        ::core::hash::Hash::hash(&self.regparm, state);
        ::core::hash::Hash::hash(&self.reg_struct_return, state)
    }
}Hash, #[automatically_derived]
impl ::core::cmp::PartialEq for X86Abi {
    #[inline]
    fn eq(&self, other: &X86Abi) -> bool {
        self.reg_struct_return == other.reg_struct_return &&
            self.regparm == other.regparm
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for X86Abi {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_fields_are_eq(&self) {
        let _: ::core::cmp::AssertParamIsEq<Option<u32>>;
        let _: ::core::cmp::AssertParamIsEq<bool>;
    }
}Eq)]
2295pub struct X86Abi {
2296    /// On x86-32 targets, the regparm N causes the compiler to pass arguments
2297    /// in registers EAX, EDX, and ECX instead of on the stack.
2298    pub regparm: Option<u32>,
2299    /// Override the default ABI to return small structs in registers
2300    pub reg_struct_return: bool,
2301}
2302
2303pub trait HasX86AbiOpt {
2304    fn x86_abi_opt(&self) -> X86Abi;
2305}
2306
2307type StaticCow<T> = Cow<'static, T>;
2308
2309/// Optional aspects of a target specification.
2310///
2311/// This has an implementation of `Default`, see each field for what the default is. In general,
2312/// these try to take "minimal defaults" that don't assume anything about the runtime they run in.
2313///
2314/// `TargetOptions` as a separate structure is mostly an implementation detail of `Target`
2315/// construction, all its fields logically belong to `Target` and available from `Target`
2316/// through `Deref` impls.
2317#[derive(#[automatically_derived]
impl ::core::cmp::PartialEq for TargetOptions {
    #[inline]
    fn eq(&self, other: &TargetOptions) -> bool {
        self.c_int_width == other.c_int_width &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                self.linker_is_gnu_json == other.linker_is_gnu_json &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            self.need_explicit_cpu == other.need_explicit_cpu &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        self.requires_consistent_cpu ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            other.requires_consistent_cpu &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    self.dynamic_linking == other.dynamic_linking &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                self.dll_tls_export == other.dll_tls_export &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            self.only_cdylib == other.only_cdylib &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        self.executables == other.executables &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    self.disable_redzone == other.disable_redzone &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                self.function_sections == other.function_sections &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                            self.abi_return_struct_as_int ==
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                other.abi_return_struct_as_int &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        self.is_like_aix == other.is_like_aix &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                    self.is_like_darwin == other.is_like_darwin &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                                self.is_like_gpu == other.is_like_gpu &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                            self.is_like_solaris == other.is_like_solaris &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                        self.is_like_windows == other.is_like_windows &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                    self.is_like_msvc == other.is_like_msvc &&
                                                                                                                                                                                                                                                                                                                                                                                                                                                self.is_like_wasm == other.is_like_wasm &&
                                                                                                                                                                                                                                                                                                                                                                                                                                            self.is_like_android == other.is_like_android &&
                                                                                                                                                                                                                                                                                                                                                                                                                                        self.is_like_vexos == other.is_like_vexos &&
                                                                                                                                                                                                                                                                                                                                                                                                                                    self.default_dwarf_version == other.default_dwarf_version &&
                                                                                                                                                                                                                                                                                                                                                                                                                                self.has_rpath == other.has_rpath &&
                                                                                                                                                                                                                                                                                                                                                                                                                            self.no_default_libraries == other.no_default_libraries &&
                                                                                                                                                                                                                                                                                                                                                                                                                        self.position_independent_executables ==
                                                                                                                                                                                                                                                                                                                                                                                                                            other.position_independent_executables &&
                                                                                                                                                                                                                                                                                                                                                                                                                    self.static_position_independent_executables ==
                                                                                                                                                                                                                                                                                                                                                                                                                        other.static_position_independent_executables &&
                                                                                                                                                                                                                                                                                                                                                                                                                self.plt_by_default == other.plt_by_default &&
                                                                                                                                                                                                                                                                                                                                                                                                            self.allow_asm == other.allow_asm &&
                                                                                                                                                                                                                                                                                                                                                                                                        self.static_initializer_must_be_acyclic ==
                                                                                                                                                                                                                                                                                                                                                                                                            other.static_initializer_must_be_acyclic &&
                                                                                                                                                                                                                                                                                                                                                                                                    self.main_needs_argc_argv == other.main_needs_argc_argv &&
                                                                                                                                                                                                                                                                                                                                                                                                self.has_thread_local == other.has_thread_local &&
                                                                                                                                                                                                                                                                                                                                                                                            self.obj_is_bitcode == other.obj_is_bitcode &&
                                                                                                                                                                                                                                                                                                                                                                                        self.atomic_cas == other.atomic_cas &&
                                                                                                                                                                                                                                                                                                                                                                                    self.crt_static_allows_dylibs ==
                                                                                                                                                                                                                                                                                                                                                                                        other.crt_static_allows_dylibs &&
                                                                                                                                                                                                                                                                                                                                                                                self.crt_static_default == other.crt_static_default &&
                                                                                                                                                                                                                                                                                                                                                                            self.crt_static_respected == other.crt_static_respected &&
                                                                                                                                                                                                                                                                                                                                                                        self.trap_unreachable == other.trap_unreachable &&
                                                                                                                                                                                                                                                                                                                                                                    self.requires_lto == other.requires_lto &&
                                                                                                                                                                                                                                                                                                                                                                self.singlethread == other.singlethread &&
                                                                                                                                                                                                                                                                                                                                                            self.no_builtins == other.no_builtins &&
                                                                                                                                                                                                                                                                                                                                                        self.emit_debug_gdb_scripts == other.emit_debug_gdb_scripts
                                                                                                                                                                                                                                                                                                                                                    && self.requires_uwtable == other.requires_uwtable &&
                                                                                                                                                                                                                                                                                                                                                self.default_uwtable == other.default_uwtable &&
                                                                                                                                                                                                                                                                                                                                            self.simd_types_indirect == other.simd_types_indirect &&
                                                                                                                                                                                                                                                                                                                                        self.limit_rdylib_exports == other.limit_rdylib_exports &&
                                                                                                                                                                                                                                                                                                                                    self.relax_elf_relocations == other.relax_elf_relocations &&
                                                                                                                                                                                                                                                                                                                                self.use_ctors_section == other.use_ctors_section &&
                                                                                                                                                                                                                                                                                                                            self.eh_frame_header == other.eh_frame_header &&
                                                                                                                                                                                                                                                                                                                        self.has_thumb_interworking == other.has_thumb_interworking
                                                                                                                                                                                                                                                                                                                    &&
                                                                                                                                                                                                                                                                                                                    self.generate_arange_section ==
                                                                                                                                                                                                                                                                                                                        other.generate_arange_section &&
                                                                                                                                                                                                                                                                                                                self.supports_stack_protector ==
                                                                                                                                                                                                                                                                                                                    other.supports_stack_protector &&
                                                                                                                                                                                                                                                                                                            self.supports_fentry == other.supports_fentry &&
                                                                                                                                                                                                                                                                                                        self.supports_xray == other.supports_xray &&
                                                                                                                                                                                                                                                                                                    self.endian == other.endian && self.os == other.os &&
                                                                                                                                                                                                                                                                                            self.env == other.env && self.cfg_abi == other.cfg_abi &&
                                                                                                                                                                                                                                                                                    self.vendor == other.vendor && self.linker == other.linker
                                                                                                                                                                                                                                                                            && self.linker_flavor == other.linker_flavor &&
                                                                                                                                                                                                                                                                        self.linker_flavor_json == other.linker_flavor_json &&
                                                                                                                                                                                                                                                                    self.lld_flavor_json == other.lld_flavor_json &&
                                                                                                                                                                                                                                                                self.pre_link_objects == other.pre_link_objects &&
                                                                                                                                                                                                                                                            self.post_link_objects == other.post_link_objects &&
                                                                                                                                                                                                                                                        self.pre_link_objects_self_contained ==
                                                                                                                                                                                                                                                            other.pre_link_objects_self_contained &&
                                                                                                                                                                                                                                                    self.post_link_objects_self_contained ==
                                                                                                                                                                                                                                                        other.post_link_objects_self_contained &&
                                                                                                                                                                                                                                                self.link_self_contained == other.link_self_contained &&
                                                                                                                                                                                                                                            self.pre_link_args == other.pre_link_args &&
                                                                                                                                                                                                                                        self.pre_link_args_json == other.pre_link_args_json &&
                                                                                                                                                                                                                                    self.late_link_args == other.late_link_args &&
                                                                                                                                                                                                                                self.late_link_args_json == other.late_link_args_json &&
                                                                                                                                                                                                                            self.late_link_args_dynamic == other.late_link_args_dynamic
                                                                                                                                                                                                                        &&
                                                                                                                                                                                                                        self.late_link_args_dynamic_json ==
                                                                                                                                                                                                                            other.late_link_args_dynamic_json &&
                                                                                                                                                                                                                    self.late_link_args_static == other.late_link_args_static &&
                                                                                                                                                                                                                self.late_link_args_static_json ==
                                                                                                                                                                                                                    other.late_link_args_static_json &&
                                                                                                                                                                                                            self.post_link_args == other.post_link_args &&
                                                                                                                                                                                                        self.post_link_args_json == other.post_link_args_json &&
                                                                                                                                                                                                    self.link_script == other.link_script &&
                                                                                                                                                                                                self.link_env == other.link_env &&
                                                                                                                                                                                            self.link_env_remove == other.link_env_remove &&
                                                                                                                                                                                        self.asm_args == other.asm_args && self.cpu == other.cpu &&
                                                                                                                                                                                self.unsupported_cpus == other.unsupported_cpus &&
                                                                                                                                                                            self.features == other.features &&
                                                                                                                                                                        self.direct_access_external_data ==
                                                                                                                                                                            other.direct_access_external_data &&
                                                                                                                                                                    self.relocation_model == other.relocation_model &&
                                                                                                                                                                self.code_model == other.code_model &&
                                                                                                                                                            self.tls_model == other.tls_model &&
                                                                                                                                                        self.frame_pointer == other.frame_pointer &&
                                                                                                                                                    self.dll_prefix == other.dll_prefix &&
                                                                                                                                                self.dll_suffix == other.dll_suffix &&
                                                                                                                                            self.exe_suffix == other.exe_suffix &&
                                                                                                                                        self.staticlib_prefix == other.staticlib_prefix &&
                                                                                                                                    self.staticlib_suffix == other.staticlib_suffix &&
                                                                                                                                self.families == other.families &&
                                                                                                                            self.binary_format == other.binary_format &&
                                                                                                                        self.relro_level == other.relro_level &&
                                                                                                                    self.archive_format == other.archive_format &&
                                                                                                                self.min_atomic_width == other.min_atomic_width &&
                                                                                                            self.max_atomic_width == other.max_atomic_width &&
                                                                                                        self.panic_strategy == other.panic_strategy &&
                                                                                                    self.stack_probes == other.stack_probes &&
                                                                                                self.min_global_align == other.min_global_align &&
                                                                                            self.default_codegen_units == other.default_codegen_units &&
                                                                                        self.default_codegen_backend ==
                                                                                            other.default_codegen_backend &&
                                                                                    self.default_visibility == other.default_visibility &&
                                                                                self.override_export_symbols ==
                                                                                    other.override_export_symbols &&
                                                                            self.merge_functions == other.merge_functions &&
                                                                        self.mcount == other.mcount &&
                                                                    self.llvm_mcount_intrinsic == other.llvm_mcount_intrinsic &&
                                                                self.llvm_abiname == other.llvm_abiname &&
                                                            self.llvm_floatabi == other.llvm_floatabi &&
                                                        self.rustc_abi == other.rustc_abi &&
                                                    self.llvm_args == other.llvm_args &&
                                                self.debuginfo_kind == other.debuginfo_kind &&
                                            self.split_debuginfo == other.split_debuginfo &&
                                        self.supported_split_debuginfo ==
                                            other.supported_split_debuginfo &&
                                    self.supported_sanitizers == other.supported_sanitizers &&
                                self.default_sanitizers == other.default_sanitizers &&
                            self.c_enum_min_bits == other.c_enum_min_bits &&
                        self.entry_name == other.entry_name &&
                    self.entry_abi == other.entry_abi &&
                self.default_address_space == other.default_address_space &&
            self.small_data_threshold_support ==
                other.small_data_threshold_support
    }
}PartialEq, #[automatically_derived]
impl ::core::clone::Clone for TargetOptions {
    #[inline]
    fn clone(&self) -> TargetOptions {
        TargetOptions {
            endian: ::core::clone::Clone::clone(&self.endian),
            c_int_width: ::core::clone::Clone::clone(&self.c_int_width),
            os: ::core::clone::Clone::clone(&self.os),
            env: ::core::clone::Clone::clone(&self.env),
            cfg_abi: ::core::clone::Clone::clone(&self.cfg_abi),
            vendor: ::core::clone::Clone::clone(&self.vendor),
            linker: ::core::clone::Clone::clone(&self.linker),
            linker_flavor: ::core::clone::Clone::clone(&self.linker_flavor),
            linker_flavor_json: ::core::clone::Clone::clone(&self.linker_flavor_json),
            lld_flavor_json: ::core::clone::Clone::clone(&self.lld_flavor_json),
            linker_is_gnu_json: ::core::clone::Clone::clone(&self.linker_is_gnu_json),
            pre_link_objects: ::core::clone::Clone::clone(&self.pre_link_objects),
            post_link_objects: ::core::clone::Clone::clone(&self.post_link_objects),
            pre_link_objects_self_contained: ::core::clone::Clone::clone(&self.pre_link_objects_self_contained),
            post_link_objects_self_contained: ::core::clone::Clone::clone(&self.post_link_objects_self_contained),
            link_self_contained: ::core::clone::Clone::clone(&self.link_self_contained),
            pre_link_args: ::core::clone::Clone::clone(&self.pre_link_args),
            pre_link_args_json: ::core::clone::Clone::clone(&self.pre_link_args_json),
            late_link_args: ::core::clone::Clone::clone(&self.late_link_args),
            late_link_args_json: ::core::clone::Clone::clone(&self.late_link_args_json),
            late_link_args_dynamic: ::core::clone::Clone::clone(&self.late_link_args_dynamic),
            late_link_args_dynamic_json: ::core::clone::Clone::clone(&self.late_link_args_dynamic_json),
            late_link_args_static: ::core::clone::Clone::clone(&self.late_link_args_static),
            late_link_args_static_json: ::core::clone::Clone::clone(&self.late_link_args_static_json),
            post_link_args: ::core::clone::Clone::clone(&self.post_link_args),
            post_link_args_json: ::core::clone::Clone::clone(&self.post_link_args_json),
            link_script: ::core::clone::Clone::clone(&self.link_script),
            link_env: ::core::clone::Clone::clone(&self.link_env),
            link_env_remove: ::core::clone::Clone::clone(&self.link_env_remove),
            asm_args: ::core::clone::Clone::clone(&self.asm_args),
            cpu: ::core::clone::Clone::clone(&self.cpu),
            need_explicit_cpu: ::core::clone::Clone::clone(&self.need_explicit_cpu),
            requires_consistent_cpu: ::core::clone::Clone::clone(&self.requires_consistent_cpu),
            unsupported_cpus: ::core::clone::Clone::clone(&self.unsupported_cpus),
            features: ::core::clone::Clone::clone(&self.features),
            direct_access_external_data: ::core::clone::Clone::clone(&self.direct_access_external_data),
            dynamic_linking: ::core::clone::Clone::clone(&self.dynamic_linking),
            dll_tls_export: ::core::clone::Clone::clone(&self.dll_tls_export),
            only_cdylib: ::core::clone::Clone::clone(&self.only_cdylib),
            executables: ::core::clone::Clone::clone(&self.executables),
            relocation_model: ::core::clone::Clone::clone(&self.relocation_model),
            code_model: ::core::clone::Clone::clone(&self.code_model),
            tls_model: ::core::clone::Clone::clone(&self.tls_model),
            disable_redzone: ::core::clone::Clone::clone(&self.disable_redzone),
            frame_pointer: ::core::clone::Clone::clone(&self.frame_pointer),
            function_sections: ::core::clone::Clone::clone(&self.function_sections),
            dll_prefix: ::core::clone::Clone::clone(&self.dll_prefix),
            dll_suffix: ::core::clone::Clone::clone(&self.dll_suffix),
            exe_suffix: ::core::clone::Clone::clone(&self.exe_suffix),
            staticlib_prefix: ::core::clone::Clone::clone(&self.staticlib_prefix),
            staticlib_suffix: ::core::clone::Clone::clone(&self.staticlib_suffix),
            families: ::core::clone::Clone::clone(&self.families),
            abi_return_struct_as_int: ::core::clone::Clone::clone(&self.abi_return_struct_as_int),
            is_like_aix: ::core::clone::Clone::clone(&self.is_like_aix),
            is_like_darwin: ::core::clone::Clone::clone(&self.is_like_darwin),
            is_like_gpu: ::core::clone::Clone::clone(&self.is_like_gpu),
            is_like_solaris: ::core::clone::Clone::clone(&self.is_like_solaris),
            is_like_windows: ::core::clone::Clone::clone(&self.is_like_windows),
            is_like_msvc: ::core::clone::Clone::clone(&self.is_like_msvc),
            is_like_wasm: ::core::clone::Clone::clone(&self.is_like_wasm),
            is_like_android: ::core::clone::Clone::clone(&self.is_like_android),
            is_like_vexos: ::core::clone::Clone::clone(&self.is_like_vexos),
            binary_format: ::core::clone::Clone::clone(&self.binary_format),
            default_dwarf_version: ::core::clone::Clone::clone(&self.default_dwarf_version),
            has_rpath: ::core::clone::Clone::clone(&self.has_rpath),
            no_default_libraries: ::core::clone::Clone::clone(&self.no_default_libraries),
            position_independent_executables: ::core::clone::Clone::clone(&self.position_independent_executables),
            static_position_independent_executables: ::core::clone::Clone::clone(&self.static_position_independent_executables),
            plt_by_default: ::core::clone::Clone::clone(&self.plt_by_default),
            relro_level: ::core::clone::Clone::clone(&self.relro_level),
            archive_format: ::core::clone::Clone::clone(&self.archive_format),
            allow_asm: ::core::clone::Clone::clone(&self.allow_asm),
            static_initializer_must_be_acyclic: ::core::clone::Clone::clone(&self.static_initializer_must_be_acyclic),
            main_needs_argc_argv: ::core::clone::Clone::clone(&self.main_needs_argc_argv),
            has_thread_local: ::core::clone::Clone::clone(&self.has_thread_local),
            obj_is_bitcode: ::core::clone::Clone::clone(&self.obj_is_bitcode),
            min_atomic_width: ::core::clone::Clone::clone(&self.min_atomic_width),
            max_atomic_width: ::core::clone::Clone::clone(&self.max_atomic_width),
            atomic_cas: ::core::clone::Clone::clone(&self.atomic_cas),
            panic_strategy: ::core::clone::Clone::clone(&self.panic_strategy),
            crt_static_allows_dylibs: ::core::clone::Clone::clone(&self.crt_static_allows_dylibs),
            crt_static_default: ::core::clone::Clone::clone(&self.crt_static_default),
            crt_static_respected: ::core::clone::Clone::clone(&self.crt_static_respected),
            stack_probes: ::core::clone::Clone::clone(&self.stack_probes),
            min_global_align: ::core::clone::Clone::clone(&self.min_global_align),
            default_codegen_units: ::core::clone::Clone::clone(&self.default_codegen_units),
            default_codegen_backend: ::core::clone::Clone::clone(&self.default_codegen_backend),
            trap_unreachable: ::core::clone::Clone::clone(&self.trap_unreachable),
            requires_lto: ::core::clone::Clone::clone(&self.requires_lto),
            singlethread: ::core::clone::Clone::clone(&self.singlethread),
            no_builtins: ::core::clone::Clone::clone(&self.no_builtins),
            default_visibility: ::core::clone::Clone::clone(&self.default_visibility),
            emit_debug_gdb_scripts: ::core::clone::Clone::clone(&self.emit_debug_gdb_scripts),
            requires_uwtable: ::core::clone::Clone::clone(&self.requires_uwtable),
            default_uwtable: ::core::clone::Clone::clone(&self.default_uwtable),
            simd_types_indirect: ::core::clone::Clone::clone(&self.simd_types_indirect),
            limit_rdylib_exports: ::core::clone::Clone::clone(&self.limit_rdylib_exports),
            override_export_symbols: ::core::clone::Clone::clone(&self.override_export_symbols),
            merge_functions: ::core::clone::Clone::clone(&self.merge_functions),
            mcount: ::core::clone::Clone::clone(&self.mcount),
            llvm_mcount_intrinsic: ::core::clone::Clone::clone(&self.llvm_mcount_intrinsic),
            llvm_abiname: ::core::clone::Clone::clone(&self.llvm_abiname),
            llvm_floatabi: ::core::clone::Clone::clone(&self.llvm_floatabi),
            rustc_abi: ::core::clone::Clone::clone(&self.rustc_abi),
            relax_elf_relocations: ::core::clone::Clone::clone(&self.relax_elf_relocations),
            llvm_args: ::core::clone::Clone::clone(&self.llvm_args),
            use_ctors_section: ::core::clone::Clone::clone(&self.use_ctors_section),
            eh_frame_header: ::core::clone::Clone::clone(&self.eh_frame_header),
            has_thumb_interworking: ::core::clone::Clone::clone(&self.has_thumb_interworking),
            debuginfo_kind: ::core::clone::Clone::clone(&self.debuginfo_kind),
            split_debuginfo: ::core::clone::Clone::clone(&self.split_debuginfo),
            supported_split_debuginfo: ::core::clone::Clone::clone(&self.supported_split_debuginfo),
            supported_sanitizers: ::core::clone::Clone::clone(&self.supported_sanitizers),
            default_sanitizers: ::core::clone::Clone::clone(&self.default_sanitizers),
            c_enum_min_bits: ::core::clone::Clone::clone(&self.c_enum_min_bits),
            generate_arange_section: ::core::clone::Clone::clone(&self.generate_arange_section),
            supports_stack_protector: ::core::clone::Clone::clone(&self.supports_stack_protector),
            entry_name: ::core::clone::Clone::clone(&self.entry_name),
            entry_abi: ::core::clone::Clone::clone(&self.entry_abi),
            supports_fentry: ::core::clone::Clone::clone(&self.supports_fentry),
            supports_xray: ::core::clone::Clone::clone(&self.supports_xray),
            default_address_space: ::core::clone::Clone::clone(&self.default_address_space),
            small_data_threshold_support: ::core::clone::Clone::clone(&self.small_data_threshold_support),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for TargetOptions {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        let names: &'static _ =
            &["endian", "c_int_width", "os", "env", "cfg_abi", "vendor",
                        "linker", "linker_flavor", "linker_flavor_json",
                        "lld_flavor_json", "linker_is_gnu_json", "pre_link_objects",
                        "post_link_objects", "pre_link_objects_self_contained",
                        "post_link_objects_self_contained", "link_self_contained",
                        "pre_link_args", "pre_link_args_json", "late_link_args",
                        "late_link_args_json", "late_link_args_dynamic",
                        "late_link_args_dynamic_json", "late_link_args_static",
                        "late_link_args_static_json", "post_link_args",
                        "post_link_args_json", "link_script", "link_env",
                        "link_env_remove", "asm_args", "cpu", "need_explicit_cpu",
                        "requires_consistent_cpu", "unsupported_cpus", "features",
                        "direct_access_external_data", "dynamic_linking",
                        "dll_tls_export", "only_cdylib", "executables",
                        "relocation_model", "code_model", "tls_model",
                        "disable_redzone", "frame_pointer", "function_sections",
                        "dll_prefix", "dll_suffix", "exe_suffix",
                        "staticlib_prefix", "staticlib_suffix", "families",
                        "abi_return_struct_as_int", "is_like_aix", "is_like_darwin",
                        "is_like_gpu", "is_like_solaris", "is_like_windows",
                        "is_like_msvc", "is_like_wasm", "is_like_android",
                        "is_like_vexos", "binary_format", "default_dwarf_version",
                        "has_rpath", "no_default_libraries",
                        "position_independent_executables",
                        "static_position_independent_executables", "plt_by_default",
                        "relro_level", "archive_format", "allow_asm",
                        "static_initializer_must_be_acyclic",
                        "main_needs_argc_argv", "has_thread_local",
                        "obj_is_bitcode", "min_atomic_width", "max_atomic_width",
                        "atomic_cas", "panic_strategy", "crt_static_allows_dylibs",
                        "crt_static_default", "crt_static_respected",
                        "stack_probes", "min_global_align", "default_codegen_units",
                        "default_codegen_backend", "trap_unreachable",
                        "requires_lto", "singlethread", "no_builtins",
                        "default_visibility", "emit_debug_gdb_scripts",
                        "requires_uwtable", "default_uwtable",
                        "simd_types_indirect", "limit_rdylib_exports",
                        "override_export_symbols", "merge_functions", "mcount",
                        "llvm_mcount_intrinsic", "llvm_abiname", "llvm_floatabi",
                        "rustc_abi", "relax_elf_relocations", "llvm_args",
                        "use_ctors_section", "eh_frame_header",
                        "has_thumb_interworking", "debuginfo_kind",
                        "split_debuginfo", "supported_split_debuginfo",
                        "supported_sanitizers", "default_sanitizers",
                        "c_enum_min_bits", "generate_arange_section",
                        "supports_stack_protector", "entry_name", "entry_abi",
                        "supports_fentry", "supports_xray", "default_address_space",
                        "small_data_threshold_support"];
        let values: &[&dyn ::core::fmt::Debug] =
            &[&self.endian, &self.c_int_width, &self.os, &self.env,
                        &self.cfg_abi, &self.vendor, &self.linker,
                        &self.linker_flavor, &self.linker_flavor_json,
                        &self.lld_flavor_json, &self.linker_is_gnu_json,
                        &self.pre_link_objects, &self.post_link_objects,
                        &self.pre_link_objects_self_contained,
                        &self.post_link_objects_self_contained,
                        &self.link_self_contained, &self.pre_link_args,
                        &self.pre_link_args_json, &self.late_link_args,
                        &self.late_link_args_json, &self.late_link_args_dynamic,
                        &self.late_link_args_dynamic_json,
                        &self.late_link_args_static,
                        &self.late_link_args_static_json, &self.post_link_args,
                        &self.post_link_args_json, &self.link_script,
                        &self.link_env, &self.link_env_remove, &self.asm_args,
                        &self.cpu, &self.need_explicit_cpu,
                        &self.requires_consistent_cpu, &self.unsupported_cpus,
                        &self.features, &self.direct_access_external_data,
                        &self.dynamic_linking, &self.dll_tls_export,
                        &self.only_cdylib, &self.executables,
                        &self.relocation_model, &self.code_model, &self.tls_model,
                        &self.disable_redzone, &self.frame_pointer,
                        &self.function_sections, &self.dll_prefix, &self.dll_suffix,
                        &self.exe_suffix, &self.staticlib_prefix,
                        &self.staticlib_suffix, &self.families,
                        &self.abi_return_struct_as_int, &self.is_like_aix,
                        &self.is_like_darwin, &self.is_like_gpu,
                        &self.is_like_solaris, &self.is_like_windows,
                        &self.is_like_msvc, &self.is_like_wasm,
                        &self.is_like_android, &self.is_like_vexos,
                        &self.binary_format, &self.default_dwarf_version,
                        &self.has_rpath, &self.no_default_libraries,
                        &self.position_independent_executables,
                        &self.static_position_independent_executables,
                        &self.plt_by_default, &self.relro_level,
                        &self.archive_format, &self.allow_asm,
                        &self.static_initializer_must_be_acyclic,
                        &self.main_needs_argc_argv, &self.has_thread_local,
                        &self.obj_is_bitcode, &self.min_atomic_width,
                        &self.max_atomic_width, &self.atomic_cas,
                        &self.panic_strategy, &self.crt_static_allows_dylibs,
                        &self.crt_static_default, &self.crt_static_respected,
                        &self.stack_probes, &self.min_global_align,
                        &self.default_codegen_units, &self.default_codegen_backend,
                        &self.trap_unreachable, &self.requires_lto,
                        &self.singlethread, &self.no_builtins,
                        &self.default_visibility, &self.emit_debug_gdb_scripts,
                        &self.requires_uwtable, &self.default_uwtable,
                        &self.simd_types_indirect, &self.limit_rdylib_exports,
                        &self.override_export_symbols, &self.merge_functions,
                        &self.mcount, &self.llvm_mcount_intrinsic,
                        &self.llvm_abiname, &self.llvm_floatabi, &self.rustc_abi,
                        &self.relax_elf_relocations, &self.llvm_args,
                        &self.use_ctors_section, &self.eh_frame_header,
                        &self.has_thumb_interworking, &self.debuginfo_kind,
                        &self.split_debuginfo, &self.supported_split_debuginfo,
                        &self.supported_sanitizers, &self.default_sanitizers,
                        &self.c_enum_min_bits, &self.generate_arange_section,
                        &self.supports_stack_protector, &self.entry_name,
                        &self.entry_abi, &self.supports_fentry, &self.supports_xray,
                        &self.default_address_space,
                        &&self.small_data_threshold_support];
        ::core::fmt::Formatter::debug_struct_fields_finish(f, "TargetOptions",
            names, values)
    }
}Debug)]
2318#[rustc_lint_opt_ty]
2319pub struct TargetOptions {
2320    /// Used as the `target_endian` `cfg` variable. Defaults to little endian.
2321    pub endian: Endian,
2322    /// Width of c_int type. Defaults to "32".
2323    pub c_int_width: u16,
2324    /// OS name to use for conditional compilation (`target_os`). Defaults to [`Os::None`].
2325    /// [`Os::None`] implies a bare metal target without `std` library.
2326    /// A couple of targets having `std` also use [`Os::Unknown`] as their `os` value,
2327    /// but they are exceptions.
2328    pub os: Os,
2329    /// Environment name to use for conditional compilation (`target_env`). Defaults to [`Env::Unspecified`].
2330    pub env: Env,
2331    /// ABI name to distinguish multiple ABIs on the same OS and architecture. For instance,
2332    /// `"eabi"` or `"eabihf"`. Defaults to [`CfgAbi::Unspecified`].
2333    /// The only purpose of this field is to control `cfg(target_abi)`. This does not control the
2334    /// calling convention used by this target! The actual calling convention is controlled by
2335    /// `llvm_abiname`, `llvm_floatabi`, and `rustc_abi`.
2336    ///
2337    /// In a target spec, this field generally *informs* the user about what the ABI is, but you
2338    /// have to also set up other parts of the target spec to ensure that this information is
2339    /// correct. In the rest of the compiler, do not check this field if what you actually need to
2340    /// know about is the calling convention. Most targets have an open-ended set of values for this
2341    /// field.
2342    pub cfg_abi: CfgAbi,
2343    /// Vendor name to use for conditional compilation (`target_vendor`). Defaults to "unknown".
2344    #[rustc_lint_opt_deny_field_access(
2345        "use `Target::is_like_*` instead of this field; see https://github.com/rust-lang/rust/issues/100343 for rationale"
2346    )]
2347    vendor: StaticCow<str>,
2348
2349    /// Linker to invoke
2350    pub linker: Option<StaticCow<str>>,
2351    /// Default linker flavor used if `-C linker-flavor` or `-C linker` are not passed
2352    /// on the command line. Defaults to `LinkerFlavor::Gnu(Cc::Yes, Lld::No)`.
2353    pub linker_flavor: LinkerFlavor,
2354    linker_flavor_json: LinkerFlavorCli,
2355    lld_flavor_json: LldFlavor,
2356    linker_is_gnu_json: bool,
2357
2358    /// Objects to link before and after all other object code.
2359    pub pre_link_objects: CrtObjects,
2360    pub post_link_objects: CrtObjects,
2361    /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
2362    pub pre_link_objects_self_contained: CrtObjects,
2363    pub post_link_objects_self_contained: CrtObjects,
2364    /// Behavior for the self-contained linking mode: inferred for some targets, or explicitly
2365    /// enabled (in bulk, or with individual components).
2366    pub link_self_contained: LinkSelfContainedDefault,
2367
2368    /// Linker arguments that are passed *before* any user-defined libraries.
2369    pub pre_link_args: LinkArgs,
2370    pre_link_args_json: LinkArgsCli,
2371    /// Linker arguments that are unconditionally passed after any
2372    /// user-defined but before post-link objects. Standard platform
2373    /// libraries that should be always be linked to, usually go here.
2374    pub late_link_args: LinkArgs,
2375    late_link_args_json: LinkArgsCli,
2376    /// Linker arguments used in addition to `late_link_args` if at least one
2377    /// Rust dependency is dynamically linked.
2378    pub late_link_args_dynamic: LinkArgs,
2379    late_link_args_dynamic_json: LinkArgsCli,
2380    /// Linker arguments used in addition to `late_link_args` if all Rust
2381    /// dependencies are statically linked.
2382    pub late_link_args_static: LinkArgs,
2383    late_link_args_static_json: LinkArgsCli,
2384    /// Linker arguments that are unconditionally passed *after* any
2385    /// user-defined libraries.
2386    pub post_link_args: LinkArgs,
2387    post_link_args_json: LinkArgsCli,
2388
2389    /// Optional link script applied to `dylib` and `executable` crate types.
2390    /// This is a string containing the script, not a path. Can only be applied
2391    /// to linkers where linker flavor matches `LinkerFlavor::Gnu(..)`.
2392    pub link_script: Option<StaticCow<str>>,
2393    /// Environment variables to be set for the linker invocation.
2394    pub link_env: StaticCow<[(StaticCow<str>, StaticCow<str>)]>,
2395    /// Environment variables to be removed for the linker invocation.
2396    pub link_env_remove: StaticCow<[StaticCow<str>]>,
2397
2398    /// Extra arguments to pass to the external assembler (when used)
2399    pub asm_args: StaticCow<[StaticCow<str>]>,
2400
2401    /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults
2402    /// to "generic".
2403    pub cpu: StaticCow<str>,
2404    /// Whether a cpu needs to be explicitly set.
2405    /// Set to true if there is no default cpu. Defaults to false.
2406    pub need_explicit_cpu: bool,
2407    /// Whether `-Ctarget-cpu` is treated as a target modifier. If this is set
2408    /// all crates that are linked together must have been compiled with the
2409    /// same target-cpu. Defaults to false.
2410    pub requires_consistent_cpu: bool,
2411    /// A list of CPUs that are provided by LLVM but are considered unsupported by Rust.
2412    /// These CPUs are omitted from `--print target-cpus` output and will cause an error
2413    /// if used with `-Ctarget-cpu`.
2414    pub unsupported_cpus: StaticCow<[StaticCow<str>]>,
2415    /// Default (Rust) target features to enable for this target. These features
2416    /// overwrite `-Ctarget-cpu` but can be overwritten with `-Ctarget-features`.
2417    /// Corresponds to `llc -mattr=$llvm_features` where `$llvm_features` is the
2418    /// result of mapping the Rust features in this field to LLVM features.
2419    ///
2420    /// Generally it is a bad idea to use negative target features because they often interact very
2421    /// poorly with how `-Ctarget-cpu` works. Instead, try to use a lower "base CPU" and enable the
2422    /// features you want to use.
2423    pub features: StaticCow<str>,
2424    /// Direct or use GOT indirect to reference external data symbols
2425    pub direct_access_external_data: Option<bool>,
2426    /// Whether dynamic linking is available on this target. Defaults to false.
2427    pub dynamic_linking: bool,
2428    /// Whether dynamic linking can export TLS globals. Defaults to true.
2429    pub dll_tls_export: bool,
2430    /// If dynamic linking is available, whether only cdylibs are supported.
2431    pub only_cdylib: bool,
2432    /// Whether executables are available on this target. Defaults to true.
2433    pub executables: bool,
2434    /// Relocation model to use in object file. Corresponds to `llc
2435    /// -relocation-model=$relocation_model`. Defaults to `Pic`.
2436    pub relocation_model: RelocModel,
2437    /// Code model to use. Corresponds to `llc -code-model=$code_model`.
2438    /// Defaults to `None` which means "inherited from the base LLVM target".
2439    pub code_model: Option<CodeModel>,
2440    /// TLS model to use. Options are "global-dynamic" (default), "local-dynamic", "initial-exec"
2441    /// and "local-exec". This is similar to the -ftls-model option in GCC/Clang.
2442    pub tls_model: TlsModel,
2443    /// Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
2444    pub disable_redzone: bool,
2445    /// Frame pointer mode for this target. Defaults to `MayOmit`.
2446    pub frame_pointer: FramePointer,
2447    /// Emit each function in its own section. Defaults to true.
2448    pub function_sections: bool,
2449    /// String to prepend to the name of every dynamic library. Defaults to "lib".
2450    pub dll_prefix: StaticCow<str>,
2451    /// String to append to the name of every dynamic library. Defaults to ".so".
2452    pub dll_suffix: StaticCow<str>,
2453    /// String to append to the name of every executable.
2454    pub exe_suffix: StaticCow<str>,
2455    /// String to prepend to the name of every static library. Defaults to "lib".
2456    pub staticlib_prefix: StaticCow<str>,
2457    /// String to append to the name of every static library. Defaults to ".a".
2458    pub staticlib_suffix: StaticCow<str>,
2459    /// Values of the `target_family` cfg set for this target.
2460    ///
2461    /// Common options are: "unix", "windows". Defaults to no families.
2462    ///
2463    /// See <https://doc.rust-lang.org/reference/conditional-compilation.html#target_family>.
2464    pub families: StaticCow<[StaticCow<str>]>,
2465    /// Whether the target toolchain's ABI supports returning small structs as an integer.
2466    pub abi_return_struct_as_int: bool,
2467    /// Whether the target toolchain is like AIX's. Linker options on AIX are special and it uses
2468    /// XCOFF as binary format. Defaults to false.
2469    pub is_like_aix: bool,
2470    /// Whether the target toolchain is like macOS's. Only useful for compiling against iOS/macOS,
2471    /// in particular running dsymutil and some other stuff like `-dead_strip`. Defaults to false.
2472    /// Also indicates whether to use Apple-specific ABI changes, such as extending function
2473    /// parameters to 32-bits.
2474    pub is_like_darwin: bool,
2475    /// Whether the target is a GPU (e.g. NVIDIA, AMD, Intel).
2476    pub is_like_gpu: bool,
2477    /// Whether the target toolchain is like Solaris's.
2478    /// Only useful for compiling against Illumos/Solaris,
2479    /// as they have a different set of linker flags. Defaults to false.
2480    pub is_like_solaris: bool,
2481    /// Whether the target is like Windows.
2482    /// This is a combination of several more specific properties represented as a single flag:
2483    ///   - The target uses a Windows ABI,
2484    ///   - uses PE/COFF as a format for object code,
2485    ///   - uses Windows-style dllexport/dllimport for shared libraries,
2486    ///   - uses import libraries and .def files for symbol exports,
2487    ///   - executables support setting a subsystem.
2488    pub is_like_windows: bool,
2489    /// Whether the target is like MSVC.
2490    /// This is a combination of several more specific properties represented as a single flag:
2491    ///   - The target has all the properties from `is_like_windows`
2492    ///     (for in-tree targets "is_like_msvc ⇒ is_like_windows" is ensured by a unit test),
2493    ///   - has some MSVC-specific Windows ABI properties,
2494    ///   - uses a link.exe-like linker,
2495    ///   - uses CodeView/PDB for debuginfo and natvis for its visualization,
2496    ///   - uses SEH-based unwinding,
2497    ///   - supports control flow guard mechanism.
2498    pub is_like_msvc: bool,
2499    /// Whether a target toolchain is like WASM.
2500    pub is_like_wasm: bool,
2501    /// Whether a target toolchain is like Android, implying a Linux kernel and a Bionic libc
2502    pub is_like_android: bool,
2503    /// Whether a target toolchain is like VEXos, the operating system used by the VEX Robotics V5 Brain.
2504    pub is_like_vexos: bool,
2505    /// Target's binary file format. Defaults to BinaryFormat::Elf
2506    pub binary_format: BinaryFormat,
2507    /// Default supported version of DWARF on this platform.
2508    /// Useful because some platforms (osx, bsd) only want up to DWARF2.
2509    pub default_dwarf_version: u32,
2510    /// Whether the linker support rpaths or not. Defaults to false.
2511    pub has_rpath: bool,
2512    /// Whether to disable linking to the default libraries, typically corresponds
2513    /// to `-nodefaultlibs`. Defaults to true.
2514    pub no_default_libraries: bool,
2515    /// Dynamically linked executables can be compiled as position independent
2516    /// if the default relocation model of position independent code is not
2517    /// changed. This is a requirement to take advantage of ASLR, as otherwise
2518    /// the functions in the executable are not randomized and can be used
2519    /// during an exploit of a vulnerability in any code.
2520    pub position_independent_executables: bool,
2521    /// Executables that are both statically linked and position-independent are supported.
2522    pub static_position_independent_executables: bool,
2523    /// Determines if the target always requires using the PLT for indirect
2524    /// library calls or not. This controls the default value of the `-Z plt` flag.
2525    pub plt_by_default: bool,
2526    /// Either partial, full, or off. Full RELRO makes the dynamic linker
2527    /// resolve all symbols at startup and marks the GOT read-only before
2528    /// starting the program, preventing overwriting the GOT.
2529    pub relro_level: RelroLevel,
2530    /// Format that archives should be emitted in. This affects whether we use
2531    /// LLVM to assemble an archive or fall back to the system linker, and
2532    /// currently only "gnu" is used to fall into LLVM. Unknown strings cause
2533    /// the system linker to be used.
2534    pub archive_format: StaticCow<str>,
2535    /// Is asm!() allowed? Defaults to true.
2536    pub allow_asm: bool,
2537    /// Static initializers must be acyclic.
2538    /// Defaults to false
2539    pub static_initializer_must_be_acyclic: bool,
2540    /// Whether the runtime startup code requires the `main` function be passed
2541    /// `argc` and `argv` values.
2542    pub main_needs_argc_argv: bool,
2543
2544    /// Flag indicating whether #[thread_local] is available for this target.
2545    pub has_thread_local: bool,
2546    /// This is mainly for easy compatibility with emscripten.
2547    /// If we give emcc .o files that are actually .bc files it
2548    /// will 'just work'.
2549    pub obj_is_bitcode: bool,
2550
2551    /// Don't use this field; instead use the `.min_atomic_width()` method.
2552    pub min_atomic_width: Option<u64>,
2553
2554    /// Don't use this field; instead use the `.max_atomic_width()` method.
2555    pub max_atomic_width: Option<u64>,
2556
2557    /// Whether the target supports atomic CAS operations natively
2558    pub atomic_cas: bool,
2559
2560    /// Panic strategy: "unwind" or "abort"
2561    pub panic_strategy: PanicStrategy,
2562
2563    /// Whether or not linking dylibs to a static CRT is allowed.
2564    pub crt_static_allows_dylibs: bool,
2565    /// Whether or not the CRT is statically linked by default.
2566    pub crt_static_default: bool,
2567    /// Whether or not crt-static is respected by the compiler (or is a no-op).
2568    pub crt_static_respected: bool,
2569
2570    /// The implementation of stack probes to use.
2571    pub stack_probes: StackProbeType,
2572
2573    /// The minimum alignment for global symbols.
2574    pub min_global_align: Option<Align>,
2575
2576    /// Default number of codegen units to use in debug mode
2577    pub default_codegen_units: Option<u64>,
2578
2579    /// Default codegen backend used for this target. Defaults to `None`.
2580    ///
2581    /// If `None`, then `CFG_DEFAULT_CODEGEN_BACKEND` environmental variable captured when
2582    /// compiling `rustc` will be used instead (or llvm if it is not set).
2583    ///
2584    /// N.B. when *using* the compiler, backend can always be overridden with `-Zcodegen-backend`.
2585    ///
2586    /// This was added by WaffleLapkin in #116793. The motivation is a rustc fork that requires a
2587    /// custom codegen backend for a particular target.
2588    pub default_codegen_backend: Option<StaticCow<str>>,
2589
2590    /// Whether to generate trap instructions in places where optimization would
2591    /// otherwise produce control flow that falls through into unrelated memory.
2592    pub trap_unreachable: bool,
2593
2594    /// This target requires everything to be compiled with LTO to emit a final
2595    /// executable, aka there is no native linker for this target.
2596    pub requires_lto: bool,
2597
2598    /// This target has no support for threads.
2599    // This is private because wasm changes this depending on target features.
2600    singlethread: bool,
2601
2602    /// Whether library functions call lowering/optimization is disabled in LLVM
2603    /// for this target unconditionally.
2604    pub no_builtins: bool,
2605
2606    /// The default visibility for symbols in this target.
2607    ///
2608    /// This value typically shouldn't be accessed directly, but through the
2609    /// `rustc_session::Session::default_visibility` method, which allows `rustc` users to override
2610    /// this setting using cmdline flags.
2611    pub default_visibility: Option<SymbolVisibility>,
2612
2613    /// Whether a .debug_gdb_scripts section will be added to the output object file
2614    pub emit_debug_gdb_scripts: bool,
2615
2616    /// Whether or not to unconditionally `uwtable` attributes on functions,
2617    /// typically because the platform needs to unwind for things like stack
2618    /// unwinders.
2619    pub requires_uwtable: bool,
2620
2621    /// Whether or not to emit `uwtable` attributes on functions if `-C force-unwind-tables`
2622    /// is not specified and `uwtable` is not required on this target.
2623    pub default_uwtable: bool,
2624
2625    /// Whether or not SIMD types are passed by reference in the Rust ABI,
2626    /// typically required if a target can be compiled with a mixed set of
2627    /// target features. This is `true` by default, and `false` for targets like
2628    /// wasm32 where the whole program either has simd or not.
2629    pub simd_types_indirect: bool,
2630
2631    /// Pass a list of symbol which should be exported in the dylib to the linker.
2632    pub limit_rdylib_exports: bool,
2633
2634    /// If set, have the linker export exactly these symbols, instead of using
2635    /// the usual logic to figure this out from the crate itself.
2636    pub override_export_symbols: Option<StaticCow<[StaticCow<str>]>>,
2637
2638    /// Determines how or whether the MergeFunctions LLVM pass should run for
2639    /// this target. Either "disabled", "trampolines", or "aliases".
2640    /// The MergeFunctions pass is generally useful, but some targets may need
2641    /// to opt out. The default is "aliases".
2642    ///
2643    /// Workaround for: <https://github.com/rust-lang/rust/issues/57356>
2644    pub merge_functions: MergeFunctions,
2645
2646    /// Use platform dependent mcount function
2647    pub mcount: StaticCow<str>,
2648
2649    /// Use LLVM intrinsic for mcount function name
2650    pub llvm_mcount_intrinsic: Option<StaticCow<str>>,
2651
2652    /// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers
2653    /// and the `-target-abi` flag in llc. In the LLVM API this is `MCOptions.ABIName`.
2654    pub llvm_abiname: LlvmAbi,
2655
2656    /// Control the float ABI to use, for architectures that support it. The only architecture we
2657    /// currently use this for is ARM. Corresponds to the `-float-abi` flag in llc. In the LLVM API
2658    /// this is `FloatABIType`. (clang's `-mfloat-abi` is similar but more complicated since it
2659    /// can also affect the `soft-float` target feature.)
2660    ///
2661    /// If not provided, LLVM will infer the float ABI from the target triple (`llvm_target`).
2662    pub llvm_floatabi: Option<FloatAbi>,
2663
2664    /// Picks a specific ABI for this target. This is *not* just for "Rust" ABI functions,
2665    /// it can also affect "C" ABI functions; the point is that this flag is interpreted by
2666    /// rustc and not forwarded to LLVM.
2667    pub rustc_abi: Option<RustcAbi>,
2668
2669    /// Whether or not RelaxElfRelocation flag will be passed to the linker
2670    pub relax_elf_relocations: bool,
2671
2672    /// Additional arguments to pass to LLVM, similar to the `-C llvm-args` codegen option.
2673    pub llvm_args: StaticCow<[StaticCow<str>]>,
2674
2675    /// Whether to use legacy .ctors initialization hooks rather than .init_array. Defaults
2676    /// to false (uses .init_array).
2677    pub use_ctors_section: bool,
2678
2679    /// Whether the linker is instructed to add a `GNU_EH_FRAME` ELF header
2680    /// used to locate unwinding information is passed
2681    /// (only has effect if the linker is `ld`-like).
2682    pub eh_frame_header: bool,
2683
2684    /// Is true if the target is an ARM architecture using thumb v1 which allows for
2685    /// thumb and arm interworking.
2686    pub has_thumb_interworking: bool,
2687
2688    /// Which kind of debuginfo is used by this target?
2689    pub debuginfo_kind: DebuginfoKind,
2690    /// How to handle split debug information, if at all. Specifying `None` has
2691    /// target-specific meaning.
2692    pub split_debuginfo: SplitDebuginfo,
2693    /// Which kinds of split debuginfo are supported by the target?
2694    pub supported_split_debuginfo: StaticCow<[SplitDebuginfo]>,
2695
2696    /// The sanitizers supported by this target
2697    ///
2698    /// Note that the support here is at a codegen level. If the machine code with sanitizer
2699    /// enabled can generated on this target, but the necessary supporting libraries are not
2700    /// distributed with the target, the sanitizer should still appear in this list for the target.
2701    pub supported_sanitizers: SanitizerSet,
2702
2703    /// The sanitizers that are enabled by default on this target.
2704    ///
2705    /// Note that the support here is at a codegen level. If the machine code with sanitizer
2706    /// enabled can generated on this target, but the necessary supporting libraries are not
2707    /// distributed with the target, the sanitizer should still appear in this list for the target.
2708    pub default_sanitizers: SanitizerSet,
2709
2710    /// Minimum number of bits in #[repr(C)] enum. Defaults to the size of c_int
2711    pub c_enum_min_bits: Option<u64>,
2712
2713    /// Whether or not the DWARF `.debug_aranges` section should be generated.
2714    pub generate_arange_section: bool,
2715
2716    /// Whether the target supports stack canary checks. `true` by default,
2717    /// since this is most common among tier 1 and tier 2 targets.
2718    pub supports_stack_protector: bool,
2719
2720    /// The name of entry function.
2721    /// Default value is "main"
2722    pub entry_name: StaticCow<str>,
2723
2724    /// The ABI of the entry function.
2725    /// Default value is `CanonAbi::C`
2726    pub entry_abi: CanonAbi,
2727
2728    /// Whether the target supports fentry instrumentation.
2729    pub supports_fentry: bool,
2730
2731    /// Whether the target supports XRay instrumentation.
2732    pub supports_xray: bool,
2733
2734    /// The default address space for this target. When using LLVM as a backend, most targets simply
2735    /// use LLVM's default address space (0). Some other targets, such as CHERI targets, use a
2736    /// custom default address space (in this specific case, `200`).
2737    pub default_address_space: rustc_abi::AddressSpace,
2738
2739    /// Whether the targets supports -Z small-data-threshold
2740    small_data_threshold_support: SmallDataThresholdSupport,
2741}
2742
2743/// Add arguments for the given flavor and also for its "twin" flavors
2744/// that have a compatible command line interface.
2745fn add_link_args_iter(
2746    link_args: &mut LinkArgs,
2747    flavor: LinkerFlavor,
2748    args: impl Iterator<Item = StaticCow<str>> + Clone,
2749) {
2750    let mut insert = |flavor| link_args.entry(flavor).or_default().extend(args.clone());
2751    insert(flavor);
2752    match flavor {
2753        LinkerFlavor::Gnu(cc, lld) => {
2754            {
    match (&lld, &Lld::No) {
        (left_val, right_val) => {
            if !(*left_val == *right_val) {
                let kind = ::core::panicking::AssertKind::Eq;
                ::core::panicking::assert_failed(kind, &*left_val,
                    &*right_val, ::core::option::Option::None);
            }
        }
    }
};assert_eq!(lld, Lld::No);
2755            insert(LinkerFlavor::Gnu(cc, Lld::Yes));
2756        }
2757        LinkerFlavor::Darwin(cc, lld) => {
2758            {
    match (&lld, &Lld::No) {
        (left_val, right_val) => {
            if !(*left_val == *right_val) {
                let kind = ::core::panicking::AssertKind::Eq;
                ::core::panicking::assert_failed(kind, &*left_val,
                    &*right_val, ::core::option::Option::None);
            }
        }
    }
};assert_eq!(lld, Lld::No);
2759            insert(LinkerFlavor::Darwin(cc, Lld::Yes));
2760        }
2761        LinkerFlavor::Msvc(lld) => {
2762            {
    match (&lld, &Lld::No) {
        (left_val, right_val) => {
            if !(*left_val == *right_val) {
                let kind = ::core::panicking::AssertKind::Eq;
                ::core::panicking::assert_failed(kind, &*left_val,
                    &*right_val, ::core::option::Option::None);
            }
        }
    }
};assert_eq!(lld, Lld::No);
2763            insert(LinkerFlavor::Msvc(Lld::Yes));
2764        }
2765        LinkerFlavor::WasmLld(..)
2766        | LinkerFlavor::Unix(..)
2767        | LinkerFlavor::EmCc
2768        | LinkerFlavor::Bpf
2769        | LinkerFlavor::Llbc => {}
2770    }
2771}
2772
2773fn add_link_args(link_args: &mut LinkArgs, flavor: LinkerFlavor, args: &[&'static str]) {
2774    add_link_args_iter(link_args, flavor, args.iter().copied().map(Cow::Borrowed))
2775}
2776
2777impl TargetOptions {
2778    pub fn supports_comdat(&self) -> bool {
2779        // XCOFF and MachO don't support COMDAT.
2780        !self.is_like_aix && !self.is_like_darwin
2781    }
2782
2783    pub fn uses_pdb_debuginfo(&self) -> bool {
2784        self.debuginfo_kind == DebuginfoKind::Pdb
2785    }
2786}
2787
2788impl TargetOptions {
2789    fn link_args(flavor: LinkerFlavor, args: &[&'static str]) -> LinkArgs {
2790        let mut link_args = LinkArgs::new();
2791        add_link_args(&mut link_args, flavor, args);
2792        link_args
2793    }
2794
2795    fn add_pre_link_args(&mut self, flavor: LinkerFlavor, args: &[&'static str]) {
2796        add_link_args(&mut self.pre_link_args, flavor, args);
2797    }
2798
2799    fn update_from_cli(&mut self) {
2800        self.linker_flavor = LinkerFlavor::from_cli_json(
2801            self.linker_flavor_json,
2802            self.lld_flavor_json,
2803            self.linker_is_gnu_json,
2804        );
2805        for (args, args_json) in [
2806            (&mut self.pre_link_args, &self.pre_link_args_json),
2807            (&mut self.late_link_args, &self.late_link_args_json),
2808            (&mut self.late_link_args_dynamic, &self.late_link_args_dynamic_json),
2809            (&mut self.late_link_args_static, &self.late_link_args_static_json),
2810            (&mut self.post_link_args, &self.post_link_args_json),
2811        ] {
2812            args.clear();
2813            for (flavor, args_json) in args_json {
2814                let linker_flavor = self.linker_flavor.with_cli_hints(*flavor);
2815                // Normalize to no lld to avoid asserts.
2816                let linker_flavor = match linker_flavor {
2817                    LinkerFlavor::Gnu(cc, _) => LinkerFlavor::Gnu(cc, Lld::No),
2818                    LinkerFlavor::Darwin(cc, _) => LinkerFlavor::Darwin(cc, Lld::No),
2819                    LinkerFlavor::Msvc(_) => LinkerFlavor::Msvc(Lld::No),
2820                    _ => linker_flavor,
2821                };
2822                if !args.contains_key(&linker_flavor) {
2823                    add_link_args_iter(args, linker_flavor, args_json.iter().cloned());
2824                }
2825            }
2826        }
2827    }
2828
2829    fn update_to_cli(&mut self) {
2830        self.linker_flavor_json = self.linker_flavor.to_cli_counterpart();
2831        self.lld_flavor_json = self.linker_flavor.lld_flavor();
2832        self.linker_is_gnu_json = self.linker_flavor.is_gnu();
2833        for (args, args_json) in [
2834            (&self.pre_link_args, &mut self.pre_link_args_json),
2835            (&self.late_link_args, &mut self.late_link_args_json),
2836            (&self.late_link_args_dynamic, &mut self.late_link_args_dynamic_json),
2837            (&self.late_link_args_static, &mut self.late_link_args_static_json),
2838            (&self.post_link_args, &mut self.post_link_args_json),
2839        ] {
2840            *args_json = args
2841                .iter()
2842                .map(|(flavor, args)| (flavor.to_cli_counterpart(), args.clone()))
2843                .collect();
2844        }
2845    }
2846}
2847
2848impl Default for TargetOptions {
2849    /// Creates a set of "sane defaults" for any target. This is still
2850    /// incomplete, and if used for compilation, will certainly not work.
2851    fn default() -> TargetOptions {
2852        TargetOptions {
2853            endian: Endian::Little,
2854            c_int_width: 32,
2855            os: Os::None,
2856            env: Env::Unspecified,
2857            cfg_abi: CfgAbi::Unspecified,
2858            vendor: "unknown".into(),
2859            linker: ::core::option::Option::None::<&'static str>option_env!("CFG_DEFAULT_LINKER").map(|s| s.into()),
2860            linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
2861            linker_flavor_json: LinkerFlavorCli::Gcc,
2862            lld_flavor_json: LldFlavor::Ld,
2863            linker_is_gnu_json: true,
2864            link_script: None,
2865            asm_args: ::std::borrow::Cow::Borrowed(&[])cvs![],
2866            cpu: "generic".into(),
2867            need_explicit_cpu: false,
2868            requires_consistent_cpu: false,
2869            unsupported_cpus: ::std::borrow::Cow::Borrowed(&[])cvs![],
2870            features: "".into(),
2871            direct_access_external_data: None,
2872            dynamic_linking: false,
2873            dll_tls_export: true,
2874            only_cdylib: false,
2875            executables: true,
2876            relocation_model: RelocModel::Pic,
2877            code_model: None,
2878            tls_model: TlsModel::GeneralDynamic,
2879            disable_redzone: false,
2880            frame_pointer: FramePointer::MayOmit,
2881            function_sections: true,
2882            dll_prefix: "lib".into(),
2883            dll_suffix: ".so".into(),
2884            exe_suffix: "".into(),
2885            staticlib_prefix: "lib".into(),
2886            staticlib_suffix: ".a".into(),
2887            families: ::std::borrow::Cow::Borrowed(&[])cvs![],
2888            abi_return_struct_as_int: false,
2889            is_like_aix: false,
2890            is_like_darwin: false,
2891            is_like_gpu: false,
2892            is_like_solaris: false,
2893            is_like_windows: false,
2894            is_like_msvc: false,
2895            is_like_wasm: false,
2896            is_like_android: false,
2897            is_like_vexos: false,
2898            binary_format: BinaryFormat::Elf,
2899            default_dwarf_version: 4,
2900            has_rpath: false,
2901            no_default_libraries: true,
2902            position_independent_executables: false,
2903            static_position_independent_executables: false,
2904            plt_by_default: true,
2905            relro_level: RelroLevel::None,
2906            pre_link_objects: Default::default(),
2907            post_link_objects: Default::default(),
2908            pre_link_objects_self_contained: Default::default(),
2909            post_link_objects_self_contained: Default::default(),
2910            link_self_contained: LinkSelfContainedDefault::False,
2911            pre_link_args: LinkArgs::new(),
2912            pre_link_args_json: LinkArgsCli::new(),
2913            late_link_args: LinkArgs::new(),
2914            late_link_args_json: LinkArgsCli::new(),
2915            late_link_args_dynamic: LinkArgs::new(),
2916            late_link_args_dynamic_json: LinkArgsCli::new(),
2917            late_link_args_static: LinkArgs::new(),
2918            late_link_args_static_json: LinkArgsCli::new(),
2919            post_link_args: LinkArgs::new(),
2920            post_link_args_json: LinkArgsCli::new(),
2921            link_env: ::std::borrow::Cow::Borrowed(&[])cvs![],
2922            link_env_remove: ::std::borrow::Cow::Borrowed(&[])cvs![],
2923            archive_format: "gnu".into(),
2924            main_needs_argc_argv: true,
2925            allow_asm: true,
2926            static_initializer_must_be_acyclic: false,
2927            has_thread_local: false,
2928            obj_is_bitcode: false,
2929            min_atomic_width: None,
2930            max_atomic_width: None,
2931            atomic_cas: true,
2932            panic_strategy: PanicStrategy::Unwind,
2933            crt_static_allows_dylibs: false,
2934            crt_static_default: false,
2935            crt_static_respected: false,
2936            stack_probes: StackProbeType::None,
2937            min_global_align: None,
2938            default_codegen_units: None,
2939            default_codegen_backend: None,
2940            trap_unreachable: true,
2941            requires_lto: false,
2942            singlethread: false,
2943            no_builtins: false,
2944            default_visibility: None,
2945            emit_debug_gdb_scripts: true,
2946            requires_uwtable: false,
2947            default_uwtable: false,
2948            simd_types_indirect: true,
2949            limit_rdylib_exports: true,
2950            override_export_symbols: None,
2951            merge_functions: MergeFunctions::Aliases,
2952            mcount: "mcount".into(),
2953            llvm_mcount_intrinsic: None,
2954            llvm_abiname: LlvmAbi::Unspecified,
2955            llvm_floatabi: None,
2956            rustc_abi: None,
2957            relax_elf_relocations: false,
2958            llvm_args: ::std::borrow::Cow::Borrowed(&[])cvs![],
2959            use_ctors_section: false,
2960            eh_frame_header: true,
2961            has_thumb_interworking: false,
2962            debuginfo_kind: Default::default(),
2963            split_debuginfo: Default::default(),
2964            // `Off` is supported by default, but targets can remove this manually, e.g. Windows.
2965            supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
2966            supported_sanitizers: SanitizerSet::empty(),
2967            default_sanitizers: SanitizerSet::empty(),
2968            c_enum_min_bits: None,
2969            generate_arange_section: true,
2970            supports_stack_protector: true,
2971            entry_name: "main".into(),
2972            entry_abi: CanonAbi::C,
2973            supports_fentry: false,
2974            supports_xray: false,
2975            default_address_space: rustc_abi::AddressSpace::ZERO,
2976            small_data_threshold_support: SmallDataThresholdSupport::DefaultForArch,
2977        }
2978    }
2979}
2980
2981/// `TargetOptions` being a separate type is basically an implementation detail of `Target` that is
2982/// used for providing defaults. Perhaps there's a way to merge `TargetOptions` into `Target` so
2983/// this `Deref` implementation is no longer necessary.
2984impl Deref for Target {
2985    type Target = TargetOptions;
2986
2987    #[inline]
2988    fn deref(&self) -> &Self::Target {
2989        &self.options
2990    }
2991}
2992impl DerefMut for Target {
2993    #[inline]
2994    fn deref_mut(&mut self) -> &mut Self::Target {
2995        &mut self.options
2996    }
2997}
2998
2999impl Target {
3000    pub fn is_abi_supported(&self, abi: ExternAbi) -> bool {
3001        let abi_map = AbiMap::from_target(self);
3002        abi_map.canonize_abi(abi, false).is_mapped()
3003    }
3004
3005    /// Minimum integer size in bits that this target can perform atomic
3006    /// operations on.
3007    pub fn min_atomic_width(&self) -> u64 {
3008        self.min_atomic_width.unwrap_or(8)
3009    }
3010
3011    /// Maximum integer size in bits that this target can perform atomic
3012    /// operations on.
3013    pub fn max_atomic_width(&self) -> u64 {
3014        self.max_atomic_width.unwrap_or_else(|| self.pointer_width.into())
3015    }
3016
3017    /// Check some basic consistency of the current target. For JSON targets we are less strict;
3018    /// some of these checks are more guidelines than strict rules.
3019    fn check_consistency(&self, kind: TargetKind) -> Result<(), String> {
3020        macro_rules! check {
3021            ($b:expr, $($msg:tt)*) => {
3022                if !$b {
3023                    return Err(format!($($msg)*));
3024                }
3025            }
3026        }
3027        macro_rules! check_eq {
3028            ($left:expr, $right:expr, $($msg:tt)*) => {
3029                if ($left) != ($right) {
3030                    return Err(format!($($msg)*));
3031                }
3032            }
3033        }
3034        macro_rules! check_ne {
3035            ($left:expr, $right:expr, $($msg:tt)*) => {
3036                if ($left) == ($right) {
3037                    return Err(format!($($msg)*));
3038                }
3039            }
3040        }
3041        macro_rules! check_matches {
3042            ($left:expr, $right:pat, $($msg:tt)*) => {
3043                if !matches!($left, $right) {
3044                    return Err(format!($($msg)*));
3045                }
3046            }
3047        }
3048
3049        if (self.is_like_darwin) != (self.vendor == "apple") {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`is_like_darwin` must be set if and only if `vendor` is `apple`"))
                }));
};check_eq!(
3050            self.is_like_darwin,
3051            self.vendor == "apple",
3052            "`is_like_darwin` must be set if and only if `vendor` is `apple`"
3053        );
3054        if (self.is_like_solaris) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.os {
                Os::Solaris | Os::Illumos => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`is_like_solaris` must be set if and only if `os` is `solaris` or `illumos`"))
                }));
};check_eq!(
3055            self.is_like_solaris,
3056            matches!(self.os, Os::Solaris | Os::Illumos),
3057            "`is_like_solaris` must be set if and only if `os` is `solaris` or `illumos`"
3058        );
3059        if (self.is_like_gpu) !=
        (self.arch == Arch::Nvptx64 || self.arch == Arch::AmdGpu) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`is_like_gpu` must be set if and only if `target` is `nvptx64` or `amdgcn`"))
                }));
};check_eq!(
3060            self.is_like_gpu,
3061            self.arch == Arch::Nvptx64 || self.arch == Arch::AmdGpu,
3062            "`is_like_gpu` must be set if and only if `target` is `nvptx64` or `amdgcn`"
3063        );
3064        if (self.is_like_windows) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.os {
                Os::Windows | Os::Uefi | Os::Cygwin => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`is_like_windows` must be set if and only if `os` is `windows`, `uefi` or `cygwin`"))
                }));
};check_eq!(
3065            self.is_like_windows,
3066            matches!(self.os, Os::Windows | Os::Uefi | Os::Cygwin),
3067            "`is_like_windows` must be set if and only if `os` is `windows`, `uefi` or `cygwin`"
3068        );
3069        if (self.is_like_wasm) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.arch {
                Arch::Wasm32 | Arch::Wasm64 => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`is_like_wasm` must be set if and only if `arch` is `wasm32` or `wasm64`"))
                }));
};check_eq!(
3070            self.is_like_wasm,
3071            matches!(self.arch, Arch::Wasm32 | Arch::Wasm64),
3072            "`is_like_wasm` must be set if and only if `arch` is `wasm32` or `wasm64`"
3073        );
3074        if self.is_like_msvc {
3075            if !self.is_like_windows {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("if `is_like_msvc` is set, `is_like_windows` must be set"))
                }));
};check!(self.is_like_windows, "if `is_like_msvc` is set, `is_like_windows` must be set");
3076        }
3077        if self.os == Os::Emscripten {
3078            if !self.is_like_wasm {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("the `emcscripten` os only makes sense on wasm-like targets"))
                }));
};check!(self.is_like_wasm, "the `emcscripten` os only makes sense on wasm-like targets");
3079        }
3080
3081        // Check that default linker flavor is compatible with some other key properties.
3082        if (self.is_like_darwin) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.linker_flavor {
                LinkerFlavor::Darwin(..) => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`linker_flavor` must be `darwin` if and only if `is_like_darwin` is set"))
                }));
};check_eq!(
3083            self.is_like_darwin,
3084            matches!(self.linker_flavor, LinkerFlavor::Darwin(..)),
3085            "`linker_flavor` must be `darwin` if and only if `is_like_darwin` is set"
3086        );
3087        if (self.is_like_msvc) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.linker_flavor {
                LinkerFlavor::Msvc(..) => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`linker_flavor` must be `msvc` if and only if `is_like_msvc` is set"))
                }));
};check_eq!(
3088            self.is_like_msvc,
3089            matches!(self.linker_flavor, LinkerFlavor::Msvc(..)),
3090            "`linker_flavor` must be `msvc` if and only if `is_like_msvc` is set"
3091        );
3092        if (self.is_like_wasm && self.os != Os::Emscripten) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.linker_flavor {
                LinkerFlavor::WasmLld(..) => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`linker_flavor` must be `wasm-lld` if and only if `is_like_wasm` is set and the `os` is not `emscripten`"))
                }));
};check_eq!(
3093            self.is_like_wasm && self.os != Os::Emscripten,
3094            matches!(self.linker_flavor, LinkerFlavor::WasmLld(..)),
3095            "`linker_flavor` must be `wasm-lld` if and only if `is_like_wasm` is set and the `os` is not `emscripten`",
3096        );
3097        if (self.os == Os::Emscripten) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.linker_flavor {
                LinkerFlavor::EmCc => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`linker_flavor` must be `em-cc` if and only if `os` is `emscripten`"))
                }));
};check_eq!(
3098            self.os == Os::Emscripten,
3099            matches!(self.linker_flavor, LinkerFlavor::EmCc),
3100            "`linker_flavor` must be `em-cc` if and only if `os` is `emscripten`"
3101        );
3102        if (self.arch == Arch::Bpf) !=
        (#[allow(non_exhaustive_omitted_patterns)] match self.linker_flavor {
                LinkerFlavor::Bpf => true,
                _ => false,
            }) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`linker_flavor` must be `bpf` if and only if `arch` is `bpf`"))
                }));
};check_eq!(
3103            self.arch == Arch::Bpf,
3104            matches!(self.linker_flavor, LinkerFlavor::Bpf),
3105            "`linker_flavor` must be `bpf` if and only if `arch` is `bpf`"
3106        );
3107
3108        for args in [
3109            &self.pre_link_args,
3110            &self.late_link_args,
3111            &self.late_link_args_dynamic,
3112            &self.late_link_args_static,
3113            &self.post_link_args,
3114        ] {
3115            for (&flavor, flavor_args) in args {
3116                if !(!flavor_args.is_empty() || self.arch == Arch::Avr) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("linker flavor args must not be empty"))
                }));
};check!(
3117                    !flavor_args.is_empty() || self.arch == Arch::Avr,
3118                    "linker flavor args must not be empty"
3119                );
3120                // Check that flavors mentioned in link args are compatible with the default flavor.
3121                match self.linker_flavor {
3122                    LinkerFlavor::Gnu(..) => {
3123                        if !#[allow(non_exhaustive_omitted_patterns)] match flavor {
            LinkerFlavor::Gnu(..) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("mixing GNU and non-GNU linker flavors"))
                }));
};check_matches!(
3124                            flavor,
3125                            LinkerFlavor::Gnu(..),
3126                            "mixing GNU and non-GNU linker flavors"
3127                        );
3128                    }
3129                    LinkerFlavor::Darwin(..) => {
3130                        if !#[allow(non_exhaustive_omitted_patterns)] match flavor {
            LinkerFlavor::Darwin(..) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("mixing Darwin and non-Darwin linker flavors"))
                }));
}check_matches!(
3131                            flavor,
3132                            LinkerFlavor::Darwin(..),
3133                            "mixing Darwin and non-Darwin linker flavors"
3134                        )
3135                    }
3136                    LinkerFlavor::WasmLld(..) => {
3137                        if !#[allow(non_exhaustive_omitted_patterns)] match flavor {
            LinkerFlavor::WasmLld(..) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("mixing wasm and non-wasm linker flavors"))
                }));
}check_matches!(
3138                            flavor,
3139                            LinkerFlavor::WasmLld(..),
3140                            "mixing wasm and non-wasm linker flavors"
3141                        )
3142                    }
3143                    LinkerFlavor::Unix(..) => {
3144                        if !#[allow(non_exhaustive_omitted_patterns)] match flavor {
            LinkerFlavor::Unix(..) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("mixing unix and non-unix linker flavors"))
                }));
};check_matches!(
3145                            flavor,
3146                            LinkerFlavor::Unix(..),
3147                            "mixing unix and non-unix linker flavors"
3148                        );
3149                    }
3150                    LinkerFlavor::Msvc(..) => {
3151                        if !#[allow(non_exhaustive_omitted_patterns)] match flavor {
            LinkerFlavor::Msvc(..) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("mixing MSVC and non-MSVC linker flavors"))
                }));
};check_matches!(
3152                            flavor,
3153                            LinkerFlavor::Msvc(..),
3154                            "mixing MSVC and non-MSVC linker flavors"
3155                        );
3156                    }
3157                    LinkerFlavor::EmCc | LinkerFlavor::Bpf | LinkerFlavor::Llbc => {
3158                        if (flavor) != (self.linker_flavor) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("mixing different linker flavors"))
                }));
}check_eq!(flavor, self.linker_flavor, "mixing different linker flavors")
3159                    }
3160                }
3161
3162                // Check that link args for cc and non-cc versions of flavors are consistent.
3163                let check_noncc = |noncc_flavor| -> Result<(), String> {
3164                    if let Some(noncc_args) = args.get(&noncc_flavor) {
3165                        for arg in flavor_args {
3166                            if let Some(suffix) = arg.strip_prefix("-Wl,") {
3167                                if !noncc_args.iter().any(|a| a == suffix) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!(" link args for cc and non-cc versions of flavors are not consistent"))
                }));
};check!(
3168                                    noncc_args.iter().any(|a| a == suffix),
3169                                    " link args for cc and non-cc versions of flavors are not consistent"
3170                                );
3171                            }
3172                        }
3173                    }
3174                    Ok(())
3175                };
3176
3177                match self.linker_flavor {
3178                    LinkerFlavor::Gnu(Cc::Yes, lld) => check_noncc(LinkerFlavor::Gnu(Cc::No, lld))?,
3179                    LinkerFlavor::WasmLld(Cc::Yes) => check_noncc(LinkerFlavor::WasmLld(Cc::No))?,
3180                    LinkerFlavor::Unix(Cc::Yes) => check_noncc(LinkerFlavor::Unix(Cc::No))?,
3181                    _ => {}
3182                }
3183            }
3184
3185            // Check that link args for lld and non-lld versions of flavors are consistent.
3186            for cc in [Cc::No, Cc::Yes] {
3187                if (args.get(&LinkerFlavor::Gnu(cc, Lld::No))) !=
        (args.get(&LinkerFlavor::Gnu(cc, Lld::Yes))) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("link args for lld and non-lld versions of flavors are not consistent"))
                }));
};check_eq!(
3188                    args.get(&LinkerFlavor::Gnu(cc, Lld::No)),
3189                    args.get(&LinkerFlavor::Gnu(cc, Lld::Yes)),
3190                    "link args for lld and non-lld versions of flavors are not consistent",
3191                );
3192                if (args.get(&LinkerFlavor::Darwin(cc, Lld::No))) !=
        (args.get(&LinkerFlavor::Darwin(cc, Lld::Yes))) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("link args for lld and non-lld versions of flavors are not consistent"))
                }));
};check_eq!(
3193                    args.get(&LinkerFlavor::Darwin(cc, Lld::No)),
3194                    args.get(&LinkerFlavor::Darwin(cc, Lld::Yes)),
3195                    "link args for lld and non-lld versions of flavors are not consistent",
3196                );
3197            }
3198            if (args.get(&LinkerFlavor::Msvc(Lld::No))) !=
        (args.get(&LinkerFlavor::Msvc(Lld::Yes))) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("link args for lld and non-lld versions of flavors are not consistent"))
                }));
};check_eq!(
3199                args.get(&LinkerFlavor::Msvc(Lld::No)),
3200                args.get(&LinkerFlavor::Msvc(Lld::Yes)),
3201                "link args for lld and non-lld versions of flavors are not consistent",
3202            );
3203        }
3204
3205        if self.link_self_contained.is_disabled() {
3206            if !(self.pre_link_objects_self_contained.is_empty() &&
            self.post_link_objects_self_contained.is_empty()) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("if `link_self_contained` is disabled, then `pre_link_objects_self_contained` and `post_link_objects_self_contained` must be empty"))
                }));
};check!(
3207                self.pre_link_objects_self_contained.is_empty()
3208                    && self.post_link_objects_self_contained.is_empty(),
3209                "if `link_self_contained` is disabled, then `pre_link_objects_self_contained` and `post_link_objects_self_contained` must be empty",
3210            );
3211        }
3212
3213        // If your target really needs to deviate from the rules below,
3214        // except it and document the reasons.
3215        // Keep the default "unknown" vendor instead.
3216        if (self.vendor) == ("") {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`vendor` cannot be empty"))
                }));
};check_ne!(self.vendor, "", "`vendor` cannot be empty");
3217        if let Os::Other(s) = &self.os {
3218            if !!s.is_empty() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`os` cannot be empty"))
                }));
};check!(!s.is_empty(), "`os` cannot be empty");
3219        }
3220        if !self.can_use_os_unknown() {
3221            // Keep the default "none" for bare metal targets instead.
3222            if (self.os) == (Os::Unknown) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`unknown` os can only be used on particular targets; use `none` for bare-metal targets"))
                }));
};check_ne!(
3223                self.os,
3224                Os::Unknown,
3225                "`unknown` os can only be used on particular targets; use `none` for bare-metal targets"
3226            );
3227        }
3228
3229        // Check dynamic linking stuff.
3230        // We skip this for JSON targets since otherwise, our default values would fail this test.
3231        // These checks are not critical for correctness, but more like default guidelines.
3232        // FIXME (https://github.com/rust-lang/rust/issues/133459): do we want to change the JSON
3233        // target defaults so that they pass these checks?
3234        if kind == TargetKind::Builtin {
3235            // BPF: when targeting user space vms (like rbpf), those can load dynamic libraries.
3236            // hexagon: when targeting QuRT, that OS can load dynamic libraries.
3237            // wasm{32,64}: dynamic linking is inherent in the definition of the VM.
3238            if self.os == Os::None
3239                && !#[allow(non_exhaustive_omitted_patterns)] match self.arch {
    Arch::Bpf | Arch::Hexagon | Arch::Wasm32 | Arch::Wasm64 => true,
    _ => false,
}matches!(self.arch, Arch::Bpf | Arch::Hexagon | Arch::Wasm32 | Arch::Wasm64)
3240            {
3241                if !!self.dynamic_linking {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("dynamic linking is not supported on this OS/architecture"))
                }));
};check!(
3242                    !self.dynamic_linking,
3243                    "dynamic linking is not supported on this OS/architecture"
3244                );
3245            }
3246            if self.only_cdylib
3247                || self.crt_static_allows_dylibs
3248                || !self.late_link_args_dynamic.is_empty()
3249            {
3250                if !self.dynamic_linking {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("dynamic linking must be allowed when `only_cdylib` or `crt_static_allows_dylibs` or `late_link_args_dynamic` are set"))
                }));
};check!(
3251                    self.dynamic_linking,
3252                    "dynamic linking must be allowed when `only_cdylib` or `crt_static_allows_dylibs` or `late_link_args_dynamic` are set"
3253                );
3254            }
3255            // Apparently PIC was slow on wasm at some point, see comments in wasm_base.rs
3256            if self.dynamic_linking && !self.is_like_wasm {
3257                if (self.relocation_model) != (RelocModel::Pic) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("targets that support dynamic linking must use the `pic` relocation model"))
                }));
};check_eq!(
3258                    self.relocation_model,
3259                    RelocModel::Pic,
3260                    "targets that support dynamic linking must use the `pic` relocation model"
3261                );
3262            }
3263            if self.position_independent_executables {
3264                if (self.relocation_model) != (RelocModel::Pic) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("targets that support position-independent executables must use the `pic` relocation model"))
                }));
};check_eq!(
3265                    self.relocation_model,
3266                    RelocModel::Pic,
3267                    "targets that support position-independent executables must use the `pic` relocation model"
3268                );
3269            }
3270            // The UEFI targets do not support dynamic linking but still require PIC (#101377).
3271            if self.relocation_model == RelocModel::Pic && self.os != Os::Uefi {
3272                if !(self.dynamic_linking || self.position_independent_executables) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("when the relocation model is `pic`, the target must support dynamic linking or use position-independent executables. Set the relocation model to `static` to avoid this requirement"))
                }));
};check!(
3273                    self.dynamic_linking || self.position_independent_executables,
3274                    "when the relocation model is `pic`, the target must support dynamic linking or use position-independent executables. \
3275                Set the relocation model to `static` to avoid this requirement"
3276                );
3277            }
3278            if self.static_position_independent_executables {
3279                if !self.position_independent_executables {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("if `static_position_independent_executables` is set, then `position_independent_executables` must be set"))
                }));
};check!(
3280                    self.position_independent_executables,
3281                    "if `static_position_independent_executables` is set, then `position_independent_executables` must be set"
3282                );
3283            }
3284            if self.position_independent_executables {
3285                if !self.executables {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("if `position_independent_executables` is set then `executables` must be set"))
                }));
};check!(
3286                    self.executables,
3287                    "if `position_independent_executables` is set then `executables` must be set"
3288                );
3289            }
3290        }
3291
3292        // Check crt static stuff
3293        if self.crt_static_default || self.crt_static_allows_dylibs {
3294            if !self.crt_static_respected {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("static CRT can be enabled but `crt_static_respected` is not set"))
                }));
};check!(
3295                self.crt_static_respected,
3296                "static CRT can be enabled but `crt_static_respected` is not set"
3297            );
3298        }
3299
3300        // Ensure built-in targets don't use the `Other` variants.
3301        if kind == TargetKind::Builtin {
3302            if !!#[allow(non_exhaustive_omitted_patterns)] match self.arch {
                Arch::Other(_) => true,
                _ => false,
            } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`Arch::Other` is only meant for JSON targets"))
                }));
};check!(
3303                !matches!(self.arch, Arch::Other(_)),
3304                "`Arch::Other` is only meant for JSON targets"
3305            );
3306            if !!#[allow(non_exhaustive_omitted_patterns)] match self.os {
                Os::Other(_) => true,
                _ => false,
            } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`Os::Other` is only meant for JSON targets"))
                }));
};check!(!matches!(self.os, Os::Other(_)), "`Os::Other` is only meant for JSON targets");
3307            if !!#[allow(non_exhaustive_omitted_patterns)] match self.env {
                Env::Other(_) => true,
                _ => false,
            } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`Env::Other` is only meant for JSON targets"))
                }));
};check!(
3308                !matches!(self.env, Env::Other(_)),
3309                "`Env::Other` is only meant for JSON targets"
3310            );
3311            if !!#[allow(non_exhaustive_omitted_patterns)] match self.cfg_abi {
                CfgAbi::Other(_) => true,
                _ => false,
            } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`CfgAbi::Other` is only meant for JSON targets"))
                }));
};check!(
3312                !matches!(self.cfg_abi, CfgAbi::Other(_)),
3313                "`CfgAbi::Other` is only meant for JSON targets"
3314            );
3315            if !!#[allow(non_exhaustive_omitted_patterns)] match self.llvm_abiname {
                LlvmAbi::Other(_) => true,
                _ => false,
            } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`LlvmAbi::Other` is only meant for JSON targets"))
                }));
};check!(
3316                !matches!(self.llvm_abiname, LlvmAbi::Other(_)),
3317                "`LlvmAbi::Other` is only meant for JSON targets"
3318            );
3319        }
3320
3321        // Check ABI flag consistency, for the architectures where we have proper ABI treatment.
3322        // To ensure targets are trated consistently, please consult with the team before allowing
3323        // new cases.
3324        match self.arch {
3325            Arch::X86 => {
3326                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on x86-32"))
                }));
};check!(
3327                    self.llvm_abiname == LlvmAbi::Unspecified,
3328                    "`llvm_abiname` is unused on x86-32"
3329                );
3330                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on x86-32"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on x86-32");
3331                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.rustc_abi,
                &self.cfg_abi) {
            (Some(RustcAbi::Softfloat),
                CfgAbi::SoftFloat | CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (Some(RustcAbi::X86Sse2) | None,
                CfgAbi::Uwp | CfgAbi::Llvm | CfgAbi::Sim | CfgAbi::Unspecified
                | CfgAbi::Other(_)) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid x86-32 Rust-specific ABI and `cfg(target_abi)` combination:\nRust-specific ABI: {0:?}\ncfg(target_abi): {1}",
                            self.rustc_abi, self.cfg_abi))
                }));
};check_matches!(
3332                    (&self.rustc_abi, &self.cfg_abi),
3333                    // FIXME: we do not currently set a target_abi for softfloat targets here,
3334                    // but we probably should, so we already allow it.
3335                    (
3336                        Some(RustcAbi::Softfloat),
3337                        CfgAbi::SoftFloat | CfgAbi::Unspecified | CfgAbi::Other(_)
3338                    ) | (
3339                        Some(RustcAbi::X86Sse2) | None,
3340                        CfgAbi::Uwp
3341                            | CfgAbi::Llvm
3342                            | CfgAbi::Sim
3343                            | CfgAbi::Unspecified
3344                            | CfgAbi::Other(_)
3345                    ),
3346                    "invalid x86-32 Rust-specific ABI and `cfg(target_abi)` combination:\n\
3347                    Rust-specific ABI: {:?}\n\
3348                    cfg(target_abi): {}",
3349                    self.rustc_abi,
3350                    self.cfg_abi,
3351                );
3352            }
3353            Arch::X86_64 => {
3354                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on x86-64"))
                }));
};check!(
3355                    self.llvm_abiname == LlvmAbi::Unspecified,
3356                    "`llvm_abiname` is unused on x86-64"
3357                );
3358                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on x86-64"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on x86-64");
3359                // FIXME: we do not currently set a target_abi for softfloat targets here, but we
3360                // probably should, so we already allow it.
3361                // FIXME: Ensure that target_abi = "x32" correlates with actually using that ABI.
3362                // Do any of the others need a similar check?
3363                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.rustc_abi,
                &self.cfg_abi) {
            (Some(RustcAbi::Softfloat),
                CfgAbi::SoftFloat | CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (None,
                CfgAbi::X32 | CfgAbi::Llvm | CfgAbi::Fortanix | CfgAbi::Uwp |
                CfgAbi::MacAbi | CfgAbi::Sim | CfgAbi::Unspecified |
                CfgAbi::Other(_)) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid x86-64 Rust-specific ABI and `cfg(target_abi)` combination:\nRust-specific ABI: {0:?}\ncfg(target_abi): {1}",
                            self.rustc_abi, self.cfg_abi))
                }));
};check_matches!(
3364                    (&self.rustc_abi, &self.cfg_abi),
3365                    (
3366                        Some(RustcAbi::Softfloat),
3367                        CfgAbi::SoftFloat | CfgAbi::Unspecified | CfgAbi::Other(_)
3368                    ) | (
3369                        None,
3370                        CfgAbi::X32
3371                            | CfgAbi::Llvm
3372                            | CfgAbi::Fortanix
3373                            | CfgAbi::Uwp
3374                            | CfgAbi::MacAbi
3375                            | CfgAbi::Sim
3376                            | CfgAbi::Unspecified
3377                            | CfgAbi::Other(_)
3378                    ),
3379                    "invalid x86-64 Rust-specific ABI and `cfg(target_abi)` combination:\n\
3380                    Rust-specific ABI: {:?}\n\
3381                    cfg(target_abi): {}",
3382                    self.rustc_abi,
3383                    self.cfg_abi,
3384                );
3385            }
3386            Arch::RiscV32 => {
3387                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on RISC-V"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on RISC-V");
3388                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on RISC-V"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on RISC-V");
3389                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::Ilp32, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Ilp32e, CfgAbi::Ilp32e) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid RISC-V ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3390                    (&self.llvm_abiname, &self.cfg_abi),
3391                    (LlvmAbi::Ilp32, CfgAbi::Unspecified | CfgAbi::Other(_))
3392                        | (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_))
3393                        | (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_))
3394                        | (LlvmAbi::Ilp32e, CfgAbi::Ilp32e),
3395                    "invalid RISC-V ABI name and `cfg(target_abi)` combination:\n\
3396                     ABI name: {}\n\
3397                     cfg(target_abi): {}",
3398                    self.llvm_abiname,
3399                    self.cfg_abi,
3400                );
3401            }
3402            Arch::RiscV64 => {
3403                // Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
3404                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on RISC-V"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on RISC-V");
3405                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on RISC-V"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on RISC-V");
3406                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::Lp64, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Lp64e, CfgAbi::Unspecified | CfgAbi::Other(_)) =>
                true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid RISC-V ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3407                    (&self.llvm_abiname, &self.cfg_abi),
3408                    (LlvmAbi::Lp64, CfgAbi::Unspecified | CfgAbi::Other(_))
3409                        | (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_))
3410                        | (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_))
3411                        | (LlvmAbi::Lp64e, CfgAbi::Unspecified | CfgAbi::Other(_)),
3412                    "invalid RISC-V ABI name and `cfg(target_abi)` combination:\n\
3413                     ABI name: {}\n\
3414                     cfg(target_abi): {}",
3415                    self.llvm_abiname,
3416                    self.cfg_abi,
3417                );
3418            }
3419            Arch::Arm => {
3420                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on ARM"))
                }));
};check!(
3421                    self.llvm_abiname == LlvmAbi::Unspecified,
3422                    "`llvm_abiname` is unused on ARM"
3423                );
3424                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on ARM"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on ARM");
3425                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_floatabi,
                &self.cfg_abi) {
            (Some(FloatAbi::Hard),
                CfgAbi::EabiHf | CfgAbi::Uwp | CfgAbi::Unspecified |
                CfgAbi::Other(_)) | (Some(FloatAbi::Soft), CfgAbi::Eabi) =>
                true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("Invalid combination of float ABI and `cfg(target_abi)` for ARM target\nfloat ABI: {0:?}\ncfg(target_abi): {1}",
                            self.llvm_floatabi, self.cfg_abi))
                }));
}check_matches!(
3426                    (&self.llvm_floatabi, &self.cfg_abi),
3427                    (
3428                        Some(FloatAbi::Hard),
3429                        CfgAbi::EabiHf | CfgAbi::Uwp | CfgAbi::Unspecified | CfgAbi::Other(_)
3430                    ) | (Some(FloatAbi::Soft), CfgAbi::Eabi),
3431                    "Invalid combination of float ABI and `cfg(target_abi)` for ARM target\n\
3432                     float ABI: {:?}\n\
3433                     cfg(target_abi): {}",
3434                    self.llvm_floatabi,
3435                    self.cfg_abi,
3436                )
3437            }
3438            Arch::AArch64 => {
3439                if !#[allow(non_exhaustive_omitted_patterns)] match self.llvm_abiname {
            LlvmAbi::Unspecified | LlvmAbi::Pauthtest => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid llvm ABI for aarch64"))
                }));
};check_matches!(
3440                    self.llvm_abiname,
3441                    LlvmAbi::Unspecified | LlvmAbi::Pauthtest,
3442                    "invalid llvm ABI for aarch64"
3443                );
3444                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on aarch64"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on aarch64");
3445                // FIXME: Ensure that target_abi = "ilp32" correlates with actually using that ABI.
3446                // Do any of the others need a similar check?
3447                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.rustc_abi,
                &self.cfg_abi) {
            (Some(RustcAbi::Softfloat), CfgAbi::SoftFloat) |
                (None,
                CfgAbi::Ilp32 | CfgAbi::Llvm | CfgAbi::MacAbi |
                CfgAbi::Pauthtest | CfgAbi::Sim | CfgAbi::Uwp |
                CfgAbi::Unspecified | CfgAbi::Other(_)) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid aarch64 Rust-specific ABI and `cfg(target_abi)` combination:\nRust-specific ABI: {0:?}\ncfg(target_abi): {1}",
                            self.rustc_abi, self.cfg_abi))
                }));
};check_matches!(
3448                    (&self.rustc_abi, &self.cfg_abi),
3449                    (Some(RustcAbi::Softfloat), CfgAbi::SoftFloat)
3450                        | (
3451                            None,
3452                            CfgAbi::Ilp32
3453                                | CfgAbi::Llvm
3454                                | CfgAbi::MacAbi
3455                                | CfgAbi::Pauthtest
3456                                | CfgAbi::Sim
3457                                | CfgAbi::Uwp
3458                                | CfgAbi::Unspecified
3459                                | CfgAbi::Other(_)
3460                        ),
3461                    "invalid aarch64 Rust-specific ABI and `cfg(target_abi)` combination:\n\
3462                    Rust-specific ABI: {:?}\n\
3463                    cfg(target_abi): {}",
3464                    self.rustc_abi,
3465                    self.cfg_abi,
3466                );
3467            }
3468            Arch::PowerPC => {
3469                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on PowerPC"))
                }));
};check!(
3470                    self.llvm_abiname == LlvmAbi::Unspecified,
3471                    "`llvm_abiname` is unused on PowerPC"
3472                );
3473                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on PowerPC"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on PowerPC");
3474                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.rustc_abi,
                &self.cfg_abi) {
            (Some(RustcAbi::PowerPcSpe), CfgAbi::Spe) |
                (None, CfgAbi::Unspecified | CfgAbi::Other(_)) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid PowerPC Rust-specific ABI and `cfg(target_abi)` combination:\nRust-specific ABI: {0:?}\ncfg(target_abi): {1}",
                            self.rustc_abi, self.cfg_abi))
                }));
};check_matches!(
3475                    (&self.rustc_abi, &self.cfg_abi),
3476                    (Some(RustcAbi::PowerPcSpe), CfgAbi::Spe)
3477                        | (None, CfgAbi::Unspecified | CfgAbi::Other(_)),
3478                    "invalid PowerPC Rust-specific ABI and `cfg(target_abi)` combination:\n\
3479                    Rust-specific ABI: {:?}\n\
3480                    cfg(target_abi): {}",
3481                    self.rustc_abi,
3482                    self.cfg_abi,
3483                );
3484            }
3485            Arch::PowerPC64 => {
3486                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on PowerPC64"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on PowerPC64");
3487                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on PowerPC64"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on PowerPC64");
3488                // PowerPC64 targets that are not AIX must set their ABI to either ELFv1 or ELFv2
3489                if self.os == Os::Aix {
3490                    // FIXME: Check that `target_abi` matches the actually configured ABI
3491                    // (vec-default vs vec-ext).
3492                    if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::Unspecified, CfgAbi::VecDefault | CfgAbi::VecExtAbi) =>
                true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid PowerPC64 AIX ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3493                        (&self.llvm_abiname, &self.cfg_abi),
3494                        (LlvmAbi::Unspecified, CfgAbi::VecDefault | CfgAbi::VecExtAbi),
3495                        "invalid PowerPC64 AIX ABI name and `cfg(target_abi)` combination:\n\
3496                        ABI name: {}\n\
3497                        cfg(target_abi): {}",
3498                        self.llvm_abiname,
3499                        self.cfg_abi,
3500                    );
3501                } else if self.endian == Endian::Big {
3502                    if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::ElfV1, CfgAbi::ElfV1) | (LlvmAbi::ElfV2, CfgAbi::ElfV2)
                => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid PowerPC64 big-endian ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3503                        (&self.llvm_abiname, &self.cfg_abi),
3504                        (LlvmAbi::ElfV1, CfgAbi::ElfV1) | (LlvmAbi::ElfV2, CfgAbi::ElfV2),
3505                        "invalid PowerPC64 big-endian ABI name and `cfg(target_abi)` combination:\n\
3506                        ABI name: {}\n\
3507                        cfg(target_abi): {}",
3508                        self.llvm_abiname,
3509                        self.cfg_abi,
3510                    );
3511                } else {
3512                    if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::ElfV2, CfgAbi::ElfV2) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid PowerPC64 little-endian ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3513                        (&self.llvm_abiname, &self.cfg_abi),
3514                        (LlvmAbi::ElfV2, CfgAbi::ElfV2),
3515                        "invalid PowerPC64 little-endian ABI name and `cfg(target_abi)` combination:\n\
3516                        ABI name: {}\n\
3517                        cfg(target_abi): {}",
3518                        self.llvm_abiname,
3519                        self.cfg_abi,
3520                    );
3521                }
3522            }
3523            Arch::S390x => {
3524                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on s390x"))
                }));
};check!(
3525                    self.llvm_abiname == LlvmAbi::Unspecified,
3526                    "`llvm_abiname` is unused on s390x"
3527                );
3528                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on s390x"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on s390x");
3529                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.rustc_abi,
                &self.cfg_abi) {
            (Some(RustcAbi::Softfloat), CfgAbi::SoftFloat) |
                (None, CfgAbi::Unspecified | CfgAbi::Other(_)) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid s390x Rust-specific ABI and `cfg(target_abi)` combination:\nRust-specific ABI: {0:?}\ncfg(target_abi): {1}",
                            self.rustc_abi, self.cfg_abi))
                }));
};check_matches!(
3530                    (&self.rustc_abi, &self.cfg_abi),
3531                    (Some(RustcAbi::Softfloat), CfgAbi::SoftFloat)
3532                        | (None, CfgAbi::Unspecified | CfgAbi::Other(_)),
3533                    "invalid s390x Rust-specific ABI and `cfg(target_abi)` combination:\n\
3534                    Rust-specific ABI: {:?}\n\
3535                    cfg(target_abi): {}",
3536                    self.rustc_abi,
3537                    self.cfg_abi,
3538                );
3539            }
3540            Arch::LoongArch32 => {
3541                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on LoongArch"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on LoongArch");
3542                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on LoongArch"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on LoongArch");
3543                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::Ilp32s, CfgAbi::SoftFloat) |
                (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_)) =>
                true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid LoongArch ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3544                    (&self.llvm_abiname, &self.cfg_abi),
3545                    (LlvmAbi::Ilp32s, CfgAbi::SoftFloat)
3546                        | (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_))
3547                        | (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_)),
3548                    "invalid LoongArch ABI name and `cfg(target_abi)` combination:\n\
3549                     ABI name: {}\n\
3550                     cfg(target_abi): {}",
3551                    self.llvm_abiname,
3552                    self.cfg_abi,
3553                );
3554            }
3555            Arch::LoongArch64 => {
3556                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on LoongArch"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on LoongArch");
3557                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on LoongArch"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on LoongArch");
3558                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::Lp64s, CfgAbi::SoftFloat) |
                (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_)) |
                (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_)) =>
                true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid LoongArch ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3559                    (&self.llvm_abiname, &self.cfg_abi),
3560                    (LlvmAbi::Lp64s, CfgAbi::SoftFloat)
3561                        | (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_))
3562                        | (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_)),
3563                    "invalid LoongArch ABI name and `cfg(target_abi)` combination:\n\
3564                     ABI name: {}\n\
3565                     cfg(target_abi): {}",
3566                    self.llvm_abiname,
3567                    self.cfg_abi,
3568                );
3569            }
3570            Arch::Mips | Arch::Mips32r6 => {
3571                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on MIPS"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on MIPS");
3572                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on MIPS"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on MIPS");
3573                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::O32, CfgAbi::Unspecified | CfgAbi::Other(_)) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid MIPS ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3574                    (&self.llvm_abiname, &self.cfg_abi),
3575                    (LlvmAbi::O32, CfgAbi::Unspecified | CfgAbi::Other(_)),
3576                    "invalid MIPS ABI name and `cfg(target_abi)` combination:\n\
3577                     ABI name: {}\n\
3578                     cfg(target_abi): {}",
3579                    self.llvm_abiname,
3580                    self.cfg_abi,
3581                );
3582            }
3583            Arch::Mips64 | Arch::Mips64r6 => {
3584                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on MIPS"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on MIPS");
3585                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on MIPS"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on MIPS");
3586                if !#[allow(non_exhaustive_omitted_patterns)] match (&self.llvm_abiname,
                &self.cfg_abi) {
            (LlvmAbi::N64, CfgAbi::Abi64) |
                (LlvmAbi::N32, CfgAbi::Unspecified | CfgAbi::Other(_)) =>
                true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid MIPS ABI name and `cfg(target_abi)` combination:\nABI name: {0}\ncfg(target_abi): {1}",
                            self.llvm_abiname, self.cfg_abi))
                }));
};check_matches!(
3587                    (&self.llvm_abiname, &self.cfg_abi),
3588                    // No in-tree targets use "n32" but at least for now we let out-of-tree targets
3589                    // experiment with that.
3590                    (LlvmAbi::N64, CfgAbi::Abi64)
3591                        | (LlvmAbi::N32, CfgAbi::Unspecified | CfgAbi::Other(_)),
3592                    "invalid MIPS ABI name and `cfg(target_abi)` combination:\n\
3593                     ABI name: {}\n\
3594                     cfg(target_abi): {}",
3595                    self.llvm_abiname,
3596                    self.cfg_abi,
3597                );
3598            }
3599            Arch::CSky => {
3600                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on CSky"))
                }));
};check!(
3601                    self.llvm_abiname == LlvmAbi::Unspecified,
3602                    "`llvm_abiname` is unused on CSky"
3603                );
3604                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on CSky"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on CSky");
3605                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on CSky"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on CSky");
3606                // FIXME: Check that `target_abi` matches the actually configured ABI (v2 vs v2hf).
3607                if !#[allow(non_exhaustive_omitted_patterns)] match self.cfg_abi {
            CfgAbi::AbiV2 | CfgAbi::AbiV2Hf => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid `target_abi` for CSky"))
                }));
};check_matches!(
3608                    self.cfg_abi,
3609                    CfgAbi::AbiV2 | CfgAbi::AbiV2Hf,
3610                    "invalid `target_abi` for CSky"
3611                );
3612            }
3613            Arch::Wasm32 | Arch::Wasm64 => {
3614                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on wasm"))
                }));
};check!(
3615                    self.llvm_abiname == LlvmAbi::Unspecified,
3616                    "`llvm_abiname` is unused on wasm"
3617                );
3618                if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on wasm"))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on wasm");
3619                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on wasm"))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on wasm");
3620                if !#[allow(non_exhaustive_omitted_patterns)] match self.cfg_abi {
            CfgAbi::Unspecified | CfgAbi::Other(_) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("invalid `target_abi` for wasm"))
                }));
};check_matches!(
3621                    self.cfg_abi,
3622                    CfgAbi::Unspecified | CfgAbi::Other(_),
3623                    "invalid `target_abi` for wasm"
3624                );
3625            }
3626            ref arch => {
3627                if !self.rustc_abi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`rustc_abi` is unused on {0}",
                            arch))
                }));
};check!(self.rustc_abi.is_none(), "`rustc_abi` is unused on {arch}");
3628                // Ensure consistency among built-in targets, but give JSON targets the opportunity
3629                // to experiment with these.
3630                if kind == TargetKind::Builtin {
3631                    if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on {0}",
                            arch))
                }));
};check!(
3632                        self.llvm_abiname == LlvmAbi::Unspecified,
3633                        "`llvm_abiname` is unused on {arch}"
3634                    );
3635                    if !self.llvm_floatabi.is_none() {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_floatabi` is unused on {0}",
                            arch))
                }));
};check!(self.llvm_floatabi.is_none(), "`llvm_floatabi` is unused on {arch}");
3636                    if !#[allow(non_exhaustive_omitted_patterns)] match self.cfg_abi {
            CfgAbi::Unspecified | CfgAbi::Other(_) => true,
            _ => false,
        } {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`target_abi` is unused on {0}",
                            arch))
                }));
};check_matches!(
3637                        self.cfg_abi,
3638                        CfgAbi::Unspecified | CfgAbi::Other(_),
3639                        "`target_abi` is unused on {arch}"
3640                    );
3641                }
3642            }
3643        }
3644
3645        // Check that the target cpu constraints make sense.
3646        if self.need_explicit_cpu {
3647            if !self.requires_consistent_cpu {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("if `need_explicit_cpu` is set, then `requires_consistent_cpu` must be set"))
                }));
};check!(
3648                self.requires_consistent_cpu,
3649                "if `need_explicit_cpu` is set, then `requires_consistent_cpu` must be set"
3650            );
3651        }
3652
3653        // Check that the given target-features string makes some basic sense.
3654        if !self.features.is_empty() {
3655            let mut features_enabled = FxHashSet::default();
3656            let mut features_disabled = FxHashSet::default();
3657            for feat in self.features.split(',') {
3658                if let Some(feat) = feat.strip_prefix("+") {
3659                    features_enabled.insert(feat);
3660                    if features_disabled.contains(feat) {
3661                        return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is both enabled and disabled",
                feat))
    })format!(
3662                            "target feature `{feat}` is both enabled and disabled"
3663                        ));
3664                    }
3665                } else if let Some(feat) = feat.strip_prefix("-") {
3666                    features_disabled.insert(feat);
3667                    if features_enabled.contains(feat) {
3668                        return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is both enabled and disabled",
                feat))
    })format!(
3669                            "target feature `{feat}` is both enabled and disabled"
3670                        ));
3671                    }
3672                } else {
3673                    return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is invalid, must start with `+` or `-`",
                feat))
    })format!(
3674                        "target feature `{feat}` is invalid, must start with `+` or `-`"
3675                    ));
3676                }
3677            }
3678            // Check that we don't mis-set any of the ABI-relevant features.
3679            let abi_feature_constraints = self.abi_required_features();
3680            for feat in abi_feature_constraints.required {
3681                // The feature might be enabled by default so we can't *require* it to show up.
3682                // But it must not be *disabled*.
3683                if features_disabled.contains(feat) {
3684                    return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is required by the ABI but gets disabled in target spec",
                feat))
    })format!(
3685                        "target feature `{feat}` is required by the ABI but gets disabled in target spec"
3686                    ));
3687                }
3688            }
3689            for feat in abi_feature_constraints.incompatible {
3690                // The feature might be disabled by default so we can't *require* it to show up.
3691                // But it must not be *enabled*.
3692                if features_enabled.contains(feat) {
3693                    return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is incompatible with the ABI but gets enabled in target spec",
                feat))
    })format!(
3694                        "target feature `{feat}` is incompatible with the ABI but gets enabled in target spec"
3695                    ));
3696                }
3697            }
3698        }
3699
3700        Ok(())
3701    }
3702
3703    /// Test target self-consistency and JSON encoding/decoding roundtrip.
3704    #[cfg(test)]
3705    fn test_target(mut self) {
3706        let recycled_target =
3707            Target::from_json(&serde_json::to_string(&self.to_json()).unwrap()).map(|(j, _)| j);
3708        self.update_to_cli();
3709        self.check_consistency(TargetKind::Builtin)
3710            .unwrap_or_else(|err| panic!("Target consistency check failed:\n{err}"));
3711        assert_eq!(recycled_target, Ok(self));
3712    }
3713
3714    // Add your target to the whitelist if it has `std` library
3715    // and you certainly want "unknown" for the OS name.
3716    fn can_use_os_unknown(&self) -> bool {
3717        self.llvm_target == "wasm32-unknown-unknown"
3718            || self.llvm_target == "wasm64-unknown-unknown"
3719            || (self.env == Env::Sgx && self.vendor == "fortanix")
3720    }
3721
3722    /// Load a built-in target
3723    pub fn expect_builtin(target_tuple: &TargetTuple) -> Target {
3724        match *target_tuple {
3725            TargetTuple::TargetTuple(ref target_tuple) => {
3726                load_builtin(target_tuple).expect("built-in target")
3727            }
3728            TargetTuple::TargetJson { .. } => {
3729                {
    ::core::panicking::panic_fmt(format_args!("built-in targets doesn\'t support target-paths"));
}panic!("built-in targets doesn't support target-paths")
3730            }
3731        }
3732    }
3733
3734    /// Load all built-in targets
3735    pub fn builtins() -> impl Iterator<Item = Target> {
3736        load_all_builtins()
3737    }
3738
3739    /// Search for a JSON file specifying the given target tuple.
3740    ///
3741    /// If none is found in `$RUST_TARGET_PATH`, look for a file called `target.json` inside the
3742    /// sysroot under the target-tuple's `rustlib` directory. Note that it could also just be a
3743    /// bare filename already, so also check for that. If one of the hardcoded targets we know
3744    /// about, just return it directly.
3745    ///
3746    /// The error string could come from any of the APIs called, including filesystem access and
3747    /// JSON decoding.
3748    pub fn search(
3749        target_tuple: &TargetTuple,
3750        sysroot: &Path,
3751        unstable_options: bool,
3752    ) -> Result<(Target, TargetWarnings), String> {
3753        use std::{env, fs};
3754
3755        fn load_file(
3756            path: &Path,
3757            unstable_options: bool,
3758        ) -> Result<(Target, TargetWarnings), String> {
3759            if !unstable_options {
3760                return Err(
3761                    "custom targets are unstable and require `-Zunstable-options`".to_string()
3762                );
3763            }
3764            let contents = fs::read_to_string(path).map_err(|e| e.to_string())?;
3765            Target::from_json(&contents)
3766        }
3767
3768        match *target_tuple {
3769            TargetTuple::TargetTuple(ref target_tuple) => {
3770                // check if tuple is in list of built-in targets
3771                if let Some(t) = load_builtin(target_tuple) {
3772                    return Ok((t, TargetWarnings::empty()));
3773                }
3774
3775                // search for a file named `target_tuple`.json in RUST_TARGET_PATH
3776                let path = {
3777                    let mut target = target_tuple.to_string();
3778                    target.push_str(".json");
3779                    PathBuf::from(target)
3780                };
3781
3782                let target_path = env::var_os("RUST_TARGET_PATH").unwrap_or_default();
3783
3784                for dir in env::split_paths(&target_path) {
3785                    let p = dir.join(&path);
3786                    if p.is_file() {
3787                        return load_file(&p, unstable_options);
3788                    }
3789                }
3790
3791                // Additionally look in the sysroot under `lib/rustlib/<tuple>/target.json`
3792                // as a fallback.
3793                let rustlib_path = crate::relative_target_rustlib_path(sysroot, target_tuple);
3794                let p = PathBuf::from_iter([
3795                    Path::new(sysroot),
3796                    Path::new(&rustlib_path),
3797                    Path::new("target.json"),
3798                ]);
3799                if p.is_file() {
3800                    return load_file(&p, unstable_options);
3801                }
3802
3803                Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("could not find specification for target {0:?}",
                target_tuple))
    })format!("could not find specification for target {target_tuple:?}"))
3804            }
3805            TargetTuple::TargetJson { ref contents, .. } if !unstable_options => {
3806                Err("custom targets are unstable and require `-Zunstable-options`".to_string())
3807            }
3808            TargetTuple::TargetJson { ref contents, .. } => Target::from_json(contents),
3809        }
3810    }
3811
3812    /// Return the target's small data threshold support, converting
3813    /// `DefaultForArch` into a concrete value.
3814    pub fn small_data_threshold_support(&self) -> SmallDataThresholdSupport {
3815        match &self.options.small_data_threshold_support {
3816            // Avoid having to duplicate the small data support in every
3817            // target file by supporting a default value for each
3818            // architecture.
3819            SmallDataThresholdSupport::DefaultForArch => match self.arch {
3820                Arch::Mips | Arch::Mips64 | Arch::Mips32r6 => {
3821                    SmallDataThresholdSupport::LlvmArg("mips-ssection-threshold".into())
3822                }
3823                Arch::Hexagon => {
3824                    SmallDataThresholdSupport::LlvmArg("hexagon-small-data-threshold".into())
3825                }
3826                Arch::M68k => SmallDataThresholdSupport::LlvmArg("m68k-ssection-threshold".into()),
3827                Arch::RiscV32 | Arch::RiscV64 => {
3828                    SmallDataThresholdSupport::LlvmModuleFlag("SmallDataLimit".into())
3829                }
3830                _ => SmallDataThresholdSupport::None,
3831            },
3832            s => s.clone(),
3833        }
3834    }
3835
3836    pub fn object_architecture(
3837        &self,
3838        unstable_target_features: &FxIndexSet<Symbol>,
3839    ) -> Option<(object::Architecture, Option<object::SubArchitecture>)> {
3840        use object::Architecture;
3841        Some(match self.arch {
3842            Arch::Arm => (Architecture::Arm, None),
3843            Arch::AArch64 => (
3844                if self.pointer_width == 32 {
3845                    Architecture::Aarch64_Ilp32
3846                } else {
3847                    Architecture::Aarch64
3848                },
3849                None,
3850            ),
3851            Arch::X86 => (Architecture::I386, None),
3852            Arch::S390x => (Architecture::S390x, None),
3853            Arch::M68k => (Architecture::M68k, None),
3854            Arch::Mips | Arch::Mips32r6 => (Architecture::Mips, None),
3855            Arch::Mips64 | Arch::Mips64r6 => (
3856                // While there are currently no builtin targets
3857                // using the N32 ABI, it is possible to specify
3858                // it using a custom target specification. N32
3859                // is an ILP32 ABI like the Aarch64_Ilp32
3860                // and X86_64_X32 cases above and below this one.
3861                if self.options.llvm_abiname == LlvmAbi::N32 {
3862                    Architecture::Mips64_N32
3863                } else {
3864                    Architecture::Mips64
3865                },
3866                None,
3867            ),
3868            Arch::X86_64 => (
3869                if self.pointer_width == 32 {
3870                    Architecture::X86_64_X32
3871                } else {
3872                    Architecture::X86_64
3873                },
3874                None,
3875            ),
3876            Arch::PowerPC => (Architecture::PowerPc, None),
3877            Arch::PowerPC64 => (Architecture::PowerPc64, None),
3878            Arch::RiscV32 => (Architecture::Riscv32, None),
3879            Arch::RiscV64 => (Architecture::Riscv64, None),
3880            Arch::Sparc => {
3881                if unstable_target_features.contains(&sym::v8plus) {
3882                    // Target uses V8+, aka EM_SPARC32PLUS, aka 64-bit V9 but in 32-bit mode
3883                    (Architecture::Sparc32Plus, None)
3884                } else {
3885                    // Target uses V7 or V8, aka EM_SPARC
3886                    (Architecture::Sparc, None)
3887                }
3888            }
3889            Arch::Sparc64 => (Architecture::Sparc64, None),
3890            Arch::Avr => (Architecture::Avr, None),
3891            Arch::Msp430 => (Architecture::Msp430, None),
3892            Arch::Hexagon => (Architecture::Hexagon, None),
3893            Arch::Xtensa => (Architecture::Xtensa, None),
3894            Arch::Bpf => (Architecture::Bpf, None),
3895            Arch::LoongArch32 => (Architecture::LoongArch32, None),
3896            Arch::LoongArch64 => (Architecture::LoongArch64, None),
3897            Arch::CSky => (Architecture::Csky, None),
3898            Arch::Arm64EC => (Architecture::Aarch64, Some(object::SubArchitecture::Arm64EC)),
3899            Arch::AmdGpu
3900            | Arch::Nvptx64
3901            | Arch::SpirV
3902            | Arch::Wasm32
3903            | Arch::Wasm64
3904            | Arch::Other(_) => return None,
3905        })
3906    }
3907
3908    /// Returns whether this target is known to have unreliable alignment:
3909    /// native C code for the target fails to align some data to the degree
3910    /// required by the C standard. We can't *really* do anything about that
3911    /// since unsafe Rust code may assume alignment any time, but we can at least
3912    /// inhibit some optimizations, and we suppress the alignment checks that
3913    /// would detect this unsoundness.
3914    ///
3915    /// Every target that returns less than `Align::MAX` here is still has a soundness bug.
3916    pub fn max_reliable_alignment(&self) -> Align {
3917        // FIXME(#112480) MSVC on x86-32 is unsound and fails to properly align many types with
3918        // more-than-4-byte-alignment on the stack. This makes alignments larger than 4 generally
3919        // unreliable on 32bit Windows.
3920        if self.is_like_windows && self.arch == Arch::X86 {
3921            Align::from_bytes(4).unwrap()
3922        } else {
3923            Align::MAX
3924        }
3925    }
3926
3927    pub fn vendor_symbol(&self) -> Symbol {
3928        Symbol::intern(&self.vendor)
3929    }
3930}