Skip to main content

rustc_target/spec/
mod.rs

1//! [Flexible target specification.](https://github.com/rust-lang/rfcs/pull/131)
2//!
3//! Rust targets a wide variety of usecases, and in the interest of flexibility,
4//! allows new target tuples to be defined in configuration files. Most users
5//! will not need to care about these, but this is invaluable when porting Rust
6//! to a new platform, and allows for an unprecedented level of control over how
7//! the compiler works.
8//!
9//! # Using targets and target.json
10//!
11//! Invoking "rustc --target=${TUPLE}" will result in rustc initiating the [`Target::search`] by
12//! - checking if "$TUPLE" is a complete path to a json (ending with ".json") and loading if so
13//! - checking builtin targets for "${TUPLE}"
14//! - checking directories in "${RUST_TARGET_PATH}" for "${TUPLE}.json"
15//! - checking for "${RUSTC_SYSROOT}/lib/rustlib/${TUPLE}/target.json"
16//!
17//! Code will then be compiled using the first discovered target spec.
18//!
19//! # Defining a new target
20//!
21//! Targets are defined using a struct which additionally has serialization to and from [JSON].
22//! The `Target` struct in this module loosely corresponds with the format the JSON takes.
23//! We usually try to make the fields equivalent but we have given up on a 1:1 correspondence
24//! between the JSON and the actual structure itself.
25//!
26//! Some fields are required in every target spec, and they should be embedded in Target directly.
27//! Optional keys are in TargetOptions, but Target derefs to it, for no practical difference.
28//! Most notable is the "data-layout" field which specifies Rust's notion of sizes and alignments
29//! for several key types, such as f64, pointers, and so on.
30//!
31//! At one point we felt `-C` options should override the target's settings, like in C compilers,
32//! but that was an essentially-unmarked route for making code incorrect and Rust unsound.
33//! Confronted with programmers who prefer a compiler with a good UX instead of a lethal weapon,
34//! we have almost-entirely recanted that notion, though we hope "target modifiers" will offer
35//! a way to have a decent UX yet still extend the necessary compiler controls, without
36//! requiring a new target spec for each and every single possible target micro-variant.
37//!
38//! [JSON]: https://json.org
39
40use core::result::Result;
41use std::borrow::Cow;
42use std::collections::BTreeMap;
43use std::fmt;
44use std::hash::Hash;
45use std::ops::{Deref, DerefMut};
46use std::path::{Path, PathBuf};
47use std::str::FromStr;
48
49use rustc_abi::{
50    Align, CVariadicStatus, CanonAbi, Endian, ExternAbi, Integer, Size, TargetDataLayout,
51    TargetDataLayoutError,
52};
53use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
54use rustc_error_messages::{DiagArgValue, IntoDiagArg, into_diag_arg_using_display};
55use rustc_macros::{BlobDecodable, Decodable, Encodable, StableHash};
56use rustc_span::{Symbol, kw, sym};
57use serde_json::Value;
58use tracing::debug;
59
60use crate::json::{Json, ToJson};
61use crate::spec::crt_objects::CrtObjects;
62
63pub mod crt_objects;
64
65mod abi_map;
66mod base;
67mod json;
68mod tuple;
69
70pub use abi_map::{AbiMap, AbiMapping};
71pub use base::apple;
72pub use base::avr::ef_avr_arch;
73pub use json::json_schema;
74pub use tuple::TargetTuple;
75
76/// Linker is called through a C/C++ compiler.
77#[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)]
78pub enum Cc {
79    Yes,
80    No,
81}
82
83/// Linker is LLD.
84#[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)]
85pub enum Lld {
86    Yes,
87    No,
88}
89
90/// All linkers have some kinds of command line interfaces and rustc needs to know which commands
91/// to use with each of them. So we cluster all such interfaces into a (somewhat arbitrary) number
92/// of classes that we call "linker flavors".
93///
94/// Technically, it's not even necessary, we can nearly always infer the flavor from linker name
95/// and target properties like `is_like_windows`/`is_like_darwin`/etc. However, the PRs originally
96/// introducing `-Clinker-flavor` (#40018 and friends) were aiming to reduce this kind of inference
97/// and provide something certain and explicitly specified instead, and that design goal is still
98/// relevant now.
99///
100/// The second goal is to keep the number of flavors to the minimum if possible.
101/// LLD somewhat forces our hand here because that linker is self-sufficient only if its executable
102/// (`argv[0]`) is named in specific way, otherwise it doesn't work and requires a
103/// `-flavor LLD_FLAVOR` argument to choose which logic to use. Our shipped `rust-lld` in
104/// particular is not named in such specific way, so it needs the flavor option, so we make our
105/// linker flavors sufficiently fine-grained to satisfy LLD without inferring its flavor from other
106/// target properties, in accordance with the first design goal.
107///
108/// The first component of the flavor is tightly coupled with the compilation target,
109/// while the `Cc` and `Lld` flags can vary within the same target.
110#[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)]
111pub enum LinkerFlavor {
112    /// Unix-like linker with GNU extensions (both naked and compiler-wrapped forms).
113    /// Besides similar "default" Linux/BSD linkers this also includes Windows/GNU linker,
114    /// which is somewhat different because it doesn't produce ELFs.
115    Gnu(Cc, Lld),
116    /// Unix-like linker for Apple targets (both naked and compiler-wrapped forms).
117    /// Extracted from the "umbrella" `Unix` flavor due to its corresponding LLD flavor.
118    Darwin(Cc, Lld),
119    /// Unix-like linker for Wasm targets (both naked and compiler-wrapped forms).
120    /// Extracted from the "umbrella" `Unix` flavor due to its corresponding LLD flavor.
121    /// Non-LLD version does not exist, so the lld flag is currently hardcoded here.
122    WasmLld(Cc),
123    /// Basic Unix-like linker for "any other Unix" targets (Solaris/illumos, L4Re, MSP430, etc),
124    /// possibly with non-GNU extensions (both naked and compiler-wrapped forms).
125    /// LLD doesn't support any of these.
126    Unix(Cc),
127    /// MSVC-style linker for Windows and UEFI, LLD supports it.
128    Msvc(Lld),
129    /// Emscripten Compiler Frontend, a wrapper around `WasmLld(Cc::Yes)` that has a different
130    /// interface and produces some additional JavaScript output.
131    EmCc,
132    // Below: other linker-like tools with unique interfaces for exotic targets.
133    /// Linker tool for BPF.
134    Bpf,
135    /// LLVM bitcode linker that can be used as a `self-contained` linker
136    Llbc,
137}
138
139/// Linker flavors available externally through command line (`-Clinker-flavor`)
140/// or json target specifications.
141/// This set has accumulated historically, and contains both (stable and unstable) legacy values, as
142/// well as modern ones matching the internal linker flavors (`LinkerFlavor`).
143#[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)]
144pub enum LinkerFlavorCli {
145    // Modern (unstable) flavors, with direct counterparts in `LinkerFlavor`.
146    Gnu(Cc, Lld),
147    Darwin(Cc, Lld),
148    WasmLld(Cc),
149    Unix(Cc),
150    // Note: `Msvc(Lld::No)` is also a stable value.
151    Msvc(Lld),
152    EmCc,
153    Bpf,
154    Llbc,
155
156    // Legacy stable values
157    Gcc,
158    Ld,
159    Lld(LldFlavor),
160    Em,
161}
162
163impl LinkerFlavorCli {
164    /// Returns whether this `-C linker-flavor` option is one of the unstable values.
165    pub fn is_unstable(&self) -> bool {
166        match self {
167            LinkerFlavorCli::Gnu(..)
168            | LinkerFlavorCli::Darwin(..)
169            | LinkerFlavorCli::WasmLld(..)
170            | LinkerFlavorCli::Unix(..)
171            | LinkerFlavorCli::Msvc(Lld::Yes)
172            | LinkerFlavorCli::EmCc
173            | LinkerFlavorCli::Bpf
174            | LinkerFlavorCli::Llbc => true,
175            LinkerFlavorCli::Gcc
176            | LinkerFlavorCli::Ld
177            | LinkerFlavorCli::Lld(..)
178            | LinkerFlavorCli::Msvc(Lld::No)
179            | LinkerFlavorCli::Em => false,
180        }
181    }
182}
183
184#[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! {
185    pub enum LldFlavor {
186        Wasm = "wasm",
187        Ld64 = "darwin",
188        Ld = "gnu",
189        Link = "link",
190    }
191
192    parse_error_type = "LLD flavor";
193}
194
195impl LinkerFlavor {
196    /// At this point the target's reference linker flavor doesn't yet exist and we need to infer
197    /// it. The inference always succeeds and gives some result, and we don't report any flavor
198    /// incompatibility errors for json target specs. The CLI flavor is used as the main source
199    /// of truth, other flags are used in case of ambiguities.
200    fn from_cli_json(cli: LinkerFlavorCli, lld_flavor: LldFlavor, is_gnu: bool) -> LinkerFlavor {
201        match cli {
202            LinkerFlavorCli::Gnu(cc, lld) => LinkerFlavor::Gnu(cc, lld),
203            LinkerFlavorCli::Darwin(cc, lld) => LinkerFlavor::Darwin(cc, lld),
204            LinkerFlavorCli::WasmLld(cc) => LinkerFlavor::WasmLld(cc),
205            LinkerFlavorCli::Unix(cc) => LinkerFlavor::Unix(cc),
206            LinkerFlavorCli::Msvc(lld) => LinkerFlavor::Msvc(lld),
207            LinkerFlavorCli::EmCc => LinkerFlavor::EmCc,
208            LinkerFlavorCli::Bpf => LinkerFlavor::Bpf,
209            LinkerFlavorCli::Llbc => LinkerFlavor::Llbc,
210
211            // Below: legacy stable values
212            LinkerFlavorCli::Gcc => match lld_flavor {
213                LldFlavor::Ld if is_gnu => LinkerFlavor::Gnu(Cc::Yes, Lld::No),
214                LldFlavor::Ld64 => LinkerFlavor::Darwin(Cc::Yes, Lld::No),
215                LldFlavor::Wasm => LinkerFlavor::WasmLld(Cc::Yes),
216                LldFlavor::Ld | LldFlavor::Link => LinkerFlavor::Unix(Cc::Yes),
217            },
218            LinkerFlavorCli::Ld => match lld_flavor {
219                LldFlavor::Ld if is_gnu => LinkerFlavor::Gnu(Cc::No, Lld::No),
220                LldFlavor::Ld64 => LinkerFlavor::Darwin(Cc::No, Lld::No),
221                LldFlavor::Ld | LldFlavor::Wasm | LldFlavor::Link => LinkerFlavor::Unix(Cc::No),
222            },
223            LinkerFlavorCli::Lld(LldFlavor::Ld) => LinkerFlavor::Gnu(Cc::No, Lld::Yes),
224            LinkerFlavorCli::Lld(LldFlavor::Ld64) => LinkerFlavor::Darwin(Cc::No, Lld::Yes),
225            LinkerFlavorCli::Lld(LldFlavor::Wasm) => LinkerFlavor::WasmLld(Cc::No),
226            LinkerFlavorCli::Lld(LldFlavor::Link) => LinkerFlavor::Msvc(Lld::Yes),
227            LinkerFlavorCli::Em => LinkerFlavor::EmCc,
228        }
229    }
230
231    /// Returns the corresponding backwards-compatible CLI flavor.
232    fn to_cli(self) -> LinkerFlavorCli {
233        match self {
234            LinkerFlavor::Gnu(Cc::Yes, _)
235            | LinkerFlavor::Darwin(Cc::Yes, _)
236            | LinkerFlavor::WasmLld(Cc::Yes)
237            | LinkerFlavor::Unix(Cc::Yes) => LinkerFlavorCli::Gcc,
238            LinkerFlavor::Gnu(_, Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Ld),
239            LinkerFlavor::Darwin(_, Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Ld64),
240            LinkerFlavor::WasmLld(..) => LinkerFlavorCli::Lld(LldFlavor::Wasm),
241            LinkerFlavor::Gnu(..) | LinkerFlavor::Darwin(..) | LinkerFlavor::Unix(..) => {
242                LinkerFlavorCli::Ld
243            }
244            LinkerFlavor::Msvc(Lld::Yes) => LinkerFlavorCli::Lld(LldFlavor::Link),
245            LinkerFlavor::Msvc(..) => LinkerFlavorCli::Msvc(Lld::No),
246            LinkerFlavor::EmCc => LinkerFlavorCli::Em,
247            LinkerFlavor::Bpf => LinkerFlavorCli::Bpf,
248            LinkerFlavor::Llbc => LinkerFlavorCli::Llbc,
249        }
250    }
251
252    /// Returns the modern CLI flavor that is the counterpart of this flavor.
253    fn to_cli_counterpart(self) -> LinkerFlavorCli {
254        match self {
255            LinkerFlavor::Gnu(cc, lld) => LinkerFlavorCli::Gnu(cc, lld),
256            LinkerFlavor::Darwin(cc, lld) => LinkerFlavorCli::Darwin(cc, lld),
257            LinkerFlavor::WasmLld(cc) => LinkerFlavorCli::WasmLld(cc),
258            LinkerFlavor::Unix(cc) => LinkerFlavorCli::Unix(cc),
259            LinkerFlavor::Msvc(lld) => LinkerFlavorCli::Msvc(lld),
260            LinkerFlavor::EmCc => LinkerFlavorCli::EmCc,
261            LinkerFlavor::Bpf => LinkerFlavorCli::Bpf,
262            LinkerFlavor::Llbc => LinkerFlavorCli::Llbc,
263        }
264    }
265
266    fn infer_cli_hints(cli: LinkerFlavorCli) -> (Option<Cc>, Option<Lld>) {
267        match cli {
268            LinkerFlavorCli::Gnu(cc, lld) | LinkerFlavorCli::Darwin(cc, lld) => {
269                (Some(cc), Some(lld))
270            }
271            LinkerFlavorCli::WasmLld(cc) => (Some(cc), Some(Lld::Yes)),
272            LinkerFlavorCli::Unix(cc) => (Some(cc), None),
273            LinkerFlavorCli::Msvc(lld) => (Some(Cc::No), Some(lld)),
274            LinkerFlavorCli::EmCc => (Some(Cc::Yes), Some(Lld::Yes)),
275            LinkerFlavorCli::Bpf => (None, None),
276            LinkerFlavorCli::Llbc => (None, None),
277
278            // Below: legacy stable values
279            LinkerFlavorCli::Gcc => (Some(Cc::Yes), None),
280            LinkerFlavorCli::Ld => (Some(Cc::No), Some(Lld::No)),
281            LinkerFlavorCli::Lld(_) => (Some(Cc::No), Some(Lld::Yes)),
282            LinkerFlavorCli::Em => (Some(Cc::Yes), Some(Lld::Yes)),
283        }
284    }
285
286    fn infer_linker_hints(linker_stem: &str) -> Result<Self, (Option<Cc>, Option<Lld>)> {
287        // Remove any version postfix.
288        let stem = linker_stem
289            .rsplit_once('-')
290            .and_then(|(lhs, rhs)| rhs.chars().all(char::is_numeric).then_some(lhs))
291            .unwrap_or(linker_stem);
292
293        if stem == "llvm-bitcode-linker" {
294            Ok(Self::Llbc)
295        } else if stem == "emcc" // GCC/Clang can have an optional target prefix.
296            || stem == "gcc"
297            || stem.ends_with("-gcc")
298            || stem == "g++"
299            || stem.ends_with("-g++")
300            || stem == "clang"
301            || stem.ends_with("-clang")
302            || stem == "clang++"
303            || stem.ends_with("-clang++")
304        {
305            Err((Some(Cc::Yes), Some(Lld::No)))
306        } else if stem == "wasm-ld"
307            || stem.ends_with("-wasm-ld")
308            || stem == "ld.lld"
309            || stem == "lld"
310            || stem == "rust-lld"
311            || stem == "lld-link"
312        {
313            Err((Some(Cc::No), Some(Lld::Yes)))
314        } else if stem == "ld" || stem.ends_with("-ld") || stem == "link" {
315            Err((Some(Cc::No), Some(Lld::No)))
316        } else {
317            Err((None, None))
318        }
319    }
320
321    fn with_hints(self, (cc_hint, lld_hint): (Option<Cc>, Option<Lld>)) -> LinkerFlavor {
322        match self {
323            LinkerFlavor::Gnu(cc, lld) => {
324                LinkerFlavor::Gnu(cc_hint.unwrap_or(cc), lld_hint.unwrap_or(lld))
325            }
326            LinkerFlavor::Darwin(cc, lld) => {
327                LinkerFlavor::Darwin(cc_hint.unwrap_or(cc), lld_hint.unwrap_or(lld))
328            }
329            LinkerFlavor::WasmLld(cc) => LinkerFlavor::WasmLld(cc_hint.unwrap_or(cc)),
330            LinkerFlavor::Unix(cc) => LinkerFlavor::Unix(cc_hint.unwrap_or(cc)),
331            LinkerFlavor::Msvc(lld) => LinkerFlavor::Msvc(lld_hint.unwrap_or(lld)),
332            LinkerFlavor::EmCc | LinkerFlavor::Bpf | LinkerFlavor::Llbc => self,
333        }
334    }
335
336    pub fn with_cli_hints(self, cli: LinkerFlavorCli) -> LinkerFlavor {
337        self.with_hints(LinkerFlavor::infer_cli_hints(cli))
338    }
339
340    pub fn with_linker_hints(self, linker_stem: &str) -> LinkerFlavor {
341        match LinkerFlavor::infer_linker_hints(linker_stem) {
342            Ok(linker_flavor) => linker_flavor,
343            Err(hints) => self.with_hints(hints),
344        }
345    }
346
347    pub fn check_compatibility(self, cli: LinkerFlavorCli) -> Option<String> {
348        let compatible = |cli| {
349            // The CLI flavor should be compatible with the target if:
350            match (self, cli) {
351                // they are counterparts: they have the same principal flavor.
352                (LinkerFlavor::Gnu(..), LinkerFlavorCli::Gnu(..))
353                | (LinkerFlavor::Darwin(..), LinkerFlavorCli::Darwin(..))
354                | (LinkerFlavor::WasmLld(..), LinkerFlavorCli::WasmLld(..))
355                | (LinkerFlavor::Unix(..), LinkerFlavorCli::Unix(..))
356                | (LinkerFlavor::Msvc(..), LinkerFlavorCli::Msvc(..))
357                | (LinkerFlavor::EmCc, LinkerFlavorCli::EmCc)
358                | (LinkerFlavor::Bpf, LinkerFlavorCli::Bpf)
359                | (LinkerFlavor::Llbc, LinkerFlavorCli::Llbc) => return true,
360                _ => {}
361            }
362
363            // 3. or, the flavor is legacy and survives this roundtrip.
364            cli == self.with_cli_hints(cli).to_cli()
365        };
366        (!compatible(cli)).then(|| {
367            LinkerFlavorCli::all()
368                .iter()
369                .filter(|cli| compatible(**cli))
370                .map(|cli| cli.desc())
371                .intersperse(", ")
372                .collect()
373        })
374    }
375
376    pub fn lld_flavor(self) -> LldFlavor {
377        match self {
378            LinkerFlavor::Gnu(..)
379            | LinkerFlavor::Unix(..)
380            | LinkerFlavor::EmCc
381            | LinkerFlavor::Bpf
382            | LinkerFlavor::Llbc => LldFlavor::Ld,
383            LinkerFlavor::Darwin(..) => LldFlavor::Ld64,
384            LinkerFlavor::WasmLld(..) => LldFlavor::Wasm,
385            LinkerFlavor::Msvc(..) => LldFlavor::Link,
386        }
387    }
388
389    pub fn is_gnu(self) -> bool {
390        #[allow(non_exhaustive_omitted_patterns)] match self {
    LinkerFlavor::Gnu(..) => true,
    _ => false,
}matches!(self, LinkerFlavor::Gnu(..))
391    }
392
393    /// Returns whether the flavor uses the `lld` linker.
394    pub fn uses_lld(self) -> bool {
395        // Exhaustive match in case new flavors are added in the future.
396        match self {
397            LinkerFlavor::Gnu(_, Lld::Yes)
398            | LinkerFlavor::Darwin(_, Lld::Yes)
399            | LinkerFlavor::WasmLld(..)
400            | LinkerFlavor::EmCc
401            | LinkerFlavor::Msvc(Lld::Yes) => true,
402            LinkerFlavor::Gnu(..)
403            | LinkerFlavor::Darwin(..)
404            | LinkerFlavor::Msvc(_)
405            | LinkerFlavor::Unix(_)
406            | LinkerFlavor::Bpf
407            | LinkerFlavor::Llbc => false,
408        }
409    }
410
411    /// Returns whether the flavor calls the linker via a C/C++ compiler.
412    pub fn uses_cc(self) -> bool {
413        // Exhaustive match in case new flavors are added in the future.
414        match self {
415            LinkerFlavor::Gnu(Cc::Yes, _)
416            | LinkerFlavor::Darwin(Cc::Yes, _)
417            | LinkerFlavor::WasmLld(Cc::Yes)
418            | LinkerFlavor::Unix(Cc::Yes)
419            | LinkerFlavor::EmCc => true,
420            LinkerFlavor::Gnu(..)
421            | LinkerFlavor::Darwin(..)
422            | LinkerFlavor::WasmLld(_)
423            | LinkerFlavor::Msvc(_)
424            | LinkerFlavor::Unix(_)
425            | LinkerFlavor::Bpf
426            | LinkerFlavor::Llbc => false,
427        }
428    }
429
430    /// For flavors with an `Lld` component, ensure it's enabled. Otherwise, returns the given
431    /// flavor unmodified.
432    pub fn with_lld_enabled(self) -> LinkerFlavor {
433        match self {
434            LinkerFlavor::Gnu(cc, Lld::No) => LinkerFlavor::Gnu(cc, Lld::Yes),
435            LinkerFlavor::Darwin(cc, Lld::No) => LinkerFlavor::Darwin(cc, Lld::Yes),
436            LinkerFlavor::Msvc(Lld::No) => LinkerFlavor::Msvc(Lld::Yes),
437            _ => self,
438        }
439    }
440
441    /// For flavors with an `Lld` component, ensure it's disabled. Otherwise, returns the given
442    /// flavor unmodified.
443    pub fn with_lld_disabled(self) -> LinkerFlavor {
444        match self {
445            LinkerFlavor::Gnu(cc, Lld::Yes) => LinkerFlavor::Gnu(cc, Lld::No),
446            LinkerFlavor::Darwin(cc, Lld::Yes) => LinkerFlavor::Darwin(cc, Lld::No),
447            LinkerFlavor::Msvc(Lld::Yes) => LinkerFlavor::Msvc(Lld::No),
448            _ => self,
449        }
450    }
451}
452
453macro_rules! linker_flavor_cli_impls {
454    ($(($($flavor:tt)*) $string:literal)*) => (
455        impl LinkerFlavorCli {
456            const fn all() -> &'static [LinkerFlavorCli] {
457                &[$($($flavor)*,)*]
458            }
459
460            pub const fn one_of() -> &'static str {
461                concat!("one of: ", $($string, " ",)*)
462            }
463
464            pub fn desc(self) -> &'static str {
465                match self {
466                    $($($flavor)* => $string,)*
467                }
468            }
469        }
470
471        impl FromStr for LinkerFlavorCli {
472            type Err = String;
473
474            fn from_str(s: &str) -> Result<LinkerFlavorCli, Self::Err> {
475                Ok(match s {
476                    $($string => $($flavor)*,)*
477                    _ => return Err(format!("invalid linker flavor, allowed values: {}", Self::one_of())),
478                })
479            }
480        }
481    )
482}
483
484impl 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! {
485    (LinkerFlavorCli::Gnu(Cc::No, Lld::No)) "gnu"
486    (LinkerFlavorCli::Gnu(Cc::No, Lld::Yes)) "gnu-lld"
487    (LinkerFlavorCli::Gnu(Cc::Yes, Lld::No)) "gnu-cc"
488    (LinkerFlavorCli::Gnu(Cc::Yes, Lld::Yes)) "gnu-lld-cc"
489    (LinkerFlavorCli::Darwin(Cc::No, Lld::No)) "darwin"
490    (LinkerFlavorCli::Darwin(Cc::No, Lld::Yes)) "darwin-lld"
491    (LinkerFlavorCli::Darwin(Cc::Yes, Lld::No)) "darwin-cc"
492    (LinkerFlavorCli::Darwin(Cc::Yes, Lld::Yes)) "darwin-lld-cc"
493    (LinkerFlavorCli::WasmLld(Cc::No)) "wasm-lld"
494    (LinkerFlavorCli::WasmLld(Cc::Yes)) "wasm-lld-cc"
495    (LinkerFlavorCli::Unix(Cc::No)) "unix"
496    (LinkerFlavorCli::Unix(Cc::Yes)) "unix-cc"
497    (LinkerFlavorCli::Msvc(Lld::Yes)) "msvc-lld"
498    (LinkerFlavorCli::Msvc(Lld::No)) "msvc"
499    (LinkerFlavorCli::EmCc) "em-cc"
500    (LinkerFlavorCli::Bpf) "bpf"
501    (LinkerFlavorCli::Llbc) "llbc"
502
503    // Legacy stable flavors
504    (LinkerFlavorCli::Gcc) "gcc"
505    (LinkerFlavorCli::Ld) "ld"
506    (LinkerFlavorCli::Lld(LldFlavor::Ld)) "ld.lld"
507    (LinkerFlavorCli::Lld(LldFlavor::Ld64)) "ld64.lld"
508    (LinkerFlavorCli::Lld(LldFlavor::Link)) "lld-link"
509    (LinkerFlavorCli::Lld(LldFlavor::Wasm)) "wasm-ld"
510    (LinkerFlavorCli::Em) "em"
511}
512
513impl<'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);
514impl schemars::JsonSchema for LinkerFlavorCli {
515    fn schema_name() -> std::borrow::Cow<'static, str> {
516        "LinkerFlavor".into()
517    }
518    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
519        let all: Vec<&'static str> =
520            Self::all().iter().map(|flavor| flavor.desc()).collect::<Vec<_>>();
521        <::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! ({
522            "type": "string",
523            "enum": all
524        })
525    }
526}
527
528impl ToJson for LinkerFlavorCli {
529    fn to_json(&self) -> Json {
530        self.desc().to_json()
531    }
532}
533
534/// The different `-Clink-self-contained` options that can be specified in a target spec:
535/// - enabling or disabling in bulk
536/// - some target-specific pieces of inference to determine whether to use self-contained linking
537///   if `-Clink-self-contained` is not specified explicitly (e.g. on musl/mingw)
538/// - explicitly enabling some of the self-contained linking components, e.g. the linker component
539///   to use `rust-lld`
540#[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)]
541pub enum LinkSelfContainedDefault {
542    /// The target spec explicitly enables self-contained linking.
543    True,
544
545    /// The target spec explicitly disables self-contained linking.
546    False,
547
548    /// The target spec requests that the self-contained mode is inferred, in the context of musl.
549    InferredForMusl,
550
551    /// The target spec requests that the self-contained mode is inferred, in the context of mingw.
552    InferredForMingw,
553
554    /// The target spec explicitly enables a list of self-contained linking components: e.g. for
555    /// targets opting into a subset of components like the CLI's `-C link-self-contained=+linker`.
556    WithComponents(LinkSelfContainedComponents),
557}
558
559/// Parses a backwards-compatible `-Clink-self-contained` option string, without components.
560impl FromStr for LinkSelfContainedDefault {
561    type Err = String;
562
563    fn from_str(s: &str) -> Result<LinkSelfContainedDefault, Self::Err> {
564        Ok(match s {
565            "false" => LinkSelfContainedDefault::False,
566            "true" | "wasm" => LinkSelfContainedDefault::True,
567            "musl" => LinkSelfContainedDefault::InferredForMusl,
568            "mingw" => LinkSelfContainedDefault::InferredForMingw,
569            _ => {
570                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!(
571                    "'{s}' is not a valid `-Clink-self-contained` default. \
572                        Use 'false', 'true', 'wasm', 'musl' or 'mingw'",
573                ));
574            }
575        })
576    }
577}
578
579impl<'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);
580impl schemars::JsonSchema for LinkSelfContainedDefault {
581    fn schema_name() -> std::borrow::Cow<'static, str> {
582        "LinkSelfContainedDefault".into()
583    }
584    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
585        <::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! ({
586            "type": "string",
587            "enum": ["false", "true", "wasm", "musl", "mingw"]
588        })
589    }
590}
591
592impl ToJson for LinkSelfContainedDefault {
593    fn to_json(&self) -> Json {
594        match *self {
595            LinkSelfContainedDefault::WithComponents(components) => {
596                // Serialize the components in a json object's `components` field, to prepare for a
597                // future where `crt-objects-fallback` is removed from the json specs and
598                // incorporated as a field here.
599                let mut map = BTreeMap::new();
600                map.insert("components", components);
601                map.to_json()
602            }
603
604            // Stable backwards-compatible values
605            LinkSelfContainedDefault::True => "true".to_json(),
606            LinkSelfContainedDefault::False => "false".to_json(),
607            LinkSelfContainedDefault::InferredForMusl => "musl".to_json(),
608            LinkSelfContainedDefault::InferredForMingw => "mingw".to_json(),
609        }
610    }
611}
612
613impl LinkSelfContainedDefault {
614    /// Returns whether the target spec has self-contained linking explicitly disabled. Used to emit
615    /// errors if the user then enables it on the CLI.
616    pub fn is_disabled(self) -> bool {
617        self == LinkSelfContainedDefault::False
618    }
619
620    /// Returns the key to use when serializing the setting to json:
621    /// - individual components in a `link-self-contained` object value
622    /// - the other variants as a backwards-compatible `crt-objects-fallback` string
623    fn json_key(self) -> &'static str {
624        match self {
625            LinkSelfContainedDefault::WithComponents(_) => "link-self-contained",
626            _ => "crt-objects-fallback",
627        }
628    }
629
630    /// Creates a `LinkSelfContainedDefault` enabling the self-contained linker for target specs
631    /// (the equivalent of `-Clink-self-contained=+linker` on the CLI).
632    pub fn with_linker() -> LinkSelfContainedDefault {
633        LinkSelfContainedDefault::WithComponents(LinkSelfContainedComponents::LINKER)
634    }
635}
636
637bitflags::bitflags! {
638    #[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)]
639    /// The `-C link-self-contained` components that can individually be enabled or disabled.
640    pub struct LinkSelfContainedComponents: u8 {
641        /// CRT objects (e.g. on `windows-gnu`, `musl`, `wasi` targets)
642        const CRT_OBJECTS = 1 << 0;
643        /// libc static library (e.g. on `musl`, `wasi` targets)
644        const LIBC        = 1 << 1;
645        /// libgcc/libunwind (e.g. on `windows-gnu`, `fuchsia`, `fortanix`, `gnullvm` targets)
646        const UNWIND      = 1 << 2;
647        /// Linker, dlltool, and their necessary libraries (e.g. on `windows-gnu` and for `rust-lld`)
648        const LINKER      = 1 << 3;
649        /// Sanitizer runtime libraries
650        const SANITIZERS  = 1 << 4;
651        /// Other MinGW libs and Windows import libs
652        const MINGW       = 1 << 5;
653    }
654}
655impl ::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 }
656
657impl LinkSelfContainedComponents {
658    /// Return the component's name.
659    ///
660    /// Returns `None` if the bitflags aren't a singular component (but a mix of multiple flags).
661    pub fn as_str(self) -> Option<&'static str> {
662        Some(match self {
663            LinkSelfContainedComponents::CRT_OBJECTS => "crto",
664            LinkSelfContainedComponents::LIBC => "libc",
665            LinkSelfContainedComponents::UNWIND => "unwind",
666            LinkSelfContainedComponents::LINKER => "linker",
667            LinkSelfContainedComponents::SANITIZERS => "sanitizers",
668            LinkSelfContainedComponents::MINGW => "mingw",
669            _ => return None,
670        })
671    }
672
673    /// Returns an array of all the components.
674    fn all_components() -> [LinkSelfContainedComponents; 6] {
675        [
676            LinkSelfContainedComponents::CRT_OBJECTS,
677            LinkSelfContainedComponents::LIBC,
678            LinkSelfContainedComponents::UNWIND,
679            LinkSelfContainedComponents::LINKER,
680            LinkSelfContainedComponents::SANITIZERS,
681            LinkSelfContainedComponents::MINGW,
682        ]
683    }
684
685    /// Returns whether at least a component is enabled.
686    pub fn are_any_components_enabled(self) -> bool {
687        !self.is_empty()
688    }
689
690    /// Returns whether `LinkSelfContainedComponents::LINKER` is enabled.
691    pub fn is_linker_enabled(self) -> bool {
692        self.contains(LinkSelfContainedComponents::LINKER)
693    }
694
695    /// Returns whether `LinkSelfContainedComponents::CRT_OBJECTS` is enabled.
696    pub fn is_crt_objects_enabled(self) -> bool {
697        self.contains(LinkSelfContainedComponents::CRT_OBJECTS)
698    }
699}
700
701impl FromStr for LinkSelfContainedComponents {
702    type Err = String;
703
704    /// Parses a single `-Clink-self-contained` well-known component, not a set of flags.
705    fn from_str(s: &str) -> Result<Self, Self::Err> {
706        Ok(match s {
707            "crto" => LinkSelfContainedComponents::CRT_OBJECTS,
708            "libc" => LinkSelfContainedComponents::LIBC,
709            "unwind" => LinkSelfContainedComponents::UNWIND,
710            "linker" => LinkSelfContainedComponents::LINKER,
711            "sanitizers" => LinkSelfContainedComponents::SANITIZERS,
712            "mingw" => LinkSelfContainedComponents::MINGW,
713            _ => {
714                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!(
715                    "'{s}' is not a valid link-self-contained component, expected 'crto', 'libc', 'unwind', 'linker', 'sanitizers', 'mingw'"
716                ));
717            }
718        })
719    }
720}
721
722impl<'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);
723impl schemars::JsonSchema for LinkSelfContainedComponents {
724    fn schema_name() -> std::borrow::Cow<'static, str> {
725        "LinkSelfContainedComponents".into()
726    }
727    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
728        let all =
729            Self::all_components().iter().map(|component| component.as_str()).collect::<Vec<_>>();
730        <::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! ({
731            "type": "string",
732            "enum": all,
733        })
734    }
735}
736
737impl ToJson for LinkSelfContainedComponents {
738    fn to_json(&self) -> Json {
739        let components: Vec<_> = Self::all_components()
740            .into_iter()
741            .filter(|c| self.contains(*c))
742            .map(|c| {
743                // We can unwrap because we're iterating over all the known singular components,
744                // not an actual set of flags where `as_str` can fail.
745                c.as_str().unwrap().to_owned()
746            })
747            .collect();
748
749        components.to_json()
750    }
751}
752
753bitflags::bitflags! {
754    /// The `-C linker-features` components that can individually be enabled or disabled.
755    ///
756    /// They are feature flags intended to be a more flexible mechanism than linker flavors, and
757    /// also to prevent a combinatorial explosion of flavors whenever a new linker feature is
758    /// required. These flags are "generic", in the sense that they can work on multiple targets on
759    /// the CLI. Otherwise, one would have to select different linkers flavors for each target.
760    ///
761    /// Here are some examples of the advantages they offer:
762    /// - default feature sets for principal flavors, or for specific targets.
763    /// - flavor-specific features: for example, clang offers automatic cross-linking with
764    ///   `--target`, which gcc-style compilers don't support. The *flavor* is still a C/C++
765    ///   compiler, and we don't need to multiply the number of flavors for this use-case. Instead,
766    ///   we can have a single `+target` feature.
767    /// - umbrella features: for example if clang accumulates more features in the future than just
768    ///   the `+target` above. That could be modeled as `+clang`.
769    /// - niche features for resolving specific issues: for example, on Apple targets the linker
770    ///   flag implementing the `as-needed` native link modifier (#99424) is only possible on
771    ///   sufficiently recent linker versions.
772    /// - still allows for discovery and automation, for example via feature detection. This can be
773    ///   useful in exotic environments/build systems.
774    #[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)]
775    pub struct LinkerFeatures: u8 {
776        /// Invoke the linker via a C/C++ compiler (e.g. on most unix targets).
777        const CC  = 1 << 0;
778        /// Use the lld linker, either the system lld or the self-contained linker `rust-lld`.
779        const LLD = 1 << 1;
780    }
781}
782impl ::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 }
783
784impl LinkerFeatures {
785    /// Parses a single `-C linker-features` well-known feature, not a set of flags.
786    pub fn from_str(s: &str) -> Option<LinkerFeatures> {
787        Some(match s {
788            "cc" => LinkerFeatures::CC,
789            "lld" => LinkerFeatures::LLD,
790            _ => return None,
791        })
792    }
793
794    /// Return the linker feature name, as would be passed on the CLI.
795    ///
796    /// Returns `None` if the bitflags aren't a singular component (but a mix of multiple flags).
797    pub fn as_str(self) -> Option<&'static str> {
798        Some(match self {
799            LinkerFeatures::CC => "cc",
800            LinkerFeatures::LLD => "lld",
801            _ => return None,
802        })
803    }
804
805    /// Returns whether the `lld` linker feature is enabled.
806    pub fn is_lld_enabled(self) -> bool {
807        self.contains(LinkerFeatures::LLD)
808    }
809
810    /// Returns whether the `cc` linker feature is enabled.
811    pub fn is_cc_enabled(self) -> bool {
812        self.contains(LinkerFeatures::CC)
813    }
814}
815
816#[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! {
817    #[derive(Encodable, BlobDecodable, StableHash)]
818    pub enum PanicStrategy {
819        Unwind = "unwind",
820        Abort = "abort",
821        ImmediateAbort = "immediate-abort",
822    }
823
824    parse_error_type = "panic strategy";
825}
826
827#[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)]
828pub enum OnBrokenPipe {
829    Default,
830    Kill,
831    Error,
832    Inherit,
833}
834
835impl PanicStrategy {
836    pub const fn desc_symbol(&self) -> Symbol {
837        match *self {
838            PanicStrategy::Unwind => sym::unwind,
839            PanicStrategy::Abort => sym::abort,
840            PanicStrategy::ImmediateAbort => sym::immediate_abort,
841        }
842    }
843
844    pub fn unwinds(self) -> bool {
845        #[allow(non_exhaustive_omitted_patterns)] match self {
    PanicStrategy::Unwind => true,
    _ => false,
}matches!(self, PanicStrategy::Unwind)
846    }
847}
848
849#[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! {
850    pub enum RelroLevel {
851        Full = "full",
852        Partial = "partial",
853        Off = "off",
854        None = "none",
855    }
856
857    parse_error_type = "relro level";
858}
859
860impl IntoDiagArg for PanicStrategy {
861    fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> DiagArgValue {
862        DiagArgValue::Str(Cow::Owned(self.desc().to_string()))
863    }
864}
865
866#[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! {
867    pub enum SymbolVisibility {
868        Hidden = "hidden",
869        Protected = "protected",
870        Interposable = "interposable",
871    }
872
873    parse_error_type = "symbol visibility";
874}
875
876#[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)]
877pub enum SmallDataThresholdSupport {
878    None,
879    DefaultForArch,
880    LlvmModuleFlag(StaticCow<str>),
881    LlvmArg(StaticCow<str>),
882}
883
884impl FromStr for SmallDataThresholdSupport {
885    type Err = String;
886
887    fn from_str(s: &str) -> Result<Self, Self::Err> {
888        if s == "none" {
889            Ok(Self::None)
890        } else if s == "default-for-arch" {
891            Ok(Self::DefaultForArch)
892        } else if let Some(flag) = s.strip_prefix("llvm-module-flag=") {
893            Ok(Self::LlvmModuleFlag(flag.to_string().into()))
894        } else if let Some(arg) = s.strip_prefix("llvm-arg=") {
895            Ok(Self::LlvmArg(arg.to_string().into()))
896        } else {
897            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."))
898        }
899    }
900}
901
902impl<'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);
903impl schemars::JsonSchema for SmallDataThresholdSupport {
904    fn schema_name() -> std::borrow::Cow<'static, str> {
905        "SmallDataThresholdSupport".into()
906    }
907    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
908        <::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! ({
909            "type": "string",
910            "pattern": r#"^none|default-for-arch|llvm-module-flag=.+|llvm-arg=.+$"#,
911        })
912    }
913}
914
915impl ToJson for SmallDataThresholdSupport {
916    fn to_json(&self) -> Value {
917        match self {
918            Self::None => "none".to_json(),
919            Self::DefaultForArch => "default-for-arch".to_json(),
920            Self::LlvmModuleFlag(flag) => ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("llvm-module-flag={0}", flag))
    })format!("llvm-module-flag={flag}").to_json(),
921            Self::LlvmArg(arg) => ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("llvm-arg={0}", arg))
    })format!("llvm-arg={arg}").to_json(),
922        }
923    }
924}
925
926#[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! {
927    pub enum MergeFunctions {
928        Disabled = "disabled",
929        Trampolines = "trampolines",
930        Aliases = "aliases",
931    }
932
933    parse_error_type = "value for merge-functions";
934}
935
936#[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! {
937    pub enum RelocModel {
938        Static = "static",
939        Pic = "pic",
940        Pie = "pie",
941        DynamicNoPic = "dynamic-no-pic",
942        Ropi = "ropi",
943        Rwpi = "rwpi",
944        RopiRwpi = "ropi-rwpi",
945    }
946
947    parse_error_type = "relocation model";
948}
949
950impl RelocModel {
951    pub const fn desc_symbol(&self) -> Symbol {
952        match *self {
953            RelocModel::Static => kw::Static,
954            RelocModel::Pic => sym::pic,
955            RelocModel::Pie => sym::pie,
956            RelocModel::DynamicNoPic => sym::dynamic_no_pic,
957            RelocModel::Ropi => sym::ropi,
958            RelocModel::Rwpi => sym::rwpi,
959            RelocModel::RopiRwpi => sym::ropi_rwpi,
960        }
961    }
962}
963
964#[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! {
965    pub enum CodeModel {
966        Tiny = "tiny",
967        Small = "small",
968        Kernel = "kernel",
969        Medium = "medium",
970        Large = "large",
971    }
972
973    parse_error_type = "code model";
974}
975
976#[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! {
977    /// The float ABI setting to be configured in the LLVM target machine.
978    pub enum FloatAbi {
979        Soft = "soft",
980        Hard = "hard",
981    }
982
983    parse_error_type = "float abi";
984}
985
986#[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! {
987    /// The Rustc-specific variant of the ABI used for this target.
988    pub enum RustcAbi {
989        /// On x86-32 only: make use of SSE and SSE2 for ABI purposes.
990        X86Sse2 = "x86-sse2",
991        /// On PowerPC only: build for SPE.
992        PowerPcSpe = "powerpc-spe",
993        /// On x86-32/64, aarch64, and S390x: do not use any FPU or SIMD registers for the ABI.
994        Softfloat = "softfloat",
995    }
996
997    parse_error_type = "rustc abi";
998}
999
1000#[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! {
1001    pub enum TlsModel {
1002        GeneralDynamic = "global-dynamic",
1003        LocalDynamic = "local-dynamic",
1004        InitialExec = "initial-exec",
1005        LocalExec = "local-exec",
1006        Emulated = "emulated",
1007    }
1008
1009    parse_error_type = "TLS model";
1010}
1011
1012#[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! {
1013    /// Everything is flattened to a single enum to make the json encoding/decoding less annoying.
1014    pub enum LinkOutputKind {
1015        /// Dynamically linked non position-independent executable.
1016        DynamicNoPicExe = "dynamic-nopic-exe",
1017        /// Dynamically linked position-independent executable.
1018        DynamicPicExe = "dynamic-pic-exe",
1019        /// Statically linked non position-independent executable.
1020        StaticNoPicExe = "static-nopic-exe",
1021        /// Statically linked position-independent executable.
1022        StaticPicExe = "static-pic-exe",
1023        /// Regular dynamic library ("dynamically linked").
1024        DynamicDylib = "dynamic-dylib",
1025        /// Dynamic library with bundled libc ("statically linked").
1026        StaticDylib = "static-dylib",
1027        /// WASI module with a lifetime past the _initialize entry point
1028        WasiReactorExe = "wasi-reactor-exe",
1029    }
1030
1031    parse_error_type = "CRT object kind";
1032}
1033
1034impl LinkOutputKind {
1035    pub fn can_link_dylib(self) -> bool {
1036        match self {
1037            LinkOutputKind::StaticNoPicExe | LinkOutputKind::StaticPicExe => false,
1038            LinkOutputKind::DynamicNoPicExe
1039            | LinkOutputKind::DynamicPicExe
1040            | LinkOutputKind::DynamicDylib
1041            | LinkOutputKind::StaticDylib
1042            | LinkOutputKind::WasiReactorExe => true,
1043        }
1044    }
1045}
1046
1047pub type LinkArgs = BTreeMap<LinkerFlavor, Vec<StaticCow<str>>>;
1048pub type LinkArgsCli = BTreeMap<LinkerFlavorCli, Vec<StaticCow<str>>>;
1049
1050#[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! {
1051    /// Which kind of debuginfo does the target use?
1052    ///
1053    /// Useful in determining whether a target supports Split DWARF (a target with
1054    /// `DebuginfoKind::Dwarf` and supporting `SplitDebuginfo::Unpacked` for example).
1055    #[derive(Default)]
1056    pub enum DebuginfoKind {
1057        /// DWARF debuginfo (such as that used on `x86_64_unknown_linux_gnu`).
1058        #[default]
1059        Dwarf = "dwarf",
1060        /// DWARF debuginfo in dSYM files (such as on Apple platforms).
1061        DwarfDsym = "dwarf-dsym",
1062        /// Program database files (such as on Windows).
1063        Pdb = "pdb",
1064    }
1065
1066    parse_error_type = "debuginfo kind";
1067}
1068
1069#[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! {
1070    #[derive(Default, Encodable, Decodable)]
1071    pub enum SplitDebuginfo {
1072        /// Split debug-information is disabled, meaning that on supported platforms
1073        /// you can find all debug information in the executable itself. This is
1074        /// only supported for ELF effectively.
1075        ///
1076        /// * Windows - not supported
1077        /// * macOS - don't run `dsymutil`
1078        /// * ELF - `.debug_*` sections
1079        #[default]
1080        Off = "off",
1081
1082        /// Split debug-information can be found in a "packed" location separate
1083        /// from the final artifact. This is supported on all platforms.
1084        ///
1085        /// * Windows - `*.pdb`
1086        /// * macOS - `*.dSYM` (run `dsymutil`)
1087        /// * ELF - `*.dwp` (run `thorin`)
1088        Packed = "packed",
1089
1090        /// Split debug-information can be found in individual object files on the
1091        /// filesystem. The main executable may point to the object files.
1092        ///
1093        /// * Windows - not supported
1094        /// * macOS - supported, scattered object files
1095        /// * ELF - supported, scattered `*.dwo` or `*.o` files (see `SplitDwarfKind`)
1096        Unpacked = "unpacked",
1097    }
1098
1099    parse_error_type = "split debuginfo";
1100}
1101
1102impl ::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);
1103
1104#[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)]
1105#[serde(tag = "kind")]
1106#[serde(rename_all = "kebab-case")]
1107pub enum StackProbeType {
1108    /// Don't emit any stack probes.
1109    None,
1110    /// It is harmless to use this option even on targets that do not have backend support for
1111    /// stack probes as the failure mode is the same as if no stack-probe option was specified in
1112    /// the first place.
1113    Inline,
1114    /// Call `__rust_probestack` whenever stack needs to be probed.
1115    Call,
1116    /// Use inline option for LLVM versions later than specified in `min_llvm_version_for_inline`
1117    /// and call `__rust_probestack` otherwise.
1118    InlineOrCall {
1119        #[serde(rename = "min-llvm-version-for-inline")]
1120        min_llvm_version_for_inline: (u32, u32, u32),
1121    },
1122}
1123
1124impl ToJson for StackProbeType {
1125    fn to_json(&self) -> Json {
1126        Json::Object(match self {
1127            StackProbeType::None => {
1128                [(String::from("kind"), "none".to_json())].into_iter().collect()
1129            }
1130            StackProbeType::Inline => {
1131                [(String::from("kind"), "inline".to_json())].into_iter().collect()
1132            }
1133            StackProbeType::Call => {
1134                [(String::from("kind"), "call".to_json())].into_iter().collect()
1135            }
1136            StackProbeType::InlineOrCall { min_llvm_version_for_inline: (maj, min, patch) } => [
1137                (String::from("kind"), "inline-or-call".to_json()),
1138                (
1139                    String::from("min-llvm-version-for-inline"),
1140                    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()]),
1141                ),
1142            ]
1143            .into_iter()
1144            .collect(),
1145        })
1146    }
1147}
1148
1149#[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)]
1150pub struct SanitizerSet(u16);
1151impl 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! {
1152    impl SanitizerSet: u16 {
1153        const ADDRESS = 1 << 0;
1154        const LEAK    = 1 << 1;
1155        const MEMORY  = 1 << 2;
1156        const THREAD  = 1 << 3;
1157        const HWADDRESS = 1 << 4;
1158        const CFI     = 1 << 5;
1159        const MEMTAG  = 1 << 6;
1160        const SHADOWCALLSTACK = 1 << 7;
1161        const KCFI    = 1 << 8;
1162        const KERNELADDRESS = 1 << 9;
1163        const KERNELHWADDRESS = 1 << 10;
1164        const SAFESTACK = 1 << 11;
1165        const DATAFLOW = 1 << 12;
1166        const REALTIME = 1 << 13;
1167    }
1168}
1169impl ::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 }
1170
1171impl SanitizerSet {
1172    // Taken from LLVM's sanitizer compatibility logic:
1173    // https://github.com/llvm/llvm-project/blob/release/18.x/clang/lib/Driver/SanitizerArgs.cpp#L512
1174    const MUTUALLY_EXCLUSIVE: &'static [(SanitizerSet, SanitizerSet)] = &[
1175        (SanitizerSet::ADDRESS, SanitizerSet::MEMORY),
1176        (SanitizerSet::ADDRESS, SanitizerSet::THREAD),
1177        (SanitizerSet::ADDRESS, SanitizerSet::HWADDRESS),
1178        (SanitizerSet::ADDRESS, SanitizerSet::MEMTAG),
1179        (SanitizerSet::ADDRESS, SanitizerSet::KERNELADDRESS),
1180        (SanitizerSet::ADDRESS, SanitizerSet::KERNELHWADDRESS),
1181        (SanitizerSet::ADDRESS, SanitizerSet::SAFESTACK),
1182        (SanitizerSet::LEAK, SanitizerSet::MEMORY),
1183        (SanitizerSet::LEAK, SanitizerSet::THREAD),
1184        (SanitizerSet::LEAK, SanitizerSet::KERNELADDRESS),
1185        (SanitizerSet::LEAK, SanitizerSet::KERNELHWADDRESS),
1186        (SanitizerSet::LEAK, SanitizerSet::SAFESTACK),
1187        (SanitizerSet::MEMORY, SanitizerSet::THREAD),
1188        (SanitizerSet::MEMORY, SanitizerSet::HWADDRESS),
1189        (SanitizerSet::MEMORY, SanitizerSet::KERNELADDRESS),
1190        (SanitizerSet::MEMORY, SanitizerSet::KERNELHWADDRESS),
1191        (SanitizerSet::MEMORY, SanitizerSet::SAFESTACK),
1192        (SanitizerSet::THREAD, SanitizerSet::HWADDRESS),
1193        (SanitizerSet::THREAD, SanitizerSet::KERNELADDRESS),
1194        (SanitizerSet::THREAD, SanitizerSet::KERNELHWADDRESS),
1195        (SanitizerSet::THREAD, SanitizerSet::SAFESTACK),
1196        (SanitizerSet::HWADDRESS, SanitizerSet::MEMTAG),
1197        (SanitizerSet::HWADDRESS, SanitizerSet::KERNELADDRESS),
1198        (SanitizerSet::HWADDRESS, SanitizerSet::KERNELHWADDRESS),
1199        (SanitizerSet::HWADDRESS, SanitizerSet::SAFESTACK),
1200        (SanitizerSet::CFI, SanitizerSet::KCFI),
1201        (SanitizerSet::MEMTAG, SanitizerSet::KERNELADDRESS),
1202        (SanitizerSet::MEMTAG, SanitizerSet::KERNELHWADDRESS),
1203        (SanitizerSet::KERNELADDRESS, SanitizerSet::KERNELHWADDRESS),
1204        (SanitizerSet::KERNELADDRESS, SanitizerSet::SAFESTACK),
1205        (SanitizerSet::KERNELHWADDRESS, SanitizerSet::SAFESTACK),
1206    ];
1207
1208    /// Return sanitizer's name
1209    ///
1210    /// Returns none if the flags is a set of sanitizers numbering not exactly one.
1211    pub fn as_str(self) -> Option<&'static str> {
1212        Some(match self {
1213            SanitizerSet::ADDRESS => "address",
1214            SanitizerSet::CFI => "cfi",
1215            SanitizerSet::DATAFLOW => "dataflow",
1216            SanitizerSet::KCFI => "kcfi",
1217            SanitizerSet::KERNELADDRESS => "kernel-address",
1218            SanitizerSet::KERNELHWADDRESS => "kernel-hwaddress",
1219            SanitizerSet::LEAK => "leak",
1220            SanitizerSet::MEMORY => "memory",
1221            SanitizerSet::MEMTAG => "memtag",
1222            SanitizerSet::SAFESTACK => "safestack",
1223            SanitizerSet::SHADOWCALLSTACK => "shadow-call-stack",
1224            SanitizerSet::THREAD => "thread",
1225            SanitizerSet::HWADDRESS => "hwaddress",
1226            SanitizerSet::REALTIME => "realtime",
1227            _ => return None,
1228        })
1229    }
1230
1231    pub fn mutually_exclusive(self) -> Option<(SanitizerSet, SanitizerSet)> {
1232        Self::MUTUALLY_EXCLUSIVE
1233            .into_iter()
1234            .find(|&(a, b)| self.contains(*a) && self.contains(*b))
1235            .copied()
1236    }
1237}
1238
1239/// Formats a sanitizer set as a comma separated list of sanitizers' names.
1240impl fmt::Display for SanitizerSet {
1241    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1242        let mut first = true;
1243        for s in *self {
1244            let name = s.as_str().unwrap_or_else(|| {
    ::core::panicking::panic_fmt(format_args!("unrecognized sanitizer {0:?}",
            s));
}panic!("unrecognized sanitizer {s:?}"));
1245            if !first {
1246                f.write_str(", ")?;
1247            }
1248            f.write_str(name)?;
1249            first = false;
1250        }
1251        Ok(())
1252    }
1253}
1254
1255impl FromStr for SanitizerSet {
1256    type Err = String;
1257    fn from_str(s: &str) -> Result<Self, Self::Err> {
1258        Ok(match s {
1259            "address" => SanitizerSet::ADDRESS,
1260            "cfi" => SanitizerSet::CFI,
1261            "dataflow" => SanitizerSet::DATAFLOW,
1262            "kcfi" => SanitizerSet::KCFI,
1263            "kernel-address" => SanitizerSet::KERNELADDRESS,
1264            "kernel-hwaddress" => SanitizerSet::KERNELHWADDRESS,
1265            "leak" => SanitizerSet::LEAK,
1266            "memory" => SanitizerSet::MEMORY,
1267            "memtag" => SanitizerSet::MEMTAG,
1268            "safestack" => SanitizerSet::SAFESTACK,
1269            "shadow-call-stack" => SanitizerSet::SHADOWCALLSTACK,
1270            "thread" => SanitizerSet::THREAD,
1271            "hwaddress" => SanitizerSet::HWADDRESS,
1272            "realtime" => SanitizerSet::REALTIME,
1273            s => return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("unknown sanitizer {0}", s))
    })format!("unknown sanitizer {s}")),
1274        })
1275    }
1276}
1277
1278impl<'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);
1279impl schemars::JsonSchema for SanitizerSet {
1280    fn schema_name() -> std::borrow::Cow<'static, str> {
1281        "SanitizerSet".into()
1282    }
1283    fn json_schema(_: &mut schemars::SchemaGenerator) -> schemars::Schema {
1284        let all = Self::all().iter().map(|sanitizer| sanitizer.as_str()).collect::<Vec<_>>();
1285        <::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! ({
1286            "type": "string",
1287            "enum": all,
1288        })
1289    }
1290}
1291
1292impl ToJson for SanitizerSet {
1293    fn to_json(&self) -> Json {
1294        self.into_iter()
1295            .map(|v| Some(v.as_str()?.to_json()))
1296            .collect::<Option<Vec<_>>>()
1297            .unwrap_or_default()
1298            .to_json()
1299    }
1300}
1301
1302#[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! {
1303    pub enum FramePointer {
1304        /// Forces the machine code generator to always preserve the frame pointers.
1305        Always = "always",
1306        /// Forces the machine code generator to preserve the frame pointers except for the leaf
1307        /// functions (i.e. those that don't call other functions).
1308        NonLeaf = "non-leaf",
1309        /// Allows the machine code generator to omit the frame pointers.
1310        ///
1311        /// This option does not guarantee that the frame pointers will be omitted.
1312        MayOmit = "may-omit",
1313    }
1314
1315    parse_error_type = "frame pointer";
1316}
1317
1318impl FramePointer {
1319    /// It is intended that the "force frame pointer" transition is "one way"
1320    /// so this convenience assures such if used
1321    #[inline]
1322    pub fn ratchet(&mut self, rhs: FramePointer) -> FramePointer {
1323        *self = match (*self, rhs) {
1324            (FramePointer::Always, _) | (_, FramePointer::Always) => FramePointer::Always,
1325            (FramePointer::NonLeaf, _) | (_, FramePointer::NonLeaf) => FramePointer::NonLeaf,
1326            _ => FramePointer::MayOmit,
1327        };
1328        *self
1329    }
1330}
1331
1332#[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! {
1333    /// Controls use of stack canaries.
1334    #[derive(Encodable, BlobDecodable, StableHash)]
1335    pub enum StackProtector {
1336        /// Disable stack canary generation.
1337        None = "none",
1338
1339        /// On LLVM, mark all generated LLVM functions with the `ssp` attribute (see
1340        /// llvm/docs/LangRef.rst). This triggers stack canary generation in
1341        /// functions which contain an array of a byte-sized type with more than
1342        /// eight elements.
1343        Basic = "basic",
1344
1345        /// On LLVM, mark all generated LLVM functions with the `sspstrong`
1346        /// attribute (see llvm/docs/LangRef.rst). This triggers stack canary
1347        /// generation in functions which either contain an array, or which take
1348        /// the address of a local variable.
1349        Strong = "strong",
1350
1351        /// Generate stack canaries in all functions.
1352        All = "all",
1353    }
1354
1355    parse_error_type = "stack protector";
1356}
1357
1358impl ::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);
1359
1360#[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! {
1361    pub enum BinaryFormat {
1362        Coff = "coff",
1363        Elf = "elf",
1364        MachO = "mach-o",
1365        Wasm = "wasm",
1366        Xcoff = "xcoff",
1367    }
1368
1369    parse_error_type = "binary format";
1370}
1371
1372impl BinaryFormat {
1373    /// Returns [`object::BinaryFormat`] for given `BinaryFormat`
1374    pub fn to_object(&self) -> object::BinaryFormat {
1375        match self {
1376            Self::Coff => object::BinaryFormat::Coff,
1377            Self::Elf => object::BinaryFormat::Elf,
1378            Self::MachO => object::BinaryFormat::MachO,
1379            Self::Wasm => object::BinaryFormat::Wasm,
1380            Self::Xcoff => object::BinaryFormat::Xcoff,
1381        }
1382    }
1383
1384    pub fn desc_symbol(&self) -> Symbol {
1385        match self {
1386            Self::Coff => sym::coff,
1387            Self::Elf => sym::elf,
1388            Self::MachO => sym::macho,
1389            Self::Wasm => sym::wasm,
1390            Self::Xcoff => sym::xcoff,
1391        }
1392    }
1393}
1394
1395impl ToJson for Align {
1396    fn to_json(&self) -> Json {
1397        self.bits().to_json()
1398    }
1399}
1400
1401macro_rules! supported_targets {
1402    ( $(($tuple:literal, $module:ident),)+ ) => {
1403        mod targets {
1404            $(pub(crate) mod $module;)+
1405        }
1406
1407        /// List of supported targets
1408        pub static TARGETS: &[&str] = &[$($tuple),+];
1409
1410        fn load_builtin(target: &str) -> Option<Target> {
1411            let t = match target {
1412                $( $tuple => targets::$module::target(), )+
1413                _ => return None,
1414            };
1415            debug!("got builtin target: {:?}", t);
1416            Some(t)
1417        }
1418
1419        fn load_all_builtins() -> impl Iterator<Item = Target> {
1420            [
1421                $( targets::$module::target, )+
1422            ]
1423            .into_iter()
1424            .map(|f| f())
1425        }
1426
1427        #[cfg(test)]
1428        mod tests {
1429            // Cannot put this into a separate file without duplication, make an exception.
1430            $(
1431                #[test] // `#[test]`
1432                fn $module() {
1433                    crate::spec::targets::$module::target().test_target()
1434                }
1435            )+
1436        }
1437    };
1438}
1439
1440mod 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::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::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,
                    ..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::{Env, Target};
        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;
            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(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),
                    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")]),
                    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,
                    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:1440",
                            "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(1440u32),
                            ::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};
                    let mut iter = __CALLSITE.metadata().fields().iter();
                    __CALLSITE.metadata().fields().value_set(&[(&::tracing::__macro_support::Iterator::next(&mut iter).expect("FieldSet corrupted (this is a bug)"),
                                        ::tracing::__macro_support::Option::Some(&format_args!("got builtin target: {0:?}",
                                                        t) as &dyn 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! {
1441    ("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
1442    ("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32),
1443    ("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
1444    ("i586-unknown-linux-gnu", i586_unknown_linux_gnu),
1445    ("loongarch64-unknown-linux-gnu", loongarch64_unknown_linux_gnu),
1446    ("loongarch64-unknown-linux-musl", loongarch64_unknown_linux_musl),
1447    ("m68k-unknown-linux-gnu", m68k_unknown_linux_gnu),
1448    ("m68k-unknown-none-elf", m68k_unknown_none_elf),
1449    ("csky-unknown-linux-gnuabiv2", csky_unknown_linux_gnuabiv2),
1450    ("csky-unknown-linux-gnuabiv2hf", csky_unknown_linux_gnuabiv2hf),
1451    ("mips-unknown-linux-gnu", mips_unknown_linux_gnu),
1452    ("mips64-unknown-linux-gnuabi64", mips64_unknown_linux_gnuabi64),
1453    ("mips64el-unknown-linux-gnuabi64", mips64el_unknown_linux_gnuabi64),
1454    ("mipsisa32r6-unknown-linux-gnu", mipsisa32r6_unknown_linux_gnu),
1455    ("mipsisa32r6el-unknown-linux-gnu", mipsisa32r6el_unknown_linux_gnu),
1456    ("mipsisa64r6-unknown-linux-gnuabi64", mipsisa64r6_unknown_linux_gnuabi64),
1457    ("mipsisa64r6el-unknown-linux-gnuabi64", mipsisa64r6el_unknown_linux_gnuabi64),
1458    ("mipsel-unknown-linux-gnu", mipsel_unknown_linux_gnu),
1459    ("powerpc-unknown-linux-gnu", powerpc_unknown_linux_gnu),
1460    ("powerpc-unknown-linux-gnuspe", powerpc_unknown_linux_gnuspe),
1461    ("powerpc-unknown-linux-musl", powerpc_unknown_linux_musl),
1462    ("powerpc-unknown-linux-muslspe", powerpc_unknown_linux_muslspe),
1463    ("powerpc64-ibm-aix", powerpc64_ibm_aix),
1464    ("powerpc64-unknown-linux-gnu", powerpc64_unknown_linux_gnu),
1465    ("powerpc64-unknown-linux-gnuelfv2", powerpc64_unknown_linux_gnuelfv2),
1466    ("powerpc64-unknown-linux-musl", powerpc64_unknown_linux_musl),
1467    ("powerpc64le-unknown-linux-gnu", powerpc64le_unknown_linux_gnu),
1468    ("powerpc64le-unknown-linux-musl", powerpc64le_unknown_linux_musl),
1469    ("s390x-unknown-linux-gnu", s390x_unknown_linux_gnu),
1470    ("s390x-unknown-none-softfloat", s390x_unknown_none_softfloat),
1471    ("s390x-unknown-linux-musl", s390x_unknown_linux_musl),
1472    ("sparc-unknown-linux-gnu", sparc_unknown_linux_gnu),
1473    ("sparc64-unknown-linux-gnu", sparc64_unknown_linux_gnu),
1474    ("arm-unknown-linux-gnueabi", arm_unknown_linux_gnueabi),
1475    ("arm-unknown-linux-gnueabihf", arm_unknown_linux_gnueabihf),
1476    ("armeb-unknown-linux-gnueabi", armeb_unknown_linux_gnueabi),
1477    ("arm-unknown-linux-musleabi", arm_unknown_linux_musleabi),
1478    ("arm-unknown-linux-musleabihf", arm_unknown_linux_musleabihf),
1479    ("armv4t-unknown-linux-gnueabi", armv4t_unknown_linux_gnueabi),
1480    ("armv5te-unknown-linux-gnueabi", armv5te_unknown_linux_gnueabi),
1481    ("armv5te-unknown-linux-musleabi", armv5te_unknown_linux_musleabi),
1482    ("armv5te-unknown-linux-uclibceabi", armv5te_unknown_linux_uclibceabi),
1483    ("armv7-unknown-linux-gnueabi", armv7_unknown_linux_gnueabi),
1484    ("armv7-unknown-linux-gnueabihf", armv7_unknown_linux_gnueabihf),
1485    ("thumbv7neon-unknown-linux-gnueabihf", thumbv7neon_unknown_linux_gnueabihf),
1486    ("thumbv7neon-unknown-linux-musleabihf", thumbv7neon_unknown_linux_musleabihf),
1487    ("armv7-unknown-linux-musleabi", armv7_unknown_linux_musleabi),
1488    ("armv7-unknown-linux-musleabihf", armv7_unknown_linux_musleabihf),
1489    ("aarch64-unknown-linux-gnu", aarch64_unknown_linux_gnu),
1490    ("aarch64-unknown-linux-musl", aarch64_unknown_linux_musl),
1491    ("aarch64-unknown-linux-pauthtest", aarch64_unknown_linux_pauthtest),
1492    ("aarch64_be-unknown-linux-musl", aarch64_be_unknown_linux_musl),
1493    ("x86_64-unknown-linux-musl", x86_64_unknown_linux_musl),
1494    ("i686-unknown-linux-musl", i686_unknown_linux_musl),
1495    ("i586-unknown-linux-musl", i586_unknown_linux_musl),
1496    ("mips-unknown-linux-musl", mips_unknown_linux_musl),
1497    ("mipsel-unknown-linux-musl", mipsel_unknown_linux_musl),
1498    ("mips64-unknown-linux-muslabi64", mips64_unknown_linux_muslabi64),
1499    ("mips64el-unknown-linux-muslabi64", mips64el_unknown_linux_muslabi64),
1500    ("hexagon-unknown-linux-musl", hexagon_unknown_linux_musl),
1501    ("hexagon-unknown-none-elf", hexagon_unknown_none_elf),
1502    ("hexagon-unknown-qurt", hexagon_unknown_qurt),
1503
1504    ("mips-unknown-linux-uclibc", mips_unknown_linux_uclibc),
1505    ("mipsel-unknown-linux-uclibc", mipsel_unknown_linux_uclibc),
1506
1507    ("i686-linux-android", i686_linux_android),
1508    ("x86_64-linux-android", x86_64_linux_android),
1509    ("arm-linux-androideabi", arm_linux_androideabi),
1510    ("armv7-linux-androideabi", armv7_linux_androideabi),
1511    ("thumbv7neon-linux-androideabi", thumbv7neon_linux_androideabi),
1512    ("aarch64-linux-android", aarch64_linux_android),
1513    ("riscv64-linux-android", riscv64_linux_android),
1514
1515    ("aarch64-unknown-freebsd", aarch64_unknown_freebsd),
1516    ("armv6-unknown-freebsd", armv6_unknown_freebsd),
1517    ("armv7-unknown-freebsd", armv7_unknown_freebsd),
1518    ("i686-unknown-freebsd", i686_unknown_freebsd),
1519    ("powerpc-unknown-freebsd", powerpc_unknown_freebsd),
1520    ("powerpc64-unknown-freebsd", powerpc64_unknown_freebsd),
1521    ("powerpc64le-unknown-freebsd", powerpc64le_unknown_freebsd),
1522    ("riscv64gc-unknown-freebsd", riscv64gc_unknown_freebsd),
1523    ("x86_64-unknown-freebsd", x86_64_unknown_freebsd),
1524
1525    ("x86_64-unknown-dragonfly", x86_64_unknown_dragonfly),
1526
1527    ("aarch64-unknown-openbsd", aarch64_unknown_openbsd),
1528    ("i686-unknown-openbsd", i686_unknown_openbsd),
1529    ("powerpc-unknown-openbsd", powerpc_unknown_openbsd),
1530    ("powerpc64-unknown-openbsd", powerpc64_unknown_openbsd),
1531    ("riscv64gc-unknown-openbsd", riscv64gc_unknown_openbsd),
1532    ("sparc64-unknown-openbsd", sparc64_unknown_openbsd),
1533    ("x86_64-unknown-openbsd", x86_64_unknown_openbsd),
1534
1535    ("aarch64-unknown-netbsd", aarch64_unknown_netbsd),
1536    ("aarch64_be-unknown-netbsd", aarch64_be_unknown_netbsd),
1537    ("armv6-unknown-netbsd-eabihf", armv6_unknown_netbsd_eabihf),
1538    ("armv7-unknown-netbsd-eabihf", armv7_unknown_netbsd_eabihf),
1539    ("i586-unknown-netbsd", i586_unknown_netbsd),
1540    ("i686-unknown-netbsd", i686_unknown_netbsd),
1541    ("mipsel-unknown-netbsd", mipsel_unknown_netbsd),
1542    ("powerpc-unknown-netbsd", powerpc_unknown_netbsd),
1543    ("riscv64gc-unknown-netbsd", riscv64gc_unknown_netbsd),
1544    ("sparc64-unknown-netbsd", sparc64_unknown_netbsd),
1545    ("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
1546
1547    ("i686-unknown-haiku", i686_unknown_haiku),
1548    ("x86_64-unknown-haiku", x86_64_unknown_haiku),
1549
1550    ("aarch64-unknown-helenos", aarch64_unknown_helenos),
1551    ("i686-unknown-helenos", i686_unknown_helenos),
1552    ("powerpc-unknown-helenos", powerpc_unknown_helenos),
1553    ("sparc64-unknown-helenos", sparc64_unknown_helenos),
1554    ("x86_64-unknown-helenos", x86_64_unknown_helenos),
1555
1556    ("i686-unknown-hurd-gnu", i686_unknown_hurd_gnu),
1557    ("x86_64-unknown-hurd-gnu", x86_64_unknown_hurd_gnu),
1558
1559    ("aarch64-apple-darwin", aarch64_apple_darwin),
1560    ("arm64e-apple-darwin", arm64e_apple_darwin),
1561    ("x86_64-apple-darwin", x86_64_apple_darwin),
1562    ("x86_64h-apple-darwin", x86_64h_apple_darwin),
1563    ("i686-apple-darwin", i686_apple_darwin),
1564
1565    ("aarch64-unknown-fuchsia", aarch64_unknown_fuchsia),
1566    ("riscv64gc-unknown-fuchsia", riscv64gc_unknown_fuchsia),
1567    ("x86_64-unknown-fuchsia", x86_64_unknown_fuchsia),
1568
1569    ("avr-none", avr_none),
1570
1571    ("x86_64-unknown-l4re-uclibc", x86_64_unknown_l4re_uclibc),
1572
1573    ("aarch64-unknown-redox", aarch64_unknown_redox),
1574    ("i586-unknown-redox", i586_unknown_redox),
1575    ("riscv64gc-unknown-redox", riscv64gc_unknown_redox),
1576    ("x86_64-unknown-redox", x86_64_unknown_redox),
1577
1578    ("x86_64-unknown-managarm-mlibc", x86_64_unknown_managarm_mlibc),
1579    ("aarch64-unknown-managarm-mlibc", aarch64_unknown_managarm_mlibc),
1580    ("riscv64gc-unknown-managarm-mlibc", riscv64gc_unknown_managarm_mlibc),
1581
1582    ("i386-apple-ios", i386_apple_ios),
1583    ("x86_64-apple-ios", x86_64_apple_ios),
1584    ("aarch64-apple-ios", aarch64_apple_ios),
1585    ("arm64e-apple-ios", arm64e_apple_ios),
1586    ("armv7s-apple-ios", armv7s_apple_ios),
1587    ("x86_64-apple-ios-macabi", x86_64_apple_ios_macabi),
1588    ("aarch64-apple-ios-macabi", aarch64_apple_ios_macabi),
1589    ("aarch64-apple-ios-sim", aarch64_apple_ios_sim),
1590
1591    ("aarch64-apple-tvos", aarch64_apple_tvos),
1592    ("aarch64-apple-tvos-sim", aarch64_apple_tvos_sim),
1593    ("arm64e-apple-tvos", arm64e_apple_tvos),
1594    ("x86_64-apple-tvos", x86_64_apple_tvos),
1595
1596    ("armv7k-apple-watchos", armv7k_apple_watchos),
1597    ("arm64_32-apple-watchos", arm64_32_apple_watchos),
1598    ("x86_64-apple-watchos-sim", x86_64_apple_watchos_sim),
1599    ("aarch64-apple-watchos", aarch64_apple_watchos),
1600    ("aarch64-apple-watchos-sim", aarch64_apple_watchos_sim),
1601
1602    ("aarch64-apple-visionos", aarch64_apple_visionos),
1603    ("aarch64-apple-visionos-sim", aarch64_apple_visionos_sim),
1604
1605    ("armebv7r-none-eabi", armebv7r_none_eabi),
1606    ("armebv7r-none-eabihf", armebv7r_none_eabihf),
1607    ("armv7r-none-eabi", armv7r_none_eabi),
1608    ("thumbv7r-none-eabi", thumbv7r_none_eabi),
1609    ("armv7r-none-eabihf", armv7r_none_eabihf),
1610    ("thumbv7r-none-eabihf", thumbv7r_none_eabihf),
1611    ("armv8r-none-eabihf", armv8r_none_eabihf),
1612    ("thumbv8r-none-eabihf", thumbv8r_none_eabihf),
1613
1614    ("armv7-rtems-eabihf", armv7_rtems_eabihf),
1615
1616    ("x86_64-pc-solaris", x86_64_pc_solaris),
1617    ("sparcv9-sun-solaris", sparcv9_sun_solaris),
1618
1619    ("x86_64-unknown-illumos", x86_64_unknown_illumos),
1620    ("aarch64-unknown-illumos", aarch64_unknown_illumos),
1621
1622    ("x86_64-pc-windows-gnu", x86_64_pc_windows_gnu),
1623    ("x86_64-uwp-windows-gnu", x86_64_uwp_windows_gnu),
1624    ("x86_64-win7-windows-gnu", x86_64_win7_windows_gnu),
1625    ("i686-pc-windows-gnu", i686_pc_windows_gnu),
1626    ("i686-uwp-windows-gnu", i686_uwp_windows_gnu),
1627    ("i686-win7-windows-gnu", i686_win7_windows_gnu),
1628
1629    ("aarch64-pc-windows-gnullvm", aarch64_pc_windows_gnullvm),
1630    ("i686-pc-windows-gnullvm", i686_pc_windows_gnullvm),
1631    ("x86_64-pc-windows-gnullvm", x86_64_pc_windows_gnullvm),
1632
1633    ("aarch64-pc-windows-msvc", aarch64_pc_windows_msvc),
1634    ("aarch64-uwp-windows-msvc", aarch64_uwp_windows_msvc),
1635    ("arm64ec-pc-windows-msvc", arm64ec_pc_windows_msvc),
1636    ("x86_64-pc-windows-msvc", x86_64_pc_windows_msvc),
1637    ("x86_64-uwp-windows-msvc", x86_64_uwp_windows_msvc),
1638    ("x86_64-win7-windows-msvc", x86_64_win7_windows_msvc),
1639    ("i686-pc-windows-msvc", i686_pc_windows_msvc),
1640    ("i686-uwp-windows-msvc", i686_uwp_windows_msvc),
1641    ("i686-win7-windows-msvc", i686_win7_windows_msvc),
1642    ("thumbv7a-pc-windows-msvc", thumbv7a_pc_windows_msvc),
1643    ("thumbv7a-uwp-windows-msvc", thumbv7a_uwp_windows_msvc),
1644
1645    ("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
1646    ("wasm32-unknown-unknown", wasm32_unknown_unknown),
1647    ("wasm32v1-none", wasm32v1_none),
1648    ("wasm32-wasip1", wasm32_wasip1),
1649    ("wasm32-wasip2", wasm32_wasip2),
1650    ("wasm32-wasip3", wasm32_wasip3),
1651    ("wasm32-wasip1-threads", wasm32_wasip1_threads),
1652    ("wasm32-wali-linux-musl", wasm32_wali_linux_musl),
1653    ("wasm64-unknown-unknown", wasm64_unknown_unknown),
1654
1655    ("thumbv6m-none-eabi", thumbv6m_none_eabi),
1656    ("thumbv7m-none-eabi", thumbv7m_none_eabi),
1657    ("thumbv7em-none-eabi", thumbv7em_none_eabi),
1658    ("thumbv7em-none-eabihf", thumbv7em_none_eabihf),
1659    ("thumbv8m.base-none-eabi", thumbv8m_base_none_eabi),
1660    ("thumbv8m.main-none-eabi", thumbv8m_main_none_eabi),
1661    ("thumbv8m.main-none-eabihf", thumbv8m_main_none_eabihf),
1662
1663    ("armv7a-none-eabi", armv7a_none_eabi),
1664    ("thumbv7a-none-eabi", thumbv7a_none_eabi),
1665    ("armv7a-none-eabihf", armv7a_none_eabihf),
1666    ("thumbv7a-none-eabihf", thumbv7a_none_eabihf),
1667    ("armv7a-nuttx-eabi", armv7a_nuttx_eabi),
1668    ("armv7a-nuttx-eabihf", armv7a_nuttx_eabihf),
1669    ("armv7a-vex-v5", armv7a_vex_v5),
1670
1671    ("msp430-none-elf", msp430_none_elf),
1672
1673    ("aarch64_be-unknown-hermit", aarch64_be_unknown_hermit),
1674    ("aarch64-unknown-hermit", aarch64_unknown_hermit),
1675    ("riscv64gc-unknown-hermit", riscv64gc_unknown_hermit),
1676    ("x86_64-unknown-hermit", x86_64_unknown_hermit),
1677    ("x86_64-unknown-motor", x86_64_unknown_motor),
1678
1679    ("x86_64-unikraft-linux-musl", x86_64_unikraft_linux_musl),
1680
1681    ("armv7-unknown-trusty", armv7_unknown_trusty),
1682    ("aarch64-unknown-trusty", aarch64_unknown_trusty),
1683    ("x86_64-unknown-trusty", x86_64_unknown_trusty),
1684
1685    ("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
1686    ("riscv32im-risc0-zkvm-elf", riscv32im_risc0_zkvm_elf),
1687    ("riscv32im-unknown-none-elf", riscv32im_unknown_none_elf),
1688    ("riscv32ima-unknown-none-elf", riscv32ima_unknown_none_elf),
1689    ("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
1690    ("riscv32imfc-unknown-none-elf", riscv32imfc_unknown_none_elf),
1691    ("riscv32imc-esp-espidf", riscv32imc_esp_espidf),
1692    ("riscv32imac-esp-espidf", riscv32imac_esp_espidf),
1693    ("riscv32imafc-esp-espidf", riscv32imafc_esp_espidf),
1694
1695    ("riscv32e-unknown-none-elf", riscv32e_unknown_none_elf),
1696    ("riscv32em-unknown-none-elf", riscv32em_unknown_none_elf),
1697    ("riscv32emc-unknown-none-elf", riscv32emc_unknown_none_elf),
1698
1699    ("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
1700    ("riscv32imafc-unknown-none-elf", riscv32imafc_unknown_none_elf),
1701    ("riscv32imac-unknown-xous-elf", riscv32imac_unknown_xous_elf),
1702    ("riscv32gc-unknown-linux-gnu", riscv32gc_unknown_linux_gnu),
1703    ("riscv32gc-unknown-linux-musl", riscv32gc_unknown_linux_musl),
1704    ("riscv64im-unknown-none-elf", riscv64im_unknown_none_elf),
1705    ("riscv64imac-unknown-none-elf", riscv64imac_unknown_none_elf),
1706    ("riscv64gc-unknown-none-elf", riscv64gc_unknown_none_elf),
1707    ("riscv64gc-unknown-linux-gnu", riscv64gc_unknown_linux_gnu),
1708    ("riscv64gc-unknown-linux-musl", riscv64gc_unknown_linux_musl),
1709    ("riscv64a23-unknown-linux-gnu", riscv64a23_unknown_linux_gnu),
1710
1711    ("sparc-unknown-none-elf", sparc_unknown_none_elf),
1712
1713    ("loongarch32-unknown-none", loongarch32_unknown_none),
1714    ("loongarch32-unknown-none-softfloat", loongarch32_unknown_none_softfloat),
1715    ("loongarch64-unknown-none", loongarch64_unknown_none),
1716    ("loongarch64-unknown-none-softfloat", loongarch64_unknown_none_softfloat),
1717
1718    ("aarch64-unknown-none", aarch64_unknown_none),
1719    ("aarch64-unknown-none-softfloat", aarch64_unknown_none_softfloat),
1720    ("aarch64_be-unknown-none-softfloat", aarch64_be_unknown_none_softfloat),
1721    ("aarch64-unknown-nuttx", aarch64_unknown_nuttx),
1722    ("aarch64v8r-unknown-none", aarch64v8r_unknown_none),
1723    ("aarch64v8r-unknown-none-softfloat", aarch64v8r_unknown_none_softfloat),
1724
1725    ("x86_64-fortanix-unknown-sgx", x86_64_fortanix_unknown_sgx),
1726
1727    ("x86_64-unknown-uefi", x86_64_unknown_uefi),
1728    ("i686-unknown-uefi", i686_unknown_uefi),
1729    ("aarch64-unknown-uefi", aarch64_unknown_uefi),
1730
1731    ("nvptx64-nvidia-cuda", nvptx64_nvidia_cuda),
1732
1733    ("amdgcn-amd-amdhsa", amdgcn_amd_amdhsa),
1734
1735    ("xtensa-esp32-none-elf", xtensa_esp32_none_elf),
1736    ("xtensa-esp32-espidf", xtensa_esp32_espidf),
1737    ("xtensa-esp32s2-none-elf", xtensa_esp32s2_none_elf),
1738    ("xtensa-esp32s2-espidf", xtensa_esp32s2_espidf),
1739    ("xtensa-esp32s3-none-elf", xtensa_esp32s3_none_elf),
1740    ("xtensa-esp32s3-espidf", xtensa_esp32s3_espidf),
1741
1742    ("i686-wrs-vxworks", i686_wrs_vxworks),
1743    ("x86_64-wrs-vxworks", x86_64_wrs_vxworks),
1744    ("armv7-wrs-vxworks-eabihf", armv7_wrs_vxworks_eabihf),
1745    ("aarch64-wrs-vxworks", aarch64_wrs_vxworks),
1746    ("powerpc-wrs-vxworks", powerpc_wrs_vxworks),
1747    ("powerpc-wrs-vxworks-spe", powerpc_wrs_vxworks_spe),
1748    ("powerpc64-wrs-vxworks", powerpc64_wrs_vxworks),
1749    ("riscv32-wrs-vxworks", riscv32_wrs_vxworks),
1750    ("riscv64-wrs-vxworks", riscv64_wrs_vxworks),
1751
1752    ("aarch64-kmc-solid_asp3", aarch64_kmc_solid_asp3),
1753    ("armv7a-kmc-solid_asp3-eabi", armv7a_kmc_solid_asp3_eabi),
1754    ("armv7a-kmc-solid_asp3-eabihf", armv7a_kmc_solid_asp3_eabihf),
1755
1756    ("mipsel-sony-psp", mipsel_sony_psp),
1757    ("mipsel-sony-psx", mipsel_sony_psx),
1758    ("mipsel-unknown-none", mipsel_unknown_none),
1759    ("mips-mti-none-elf", mips_mti_none_elf),
1760    ("mipsel-mti-none-elf", mipsel_mti_none_elf),
1761
1762    ("armv4t-none-eabi", armv4t_none_eabi),
1763    ("armv5te-none-eabi", armv5te_none_eabi),
1764    ("armv6-none-eabi", armv6_none_eabi),
1765    ("armv6-none-eabihf", armv6_none_eabihf),
1766    ("thumbv4t-none-eabi", thumbv4t_none_eabi),
1767    ("thumbv5te-none-eabi", thumbv5te_none_eabi),
1768    ("thumbv6-none-eabi", thumbv6_none_eabi),
1769
1770    ("aarch64_be-unknown-linux-gnu", aarch64_be_unknown_linux_gnu),
1771    ("aarch64-unknown-linux-gnu_ilp32", aarch64_unknown_linux_gnu_ilp32),
1772    ("aarch64_be-unknown-linux-gnu_ilp32", aarch64_be_unknown_linux_gnu_ilp32),
1773
1774    ("bpfeb-unknown-none", bpfeb_unknown_none),
1775    ("bpfel-unknown-none", bpfel_unknown_none),
1776
1777    ("armv6k-nintendo-3ds", armv6k_nintendo_3ds),
1778
1779    ("aarch64-nintendo-switch-freestanding", aarch64_nintendo_switch_freestanding),
1780
1781    ("armv7-sony-vita-newlibeabihf", armv7_sony_vita_newlibeabihf),
1782
1783    ("armv7-unknown-linux-uclibceabi", armv7_unknown_linux_uclibceabi),
1784    ("armv7-unknown-linux-uclibceabihf", armv7_unknown_linux_uclibceabihf),
1785
1786    ("x86_64-unknown-none", x86_64_unknown_none),
1787
1788    ("aarch64-unknown-teeos", aarch64_unknown_teeos),
1789
1790    ("mips64-openwrt-linux-musl", mips64_openwrt_linux_musl),
1791
1792    ("aarch64-unknown-nto-qnx700", aarch64_unknown_nto_qnx700),
1793    ("aarch64-unknown-nto-qnx710", aarch64_unknown_nto_qnx710),
1794    ("aarch64-unknown-nto-qnx710_iosock", aarch64_unknown_nto_qnx710_iosock),
1795    ("aarch64-unknown-qnx", aarch64_unknown_qnx),
1796    ("x86_64-pc-nto-qnx710", x86_64_pc_nto_qnx710),
1797    ("x86_64-pc-nto-qnx710_iosock", x86_64_pc_nto_qnx710_iosock),
1798    ("x86_64-pc-qnx", x86_64_pc_qnx),
1799    ("i686-pc-nto-qnx700", i686_pc_nto_qnx700),
1800
1801    ("aarch64-unknown-linux-ohos", aarch64_unknown_linux_ohos),
1802    ("armv7-unknown-linux-ohos", armv7_unknown_linux_ohos),
1803    ("loongarch64-unknown-linux-ohos", loongarch64_unknown_linux_ohos),
1804    ("x86_64-unknown-linux-ohos", x86_64_unknown_linux_ohos),
1805
1806    ("x86_64-unknown-linux-none", x86_64_unknown_linux_none),
1807
1808    ("thumbv6m-nuttx-eabi", thumbv6m_nuttx_eabi),
1809    ("thumbv7a-nuttx-eabi", thumbv7a_nuttx_eabi),
1810    ("thumbv7a-nuttx-eabihf", thumbv7a_nuttx_eabihf),
1811    ("thumbv7m-nuttx-eabi", thumbv7m_nuttx_eabi),
1812    ("thumbv7em-nuttx-eabi", thumbv7em_nuttx_eabi),
1813    ("thumbv7em-nuttx-eabihf", thumbv7em_nuttx_eabihf),
1814    ("thumbv8m.base-nuttx-eabi", thumbv8m_base_nuttx_eabi),
1815    ("thumbv8m.main-nuttx-eabi", thumbv8m_main_nuttx_eabi),
1816    ("thumbv8m.main-nuttx-eabihf", thumbv8m_main_nuttx_eabihf),
1817    ("riscv32imc-unknown-nuttx-elf", riscv32imc_unknown_nuttx_elf),
1818    ("riscv32imac-unknown-nuttx-elf", riscv32imac_unknown_nuttx_elf),
1819    ("riscv32imafc-unknown-nuttx-elf", riscv32imafc_unknown_nuttx_elf),
1820    ("riscv64imac-unknown-nuttx-elf", riscv64imac_unknown_nuttx_elf),
1821    ("riscv64gc-unknown-nuttx-elf", riscv64gc_unknown_nuttx_elf),
1822    ("x86_64-lynx-lynxos178", x86_64_lynx_lynxos178),
1823
1824    ("x86_64-pc-cygwin", x86_64_pc_cygwin),
1825
1826    ("x86_64-unknown-linux-gnuasan", x86_64_unknown_linux_gnuasan),
1827    ("x86_64-unknown-linux-gnumsan", x86_64_unknown_linux_gnumsan),
1828    ("x86_64-unknown-linux-gnutsan", x86_64_unknown_linux_gnutsan),
1829
1830    ("aarch64-oe-linux-gnu", aarch64_oe_linux_gnu),
1831    ("armv7-oe-linux-gnueabihf", armv7_oe_linux_gnueabihf),
1832    ("i686-oe-linux-gnu", i686_oe_linux_gnu),
1833    ("riscv64-oe-linux-gnu", riscv64_oe_linux_gnu),
1834    ("x86_64-oe-linux-gnu", x86_64_oe_linux_gnu),
1835}
1836
1837/// Cow-Vec-Str: Cow<'static, [Cow<'static, str>]>
1838macro_rules! cvs {
1839    () => {
1840        ::std::borrow::Cow::Borrowed(&[])
1841    };
1842    ($($x:expr),+ $(,)?) => {
1843        ::std::borrow::Cow::Borrowed(&[
1844            $(
1845                ::std::borrow::Cow::Borrowed($x),
1846            )*
1847        ])
1848    };
1849}
1850
1851pub(crate) use cvs;
1852
1853/// Warnings encountered when parsing the target `json`.
1854///
1855/// Includes fields that weren't recognized and fields that don't have the expected type.
1856#[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)]
1857pub struct TargetWarnings {
1858    unused_fields: Vec<String>,
1859}
1860
1861impl TargetWarnings {
1862    pub fn empty() -> Self {
1863        Self { unused_fields: Vec::new() }
1864    }
1865
1866    pub fn warning_messages(&self) -> Vec<String> {
1867        let mut warnings = ::alloc::vec::Vec::new()vec![];
1868        if !self.unused_fields.is_empty() {
1869            warnings.push(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target json file contains unused fields: {0}",
                self.unused_fields.join(", ")))
    })format!(
1870                "target json file contains unused fields: {}",
1871                self.unused_fields.join(", ")
1872            ));
1873        }
1874        warnings
1875    }
1876}
1877
1878/// For the [`Target::check_consistency`] function, determines whether the given target is a builtin or a JSON
1879/// target.
1880#[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)]
1881enum TargetKind {
1882    Json,
1883    Builtin,
1884}
1885
1886pub 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! {
1887    pub enum Arch {
1888        AArch64 = "aarch64",
1889        AmdGpu = "amdgpu",
1890        Arm = "arm",
1891        Arm64EC = "arm64ec",
1892        Avr = "avr",
1893        Bpf = "bpf",
1894        CSky = "csky",
1895        Hexagon = "hexagon",
1896        LoongArch32 = "loongarch32",
1897        LoongArch64 = "loongarch64",
1898        M68k = "m68k",
1899        Mips = "mips",
1900        Mips32r6 = "mips32r6",
1901        Mips64 = "mips64",
1902        Mips64r6 = "mips64r6",
1903        Msp430 = "msp430",
1904        Nvptx64 = "nvptx64",
1905        PowerPC = "powerpc",
1906        PowerPC64 = "powerpc64",
1907        RiscV32 = "riscv32",
1908        RiscV64 = "riscv64",
1909        S390x = "s390x",
1910        Sparc = "sparc",
1911        Sparc64 = "sparc64",
1912        SpirV = "spirv",
1913        Wasm32 = "wasm32",
1914        Wasm64 = "wasm64",
1915        X86 = "x86",
1916        X86_64 = "x86_64",
1917        Xtensa = "xtensa",
1918    }
1919    other_variant = Other;
1920}
1921
1922impl Arch {
1923    pub fn desc_symbol(&self) -> Symbol {
1924        match self {
1925            Self::AArch64 => sym::aarch64,
1926            Self::AmdGpu => sym::amdgpu,
1927            Self::Arm => sym::arm,
1928            Self::Arm64EC => sym::arm64ec,
1929            Self::Avr => sym::avr,
1930            Self::Bpf => sym::bpf,
1931            Self::CSky => sym::csky,
1932            Self::Hexagon => sym::hexagon,
1933            Self::LoongArch32 => sym::loongarch32,
1934            Self::LoongArch64 => sym::loongarch64,
1935            Self::M68k => sym::m68k,
1936            Self::Mips => sym::mips,
1937            Self::Mips32r6 => sym::mips32r6,
1938            Self::Mips64 => sym::mips64,
1939            Self::Mips64r6 => sym::mips64r6,
1940            Self::Msp430 => sym::msp430,
1941            Self::Nvptx64 => sym::nvptx64,
1942            Self::PowerPC => sym::powerpc,
1943            Self::PowerPC64 => sym::powerpc64,
1944            Self::RiscV32 => sym::riscv32,
1945            Self::RiscV64 => sym::riscv64,
1946            Self::S390x => sym::s390x,
1947            Self::Sparc => sym::sparc,
1948            Self::Sparc64 => sym::sparc64,
1949            Self::SpirV => sym::spirv,
1950            Self::Wasm32 => sym::wasm32,
1951            Self::Wasm64 => sym::wasm64,
1952            Self::X86 => sym::x86,
1953            Self::X86_64 => sym::x86_64,
1954            Self::Xtensa => sym::xtensa,
1955            Self::Other(name) => rustc_span::Symbol::intern(name),
1956        }
1957    }
1958
1959    /// Whether `#[rustc_scalable_vector]` is supported for a target architecture
1960    pub fn supports_scalable_vectors(&self) -> bool {
1961        use Arch::*;
1962
1963        match self {
1964            AArch64 | RiscV32 | RiscV64 => true,
1965            AmdGpu | Arm | Arm64EC | Avr | Bpf | CSky | Hexagon | LoongArch32 | LoongArch64
1966            | M68k | Mips | Mips32r6 | Mips64 | Mips64r6 | Msp430 | Nvptx64 | PowerPC
1967            | PowerPC64 | S390x | Sparc | Sparc64 | SpirV | Wasm32 | Wasm64 | X86 | X86_64
1968            | Xtensa | Other(_) => false,
1969        }
1970    }
1971}
1972
1973pub 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! {
1974    pub enum Os {
1975        Aix = "aix",
1976        AmdHsa = "amdhsa",
1977        Android = "android",
1978        Cuda = "cuda",
1979        Cygwin = "cygwin",
1980        Dragonfly = "dragonfly",
1981        Emscripten = "emscripten",
1982        EspIdf = "espidf",
1983        FreeBsd = "freebsd",
1984        Fuchsia = "fuchsia",
1985        Haiku = "haiku",
1986        HelenOs = "helenos",
1987        Hermit = "hermit",
1988        Horizon = "horizon",
1989        Hurd = "hurd",
1990        Illumos = "illumos",
1991        IOs = "ios",
1992        L4Re = "l4re",
1993        Linux = "linux",
1994        LynxOs178 = "lynxos178",
1995        MacOs = "macos",
1996        Managarm = "managarm",
1997        Motor = "motor",
1998        NetBsd = "netbsd",
1999        None = "none",
2000        Nto = "nto",
2001        NuttX = "nuttx",
2002        OpenBsd = "openbsd",
2003        Psp = "psp",
2004        Psx = "psx",
2005        Qnx = "qnx",
2006        Qurt = "qurt",
2007        Redox = "redox",
2008        Rtems = "rtems",
2009        Solaris = "solaris",
2010        SolidAsp3 = "solid_asp3",
2011        TeeOs = "teeos",
2012        Trusty = "trusty",
2013        TvOs = "tvos",
2014        Uefi = "uefi",
2015        VexOs = "vexos",
2016        VisionOs = "visionos",
2017        Vita = "vita",
2018        VxWorks = "vxworks",
2019        Wasi = "wasi",
2020        WatchOs = "watchos",
2021        Windows = "windows",
2022        Xous = "xous",
2023        Zkvm = "zkvm",
2024        Unknown = "unknown",
2025    }
2026    other_variant = Other;
2027}
2028
2029impl Os {
2030    pub fn desc_symbol(&self) -> Symbol {
2031        Symbol::intern(self.desc())
2032    }
2033}
2034
2035pub 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! {
2036    pub enum Env {
2037        Gnu = "gnu",
2038        MacAbi = "macabi",
2039        Mlibc = "mlibc",
2040        Msvc = "msvc",
2041        Musl = "musl",
2042        Newlib = "newlib",
2043        Nto70 = "nto70",
2044        Nto71 = "nto71",
2045        Nto71IoSock = "nto71_iosock",
2046        Ohos = "ohos",
2047        Relibc = "relibc",
2048        Sgx = "sgx",
2049        Sim = "sim",
2050        P1 = "p1",
2051        P2 = "p2",
2052        P3 = "p3",
2053        Uclibc = "uclibc",
2054        V5 = "v5",
2055        Unspecified = "",
2056    }
2057    other_variant = Other;
2058}
2059
2060impl Env {
2061    pub fn desc_symbol(&self) -> Symbol {
2062        Symbol::intern(self.desc())
2063    }
2064}
2065
2066#[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! {
2067    /// An enum representing possible values for `cfg(target_abi)`.
2068    /// This field is not forwarded to LLVM so it does not by itself affect codegen.
2069    /// See the `cfg_abi` field of [`TargetOptions`] for more details.
2070    pub enum CfgAbi {
2071        Abi64 = "abi64",
2072        AbiV2 = "abiv2",
2073        AbiV2Hf = "abiv2hf",
2074        Eabi = "eabi",
2075        EabiHf = "eabihf",
2076        ElfV1 = "elfv1",
2077        ElfV2 = "elfv2",
2078        Fortanix = "fortanix",
2079        Ilp32 = "ilp32",
2080        Ilp32e = "ilp32e",
2081        Llvm = "llvm",
2082        MacAbi = "macabi",
2083        Pauthtest = "pauthtest",
2084        Sim = "sim",
2085        SoftFloat = "softfloat",
2086        Spe = "spe",
2087        Uwp = "uwp",
2088        VecDefault = "vec-default",
2089        VecExtAbi = "vec-extabi",
2090        X32 = "x32",
2091        Unspecified = "",
2092    }
2093    other_variant = Other;
2094}
2095
2096impl CfgAbi {
2097    pub fn desc_symbol(&self) -> Symbol {
2098        Symbol::intern(self.desc())
2099    }
2100}
2101
2102#[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! {
2103    /// An enum representing possible values for the `llvm_abiname` field of [`TargetOptions`].
2104    /// This field is used by LLVM on some targets to control which ABI to use.
2105    pub enum LlvmAbi {
2106        // RISC-V and LoongArch
2107        Ilp32 = "ilp32",
2108        Ilp32f = "ilp32f",
2109        Ilp32d = "ilp32d",
2110        Ilp32e = "ilp32e",
2111        Ilp32s = "ilp32s",
2112        Lp64 = "lp64",
2113        Lp64f = "lp64f",
2114        Lp64d = "lp64d",
2115        Lp64e = "lp64e",
2116        Lp64s = "lp64s",
2117        // MIPS
2118        O32 = "o32",
2119        N32 = "n32",
2120        N64 = "n64",
2121        // PowerPC
2122        ElfV1 = "elfv1",
2123        ElfV2 = "elfv2",
2124        // Pointer authentication: Pauthtest
2125        Pauthtest = "pauthtest",
2126
2127        Unspecified = "",
2128    }
2129    other_variant = Other;
2130}
2131
2132/// Everything `rustc` knows about how to compile for a specific target.
2133///
2134/// Every field here must be specified, and has no default value.
2135#[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)]
2136pub struct Target {
2137    /// Unversioned target tuple to pass to LLVM.
2138    ///
2139    /// Target tuples can optionally contain an OS version (notably Apple targets), which rustc
2140    /// cannot know without querying the environment.
2141    ///
2142    /// Use `rustc_codegen_ssa::back::versioned_llvm_target` if you need the full LLVM target.
2143    pub llvm_target: StaticCow<str>,
2144    /// Metadata about a target, for example the description or tier.
2145    /// Used for generating target documentation.
2146    pub metadata: TargetMetadata,
2147    /// Number of bits in a pointer. Influences the `target_pointer_width` `cfg` variable.
2148    pub pointer_width: u16,
2149    /// Architecture to use for ABI considerations. Valid options include: "x86",
2150    /// "x86_64", "arm", "aarch64", "mips", "powerpc", "powerpc64", and others.
2151    pub arch: Arch,
2152    /// [Data layout](https://llvm.org/docs/LangRef.html#data-layout) to pass to LLVM.
2153    pub data_layout: StaticCow<str>,
2154    /// Optional settings with defaults.
2155    pub options: TargetOptions,
2156}
2157
2158/// Metadata about a target like the description or tier.
2159/// Part of #120745.
2160/// All fields are optional for now, but intended to be required in the future.
2161#[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)]
2162pub struct TargetMetadata {
2163    /// A short description of the target including platform requirements,
2164    /// for example "64-bit Linux (kernel 3.2+, glibc 2.17+)".
2165    pub description: Option<StaticCow<str>>,
2166    /// The tier of the target. 1, 2 or 3.
2167    pub tier: Option<u64>,
2168    /// Whether the Rust project ships host tools for a target.
2169    pub host_tools: Option<bool>,
2170    /// Whether a target has the `std` library. This is usually true for targets running
2171    /// on an operating system.
2172    pub std: Option<bool>,
2173}
2174
2175impl Target {
2176    pub fn parse_data_layout(&self) -> Result<TargetDataLayout, TargetDataLayoutError<'_>> {
2177        let mut dl = TargetDataLayout::parse_from_llvm_datalayout_string(
2178            &self.data_layout,
2179            self.options.default_address_space,
2180        )?;
2181
2182        // Perform consistency checks against the Target information.
2183        if dl.endian != self.endian {
2184            return Err(TargetDataLayoutError::InconsistentTargetArchitecture {
2185                dl: dl.endian.as_str(),
2186                target: self.endian.as_str(),
2187            });
2188        }
2189
2190        let target_pointer_width: u64 = self.pointer_width.into();
2191        let dl_pointer_size: u64 = dl.pointer_size().bits();
2192        if dl_pointer_size != target_pointer_width {
2193            return Err(TargetDataLayoutError::InconsistentTargetPointerWidth {
2194                pointer_size: dl_pointer_size,
2195                target: self.pointer_width,
2196            });
2197        }
2198
2199        dl.c_enum_min_size = Integer::from_size(Size::from_bits(
2200            self.c_enum_min_bits.unwrap_or(self.c_int_width as _),
2201        ))
2202        .map_err(|err| TargetDataLayoutError::InvalidBitsSize { err })?;
2203
2204        Ok(dl)
2205    }
2206
2207    pub fn supports_c_variadic_definitions(&self) -> CVariadicStatus {
2208        use Arch::*;
2209
2210        match self.arch {
2211            // These targets just inherently do not support c-variadic definitions.
2212            Bpf | SpirV => CVariadicStatus::NotSupported,
2213
2214            // The c-variadic ABI for this target may change in the future, per this comment in
2215            // clang:
2216            //
2217            // > To be compatible with GCC's behaviors, we force arguments with
2218            // > 2×XLEN-bit alignment and size at most 2×XLEN bits like `long long`,
2219            // > `unsigned long long` and `double` to have 4-byte alignment. This
2220            // > behavior may be changed when RV32E/ILP32E is ratified.
2221            RiscV32 if self.llvm_abiname == LlvmAbi::Ilp32e => {
2222                CVariadicStatus::Unstable { feature: sym::c_variadic_experimental_arch }
2223            }
2224
2225            // We don't know how c-variadics work for this target. Using the default LLVM
2226            // fallback implementation probably works, but we can't guarantee it.
2227            Other(_) => CVariadicStatus::Unstable { feature: sym::c_variadic_experimental_arch },
2228
2229            // These targets require more testing before we commit to c-variadic definitions
2230            // being stable.
2231            //
2232            // To stabilize c-variadic functions for one of these targets, the following
2233            // requirements must be met:
2234            //
2235            // - Check that `core::ffi::VaArgSafe` is (un)implemented for all the correct types.
2236            // - Add an assembly test to `tests/assembly-llvm/c-variadic` that tests the assembly
2237            // for all implementers of `VaArgSafe`. The generated assembly should either match
2238            // `clang`, or we should understand and document why it deviates.
2239            // - Ensure that `va_arg` is implemented in rustc. For stable targets we don't rely on
2240            // the LLVM implementation, it has historically caused miscompilations.
2241            // - Ensure that LLVM's `va_end` for this target is a NOP.
2242            // - Ensure that LLVM's `va_copy` for this target is equivalent to `memcpy`.
2243            // - The `tests/ui/c-variadic/roundtrip.rs` test must pass for the target. It may
2244            // need slight modifications for embedded targets, that's fine.
2245            // - Check that calling c-variadic functions defined in Rust can be called from C.
2246            // For most targets `tests/run-make/c-link-to-rust-va-list-fn` can be used here.
2247            // For no_std targets a manual setup may be needed.
2248            Sparc | Avr | M68k | Msp430 => {
2249                CVariadicStatus::Unstable { feature: sym::c_variadic_experimental_arch }
2250            }
2251
2252            AArch64 | AmdGpu | Arm | Arm64EC | CSky | Hexagon | LoongArch32 | LoongArch64
2253            | Mips | Mips32r6 | Mips64 | Mips64r6 | Nvptx64 | PowerPC | PowerPC64 | RiscV32
2254            | RiscV64 | S390x | Sparc64 | Wasm32 | Wasm64 | X86 | X86_64 | Xtensa => {
2255                CVariadicStatus::Stable
2256            }
2257        }
2258    }
2259
2260    /// Is this target single-threaded?
2261    ///
2262    /// This affects both optimizations (e.g., atomics can be lowered to regular operations) and
2263    /// is also exposed as cfg(target_has_threads).
2264    pub fn singlethread(&self, target_features: &FxIndexSet<Symbol>) -> bool {
2265        // On the wasm target once the `atomics` feature is enabled that means that
2266        // we're no longer single-threaded, or otherwise we don't want LLVM to
2267        // lower atomic operations to single-threaded operations.
2268        //
2269        // FIXME: This (probably?) implies that atomics should be a target modifier, at which point
2270        // it probably makes sense to be a separate target to ship precompiled artifacts for it?
2271        //
2272        // cc #77839 (tracking issue for wasm atomics)
2273        if self.singlethread && self.is_like_wasm && target_features.contains(&sym::atomics) {
2274            return false;
2275        }
2276
2277        self.singlethread
2278    }
2279}
2280
2281pub trait HasTargetSpec {
2282    fn target_spec(&self) -> &Target;
2283}
2284
2285impl HasTargetSpec for Target {
2286    #[inline]
2287    fn target_spec(&self) -> &Target {
2288        self
2289    }
2290}
2291
2292/// x86 (32-bit) abi options.
2293#[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)]
2294pub struct X86Abi {
2295    /// On x86-32 targets, the regparm N causes the compiler to pass arguments
2296    /// in registers EAX, EDX, and ECX instead of on the stack.
2297    pub regparm: Option<u32>,
2298    /// Override the default ABI to return small structs in registers
2299    pub reg_struct_return: bool,
2300}
2301
2302pub trait HasX86AbiOpt {
2303    fn x86_abi_opt(&self) -> X86Abi;
2304}
2305
2306type StaticCow<T> = Cow<'static, T>;
2307
2308/// Optional aspects of a target specification.
2309///
2310/// This has an implementation of `Default`, see each field for what the default is. In general,
2311/// these try to take "minimal defaults" that don't assume anything about the runtime they run in.
2312///
2313/// `TargetOptions` as a separate structure is mostly an implementation detail of `Target`
2314/// construction, all its fields logically belong to `Target` and available from `Target`
2315/// through `Deref` impls.
2316#[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.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),
            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",
                        "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.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)]
2317#[rustc_lint_opt_ty]
2318pub struct TargetOptions {
2319    /// Used as the `target_endian` `cfg` variable. Defaults to little endian.
2320    pub endian: Endian,
2321    /// Width of c_int type. Defaults to "32".
2322    pub c_int_width: u16,
2323    /// OS name to use for conditional compilation (`target_os`). Defaults to [`Os::None`].
2324    /// [`Os::None`] implies a bare metal target without `std` library.
2325    /// A couple of targets having `std` also use [`Os::Unknown`] as their `os` value,
2326    /// but they are exceptions.
2327    pub os: Os,
2328    /// Environment name to use for conditional compilation (`target_env`). Defaults to [`Env::Unspecified`].
2329    pub env: Env,
2330    /// ABI name to distinguish multiple ABIs on the same OS and architecture. For instance,
2331    /// `"eabi"` or `"eabihf"`. Defaults to [`CfgAbi::Unspecified`].
2332    /// The only purpose of this field is to control `cfg(target_abi)`. This does not control the
2333    /// calling convention used by this target! The actual calling convention is controlled by
2334    /// `llvm_abiname`, `llvm_floatabi`, and `rustc_abi`.
2335    ///
2336    /// In a target spec, this field generally *informs* the user about what the ABI is, but you
2337    /// have to also set up other parts of the target spec to ensure that this information is
2338    /// correct. In the rest of the compiler, do not check this field if what you actually need to
2339    /// know about is the calling convention. Most targets have an open-ended set of values for this
2340    /// field.
2341    pub cfg_abi: CfgAbi,
2342    /// Vendor name to use for conditional compilation (`target_vendor`). Defaults to "unknown".
2343    #[rustc_lint_opt_deny_field_access(
2344        "use `Target::is_like_*` instead of this field; see https://github.com/rust-lang/rust/issues/100343 for rationale"
2345    )]
2346    vendor: StaticCow<str>,
2347
2348    /// Linker to invoke
2349    pub linker: Option<StaticCow<str>>,
2350    /// Default linker flavor used if `-C linker-flavor` or `-C linker` are not passed
2351    /// on the command line. Defaults to `LinkerFlavor::Gnu(Cc::Yes, Lld::No)`.
2352    pub linker_flavor: LinkerFlavor,
2353    linker_flavor_json: LinkerFlavorCli,
2354    lld_flavor_json: LldFlavor,
2355    linker_is_gnu_json: bool,
2356
2357    /// Objects to link before and after all other object code.
2358    pub pre_link_objects: CrtObjects,
2359    pub post_link_objects: CrtObjects,
2360    /// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
2361    pub pre_link_objects_self_contained: CrtObjects,
2362    pub post_link_objects_self_contained: CrtObjects,
2363    /// Behavior for the self-contained linking mode: inferred for some targets, or explicitly
2364    /// enabled (in bulk, or with individual components).
2365    pub link_self_contained: LinkSelfContainedDefault,
2366
2367    /// Linker arguments that are passed *before* any user-defined libraries.
2368    pub pre_link_args: LinkArgs,
2369    pre_link_args_json: LinkArgsCli,
2370    /// Linker arguments that are unconditionally passed after any
2371    /// user-defined but before post-link objects. Standard platform
2372    /// libraries that should be always be linked to, usually go here.
2373    pub late_link_args: LinkArgs,
2374    late_link_args_json: LinkArgsCli,
2375    /// Linker arguments used in addition to `late_link_args` if at least one
2376    /// Rust dependency is dynamically linked.
2377    pub late_link_args_dynamic: LinkArgs,
2378    late_link_args_dynamic_json: LinkArgsCli,
2379    /// Linker arguments used in addition to `late_link_args` if all Rust
2380    /// dependencies are statically linked.
2381    pub late_link_args_static: LinkArgs,
2382    late_link_args_static_json: LinkArgsCli,
2383    /// Linker arguments that are unconditionally passed *after* any
2384    /// user-defined libraries.
2385    pub post_link_args: LinkArgs,
2386    post_link_args_json: LinkArgsCli,
2387
2388    /// Optional link script applied to `dylib` and `executable` crate types.
2389    /// This is a string containing the script, not a path. Can only be applied
2390    /// to linkers where linker flavor matches `LinkerFlavor::Gnu(..)`.
2391    pub link_script: Option<StaticCow<str>>,
2392    /// Environment variables to be set for the linker invocation.
2393    pub link_env: StaticCow<[(StaticCow<str>, StaticCow<str>)]>,
2394    /// Environment variables to be removed for the linker invocation.
2395    pub link_env_remove: StaticCow<[StaticCow<str>]>,
2396
2397    /// Extra arguments to pass to the external assembler (when used)
2398    pub asm_args: StaticCow<[StaticCow<str>]>,
2399
2400    /// Default CPU to pass to LLVM. Corresponds to `llc -mcpu=$cpu`. Defaults
2401    /// to "generic".
2402    pub cpu: StaticCow<str>,
2403    /// Whether a cpu needs to be explicitly set.
2404    /// Set to true if there is no default cpu. Defaults to false.
2405    pub need_explicit_cpu: bool,
2406    /// A list of CPUs that are provided by LLVM but are considered unsupported by Rust.
2407    /// These CPUs are omitted from `--print target-cpus` output and will cause an error
2408    /// if used with `-Ctarget-cpu`.
2409    pub unsupported_cpus: StaticCow<[StaticCow<str>]>,
2410    /// Default (Rust) target features to enable for this target. These features
2411    /// overwrite `-Ctarget-cpu` but can be overwritten with `-Ctarget-features`.
2412    /// Corresponds to `llc -mattr=$llvm_features` where `$llvm_features` is the
2413    /// result of mapping the Rust features in this field to LLVM features.
2414    ///
2415    /// Generally it is a bad idea to use negative target features because they often interact very
2416    /// poorly with how `-Ctarget-cpu` works. Instead, try to use a lower "base CPU" and enable the
2417    /// features you want to use.
2418    pub features: StaticCow<str>,
2419    /// Direct or use GOT indirect to reference external data symbols
2420    pub direct_access_external_data: Option<bool>,
2421    /// Whether dynamic linking is available on this target. Defaults to false.
2422    pub dynamic_linking: bool,
2423    /// Whether dynamic linking can export TLS globals. Defaults to true.
2424    pub dll_tls_export: bool,
2425    /// If dynamic linking is available, whether only cdylibs are supported.
2426    pub only_cdylib: bool,
2427    /// Whether executables are available on this target. Defaults to true.
2428    pub executables: bool,
2429    /// Relocation model to use in object file. Corresponds to `llc
2430    /// -relocation-model=$relocation_model`. Defaults to `Pic`.
2431    pub relocation_model: RelocModel,
2432    /// Code model to use. Corresponds to `llc -code-model=$code_model`.
2433    /// Defaults to `None` which means "inherited from the base LLVM target".
2434    pub code_model: Option<CodeModel>,
2435    /// TLS model to use. Options are "global-dynamic" (default), "local-dynamic", "initial-exec"
2436    /// and "local-exec". This is similar to the -ftls-model option in GCC/Clang.
2437    pub tls_model: TlsModel,
2438    /// Do not emit code that uses the "red zone", if the ABI has one. Defaults to false.
2439    pub disable_redzone: bool,
2440    /// Frame pointer mode for this target. Defaults to `MayOmit`.
2441    pub frame_pointer: FramePointer,
2442    /// Emit each function in its own section. Defaults to true.
2443    pub function_sections: bool,
2444    /// String to prepend to the name of every dynamic library. Defaults to "lib".
2445    pub dll_prefix: StaticCow<str>,
2446    /// String to append to the name of every dynamic library. Defaults to ".so".
2447    pub dll_suffix: StaticCow<str>,
2448    /// String to append to the name of every executable.
2449    pub exe_suffix: StaticCow<str>,
2450    /// String to prepend to the name of every static library. Defaults to "lib".
2451    pub staticlib_prefix: StaticCow<str>,
2452    /// String to append to the name of every static library. Defaults to ".a".
2453    pub staticlib_suffix: StaticCow<str>,
2454    /// Values of the `target_family` cfg set for this target.
2455    ///
2456    /// Common options are: "unix", "windows". Defaults to no families.
2457    ///
2458    /// See <https://doc.rust-lang.org/reference/conditional-compilation.html#target_family>.
2459    pub families: StaticCow<[StaticCow<str>]>,
2460    /// Whether the target toolchain's ABI supports returning small structs as an integer.
2461    pub abi_return_struct_as_int: bool,
2462    /// Whether the target toolchain is like AIX's. Linker options on AIX are special and it uses
2463    /// XCOFF as binary format. Defaults to false.
2464    pub is_like_aix: bool,
2465    /// Whether the target toolchain is like macOS's. Only useful for compiling against iOS/macOS,
2466    /// in particular running dsymutil and some other stuff like `-dead_strip`. Defaults to false.
2467    /// Also indicates whether to use Apple-specific ABI changes, such as extending function
2468    /// parameters to 32-bits.
2469    pub is_like_darwin: bool,
2470    /// Whether the target is a GPU (e.g. NVIDIA, AMD, Intel).
2471    pub is_like_gpu: bool,
2472    /// Whether the target toolchain is like Solaris's.
2473    /// Only useful for compiling against Illumos/Solaris,
2474    /// as they have a different set of linker flags. Defaults to false.
2475    pub is_like_solaris: bool,
2476    /// Whether the target is like Windows.
2477    /// This is a combination of several more specific properties represented as a single flag:
2478    ///   - The target uses a Windows ABI,
2479    ///   - uses PE/COFF as a format for object code,
2480    ///   - uses Windows-style dllexport/dllimport for shared libraries,
2481    ///   - uses import libraries and .def files for symbol exports,
2482    ///   - executables support setting a subsystem.
2483    pub is_like_windows: bool,
2484    /// Whether the target is like MSVC.
2485    /// This is a combination of several more specific properties represented as a single flag:
2486    ///   - The target has all the properties from `is_like_windows`
2487    ///     (for in-tree targets "is_like_msvc ⇒ is_like_windows" is ensured by a unit test),
2488    ///   - has some MSVC-specific Windows ABI properties,
2489    ///   - uses a link.exe-like linker,
2490    ///   - uses CodeView/PDB for debuginfo and natvis for its visualization,
2491    ///   - uses SEH-based unwinding,
2492    ///   - supports control flow guard mechanism.
2493    pub is_like_msvc: bool,
2494    /// Whether a target toolchain is like WASM.
2495    pub is_like_wasm: bool,
2496    /// Whether a target toolchain is like Android, implying a Linux kernel and a Bionic libc
2497    pub is_like_android: bool,
2498    /// Whether a target toolchain is like VEXos, the operating system used by the VEX Robotics V5 Brain.
2499    pub is_like_vexos: bool,
2500    /// Target's binary file format. Defaults to BinaryFormat::Elf
2501    pub binary_format: BinaryFormat,
2502    /// Default supported version of DWARF on this platform.
2503    /// Useful because some platforms (osx, bsd) only want up to DWARF2.
2504    pub default_dwarf_version: u32,
2505    /// Whether the linker support rpaths or not. Defaults to false.
2506    pub has_rpath: bool,
2507    /// Whether to disable linking to the default libraries, typically corresponds
2508    /// to `-nodefaultlibs`. Defaults to true.
2509    pub no_default_libraries: bool,
2510    /// Dynamically linked executables can be compiled as position independent
2511    /// if the default relocation model of position independent code is not
2512    /// changed. This is a requirement to take advantage of ASLR, as otherwise
2513    /// the functions in the executable are not randomized and can be used
2514    /// during an exploit of a vulnerability in any code.
2515    pub position_independent_executables: bool,
2516    /// Executables that are both statically linked and position-independent are supported.
2517    pub static_position_independent_executables: bool,
2518    /// Determines if the target always requires using the PLT for indirect
2519    /// library calls or not. This controls the default value of the `-Z plt` flag.
2520    pub plt_by_default: bool,
2521    /// Either partial, full, or off. Full RELRO makes the dynamic linker
2522    /// resolve all symbols at startup and marks the GOT read-only before
2523    /// starting the program, preventing overwriting the GOT.
2524    pub relro_level: RelroLevel,
2525    /// Format that archives should be emitted in. This affects whether we use
2526    /// LLVM to assemble an archive or fall back to the system linker, and
2527    /// currently only "gnu" is used to fall into LLVM. Unknown strings cause
2528    /// the system linker to be used.
2529    pub archive_format: StaticCow<str>,
2530    /// Is asm!() allowed? Defaults to true.
2531    pub allow_asm: bool,
2532    /// Static initializers must be acyclic.
2533    /// Defaults to false
2534    pub static_initializer_must_be_acyclic: bool,
2535    /// Whether the runtime startup code requires the `main` function be passed
2536    /// `argc` and `argv` values.
2537    pub main_needs_argc_argv: bool,
2538
2539    /// Flag indicating whether #[thread_local] is available for this target.
2540    pub has_thread_local: bool,
2541    /// This is mainly for easy compatibility with emscripten.
2542    /// If we give emcc .o files that are actually .bc files it
2543    /// will 'just work'.
2544    pub obj_is_bitcode: bool,
2545
2546    /// Don't use this field; instead use the `.min_atomic_width()` method.
2547    pub min_atomic_width: Option<u64>,
2548
2549    /// Don't use this field; instead use the `.max_atomic_width()` method.
2550    pub max_atomic_width: Option<u64>,
2551
2552    /// Whether the target supports atomic CAS operations natively
2553    pub atomic_cas: bool,
2554
2555    /// Panic strategy: "unwind" or "abort"
2556    pub panic_strategy: PanicStrategy,
2557
2558    /// Whether or not linking dylibs to a static CRT is allowed.
2559    pub crt_static_allows_dylibs: bool,
2560    /// Whether or not the CRT is statically linked by default.
2561    pub crt_static_default: bool,
2562    /// Whether or not crt-static is respected by the compiler (or is a no-op).
2563    pub crt_static_respected: bool,
2564
2565    /// The implementation of stack probes to use.
2566    pub stack_probes: StackProbeType,
2567
2568    /// The minimum alignment for global symbols.
2569    pub min_global_align: Option<Align>,
2570
2571    /// Default number of codegen units to use in debug mode
2572    pub default_codegen_units: Option<u64>,
2573
2574    /// Default codegen backend used for this target. Defaults to `None`.
2575    ///
2576    /// If `None`, then `CFG_DEFAULT_CODEGEN_BACKEND` environmental variable captured when
2577    /// compiling `rustc` will be used instead (or llvm if it is not set).
2578    ///
2579    /// N.B. when *using* the compiler, backend can always be overridden with `-Zcodegen-backend`.
2580    ///
2581    /// This was added by WaffleLapkin in #116793. The motivation is a rustc fork that requires a
2582    /// custom codegen backend for a particular target.
2583    pub default_codegen_backend: Option<StaticCow<str>>,
2584
2585    /// Whether to generate trap instructions in places where optimization would
2586    /// otherwise produce control flow that falls through into unrelated memory.
2587    pub trap_unreachable: bool,
2588
2589    /// This target requires everything to be compiled with LTO to emit a final
2590    /// executable, aka there is no native linker for this target.
2591    pub requires_lto: bool,
2592
2593    /// This target has no support for threads.
2594    // This is private because wasm changes this depending on target features.
2595    singlethread: bool,
2596
2597    /// Whether library functions call lowering/optimization is disabled in LLVM
2598    /// for this target unconditionally.
2599    pub no_builtins: bool,
2600
2601    /// The default visibility for symbols in this target.
2602    ///
2603    /// This value typically shouldn't be accessed directly, but through the
2604    /// `rustc_session::Session::default_visibility` method, which allows `rustc` users to override
2605    /// this setting using cmdline flags.
2606    pub default_visibility: Option<SymbolVisibility>,
2607
2608    /// Whether a .debug_gdb_scripts section will be added to the output object file
2609    pub emit_debug_gdb_scripts: bool,
2610
2611    /// Whether or not to unconditionally `uwtable` attributes on functions,
2612    /// typically because the platform needs to unwind for things like stack
2613    /// unwinders.
2614    pub requires_uwtable: bool,
2615
2616    /// Whether or not to emit `uwtable` attributes on functions if `-C force-unwind-tables`
2617    /// is not specified and `uwtable` is not required on this target.
2618    pub default_uwtable: bool,
2619
2620    /// Whether or not SIMD types are passed by reference in the Rust ABI,
2621    /// typically required if a target can be compiled with a mixed set of
2622    /// target features. This is `true` by default, and `false` for targets like
2623    /// wasm32 where the whole program either has simd or not.
2624    pub simd_types_indirect: bool,
2625
2626    /// Pass a list of symbol which should be exported in the dylib to the linker.
2627    pub limit_rdylib_exports: bool,
2628
2629    /// If set, have the linker export exactly these symbols, instead of using
2630    /// the usual logic to figure this out from the crate itself.
2631    pub override_export_symbols: Option<StaticCow<[StaticCow<str>]>>,
2632
2633    /// Determines how or whether the MergeFunctions LLVM pass should run for
2634    /// this target. Either "disabled", "trampolines", or "aliases".
2635    /// The MergeFunctions pass is generally useful, but some targets may need
2636    /// to opt out. The default is "aliases".
2637    ///
2638    /// Workaround for: <https://github.com/rust-lang/rust/issues/57356>
2639    pub merge_functions: MergeFunctions,
2640
2641    /// Use platform dependent mcount function
2642    pub mcount: StaticCow<str>,
2643
2644    /// Use LLVM intrinsic for mcount function name
2645    pub llvm_mcount_intrinsic: Option<StaticCow<str>>,
2646
2647    /// LLVM ABI name, corresponds to the '-mabi' parameter available in multilib C compilers
2648    /// and the `-target-abi` flag in llc. In the LLVM API this is `MCOptions.ABIName`.
2649    pub llvm_abiname: LlvmAbi,
2650
2651    /// Control the float ABI to use, for architectures that support it. The only architecture we
2652    /// currently use this for is ARM. Corresponds to the `-float-abi` flag in llc. In the LLVM API
2653    /// this is `FloatABIType`. (clang's `-mfloat-abi` is similar but more complicated since it
2654    /// can also affect the `soft-float` target feature.)
2655    ///
2656    /// If not provided, LLVM will infer the float ABI from the target triple (`llvm_target`).
2657    pub llvm_floatabi: Option<FloatAbi>,
2658
2659    /// Picks a specific ABI for this target. This is *not* just for "Rust" ABI functions,
2660    /// it can also affect "C" ABI functions; the point is that this flag is interpreted by
2661    /// rustc and not forwarded to LLVM.
2662    pub rustc_abi: Option<RustcAbi>,
2663
2664    /// Whether or not RelaxElfRelocation flag will be passed to the linker
2665    pub relax_elf_relocations: bool,
2666
2667    /// Additional arguments to pass to LLVM, similar to the `-C llvm-args` codegen option.
2668    pub llvm_args: StaticCow<[StaticCow<str>]>,
2669
2670    /// Whether to use legacy .ctors initialization hooks rather than .init_array. Defaults
2671    /// to false (uses .init_array).
2672    pub use_ctors_section: bool,
2673
2674    /// Whether the linker is instructed to add a `GNU_EH_FRAME` ELF header
2675    /// used to locate unwinding information is passed
2676    /// (only has effect if the linker is `ld`-like).
2677    pub eh_frame_header: bool,
2678
2679    /// Is true if the target is an ARM architecture using thumb v1 which allows for
2680    /// thumb and arm interworking.
2681    pub has_thumb_interworking: bool,
2682
2683    /// Which kind of debuginfo is used by this target?
2684    pub debuginfo_kind: DebuginfoKind,
2685    /// How to handle split debug information, if at all. Specifying `None` has
2686    /// target-specific meaning.
2687    pub split_debuginfo: SplitDebuginfo,
2688    /// Which kinds of split debuginfo are supported by the target?
2689    pub supported_split_debuginfo: StaticCow<[SplitDebuginfo]>,
2690
2691    /// The sanitizers supported by this target
2692    ///
2693    /// Note that the support here is at a codegen level. If the machine code with sanitizer
2694    /// enabled can generated on this target, but the necessary supporting libraries are not
2695    /// distributed with the target, the sanitizer should still appear in this list for the target.
2696    pub supported_sanitizers: SanitizerSet,
2697
2698    /// The sanitizers that are enabled by default on this target.
2699    ///
2700    /// Note that the support here is at a codegen level. If the machine code with sanitizer
2701    /// enabled can generated on this target, but the necessary supporting libraries are not
2702    /// distributed with the target, the sanitizer should still appear in this list for the target.
2703    pub default_sanitizers: SanitizerSet,
2704
2705    /// Minimum number of bits in #[repr(C)] enum. Defaults to the size of c_int
2706    pub c_enum_min_bits: Option<u64>,
2707
2708    /// Whether or not the DWARF `.debug_aranges` section should be generated.
2709    pub generate_arange_section: bool,
2710
2711    /// Whether the target supports stack canary checks. `true` by default,
2712    /// since this is most common among tier 1 and tier 2 targets.
2713    pub supports_stack_protector: bool,
2714
2715    /// The name of entry function.
2716    /// Default value is "main"
2717    pub entry_name: StaticCow<str>,
2718
2719    /// The ABI of the entry function.
2720    /// Default value is `CanonAbi::C`
2721    pub entry_abi: CanonAbi,
2722
2723    /// Whether the target supports fentry instrumentation.
2724    pub supports_fentry: bool,
2725
2726    /// Whether the target supports XRay instrumentation.
2727    pub supports_xray: bool,
2728
2729    /// The default address space for this target. When using LLVM as a backend, most targets simply
2730    /// use LLVM's default address space (0). Some other targets, such as CHERI targets, use a
2731    /// custom default address space (in this specific case, `200`).
2732    pub default_address_space: rustc_abi::AddressSpace,
2733
2734    /// Whether the targets supports -Z small-data-threshold
2735    small_data_threshold_support: SmallDataThresholdSupport,
2736}
2737
2738/// Add arguments for the given flavor and also for its "twin" flavors
2739/// that have a compatible command line interface.
2740fn add_link_args_iter(
2741    link_args: &mut LinkArgs,
2742    flavor: LinkerFlavor,
2743    args: impl Iterator<Item = StaticCow<str>> + Clone,
2744) {
2745    let mut insert = |flavor| link_args.entry(flavor).or_default().extend(args.clone());
2746    insert(flavor);
2747    match flavor {
2748        LinkerFlavor::Gnu(cc, lld) => {
2749            {
    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);
2750            insert(LinkerFlavor::Gnu(cc, Lld::Yes));
2751        }
2752        LinkerFlavor::Darwin(cc, lld) => {
2753            {
    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);
2754            insert(LinkerFlavor::Darwin(cc, Lld::Yes));
2755        }
2756        LinkerFlavor::Msvc(lld) => {
2757            {
    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);
2758            insert(LinkerFlavor::Msvc(Lld::Yes));
2759        }
2760        LinkerFlavor::WasmLld(..)
2761        | LinkerFlavor::Unix(..)
2762        | LinkerFlavor::EmCc
2763        | LinkerFlavor::Bpf
2764        | LinkerFlavor::Llbc => {}
2765    }
2766}
2767
2768fn add_link_args(link_args: &mut LinkArgs, flavor: LinkerFlavor, args: &[&'static str]) {
2769    add_link_args_iter(link_args, flavor, args.iter().copied().map(Cow::Borrowed))
2770}
2771
2772impl TargetOptions {
2773    pub fn supports_comdat(&self) -> bool {
2774        // XCOFF and MachO don't support COMDAT.
2775        !self.is_like_aix && !self.is_like_darwin
2776    }
2777
2778    pub fn uses_pdb_debuginfo(&self) -> bool {
2779        self.debuginfo_kind == DebuginfoKind::Pdb
2780    }
2781}
2782
2783impl TargetOptions {
2784    fn link_args(flavor: LinkerFlavor, args: &[&'static str]) -> LinkArgs {
2785        let mut link_args = LinkArgs::new();
2786        add_link_args(&mut link_args, flavor, args);
2787        link_args
2788    }
2789
2790    fn add_pre_link_args(&mut self, flavor: LinkerFlavor, args: &[&'static str]) {
2791        add_link_args(&mut self.pre_link_args, flavor, args);
2792    }
2793
2794    fn update_from_cli(&mut self) {
2795        self.linker_flavor = LinkerFlavor::from_cli_json(
2796            self.linker_flavor_json,
2797            self.lld_flavor_json,
2798            self.linker_is_gnu_json,
2799        );
2800        for (args, args_json) in [
2801            (&mut self.pre_link_args, &self.pre_link_args_json),
2802            (&mut self.late_link_args, &self.late_link_args_json),
2803            (&mut self.late_link_args_dynamic, &self.late_link_args_dynamic_json),
2804            (&mut self.late_link_args_static, &self.late_link_args_static_json),
2805            (&mut self.post_link_args, &self.post_link_args_json),
2806        ] {
2807            args.clear();
2808            for (flavor, args_json) in args_json {
2809                let linker_flavor = self.linker_flavor.with_cli_hints(*flavor);
2810                // Normalize to no lld to avoid asserts.
2811                let linker_flavor = match linker_flavor {
2812                    LinkerFlavor::Gnu(cc, _) => LinkerFlavor::Gnu(cc, Lld::No),
2813                    LinkerFlavor::Darwin(cc, _) => LinkerFlavor::Darwin(cc, Lld::No),
2814                    LinkerFlavor::Msvc(_) => LinkerFlavor::Msvc(Lld::No),
2815                    _ => linker_flavor,
2816                };
2817                if !args.contains_key(&linker_flavor) {
2818                    add_link_args_iter(args, linker_flavor, args_json.iter().cloned());
2819                }
2820            }
2821        }
2822    }
2823
2824    fn update_to_cli(&mut self) {
2825        self.linker_flavor_json = self.linker_flavor.to_cli_counterpart();
2826        self.lld_flavor_json = self.linker_flavor.lld_flavor();
2827        self.linker_is_gnu_json = self.linker_flavor.is_gnu();
2828        for (args, args_json) in [
2829            (&self.pre_link_args, &mut self.pre_link_args_json),
2830            (&self.late_link_args, &mut self.late_link_args_json),
2831            (&self.late_link_args_dynamic, &mut self.late_link_args_dynamic_json),
2832            (&self.late_link_args_static, &mut self.late_link_args_static_json),
2833            (&self.post_link_args, &mut self.post_link_args_json),
2834        ] {
2835            *args_json = args
2836                .iter()
2837                .map(|(flavor, args)| (flavor.to_cli_counterpart(), args.clone()))
2838                .collect();
2839        }
2840    }
2841}
2842
2843impl Default for TargetOptions {
2844    /// Creates a set of "sane defaults" for any target. This is still
2845    /// incomplete, and if used for compilation, will certainly not work.
2846    fn default() -> TargetOptions {
2847        TargetOptions {
2848            endian: Endian::Little,
2849            c_int_width: 32,
2850            os: Os::None,
2851            env: Env::Unspecified,
2852            cfg_abi: CfgAbi::Unspecified,
2853            vendor: "unknown".into(),
2854            linker: ::core::option::Option::None::<&'static str>option_env!("CFG_DEFAULT_LINKER").map(|s| s.into()),
2855            linker_flavor: LinkerFlavor::Gnu(Cc::Yes, Lld::No),
2856            linker_flavor_json: LinkerFlavorCli::Gcc,
2857            lld_flavor_json: LldFlavor::Ld,
2858            linker_is_gnu_json: true,
2859            link_script: None,
2860            asm_args: ::std::borrow::Cow::Borrowed(&[])cvs![],
2861            cpu: "generic".into(),
2862            need_explicit_cpu: false,
2863            unsupported_cpus: ::std::borrow::Cow::Borrowed(&[])cvs![],
2864            features: "".into(),
2865            direct_access_external_data: None,
2866            dynamic_linking: false,
2867            dll_tls_export: true,
2868            only_cdylib: false,
2869            executables: true,
2870            relocation_model: RelocModel::Pic,
2871            code_model: None,
2872            tls_model: TlsModel::GeneralDynamic,
2873            disable_redzone: false,
2874            frame_pointer: FramePointer::MayOmit,
2875            function_sections: true,
2876            dll_prefix: "lib".into(),
2877            dll_suffix: ".so".into(),
2878            exe_suffix: "".into(),
2879            staticlib_prefix: "lib".into(),
2880            staticlib_suffix: ".a".into(),
2881            families: ::std::borrow::Cow::Borrowed(&[])cvs![],
2882            abi_return_struct_as_int: false,
2883            is_like_aix: false,
2884            is_like_darwin: false,
2885            is_like_gpu: false,
2886            is_like_solaris: false,
2887            is_like_windows: false,
2888            is_like_msvc: false,
2889            is_like_wasm: false,
2890            is_like_android: false,
2891            is_like_vexos: false,
2892            binary_format: BinaryFormat::Elf,
2893            default_dwarf_version: 4,
2894            has_rpath: false,
2895            no_default_libraries: true,
2896            position_independent_executables: false,
2897            static_position_independent_executables: false,
2898            plt_by_default: true,
2899            relro_level: RelroLevel::None,
2900            pre_link_objects: Default::default(),
2901            post_link_objects: Default::default(),
2902            pre_link_objects_self_contained: Default::default(),
2903            post_link_objects_self_contained: Default::default(),
2904            link_self_contained: LinkSelfContainedDefault::False,
2905            pre_link_args: LinkArgs::new(),
2906            pre_link_args_json: LinkArgsCli::new(),
2907            late_link_args: LinkArgs::new(),
2908            late_link_args_json: LinkArgsCli::new(),
2909            late_link_args_dynamic: LinkArgs::new(),
2910            late_link_args_dynamic_json: LinkArgsCli::new(),
2911            late_link_args_static: LinkArgs::new(),
2912            late_link_args_static_json: LinkArgsCli::new(),
2913            post_link_args: LinkArgs::new(),
2914            post_link_args_json: LinkArgsCli::new(),
2915            link_env: ::std::borrow::Cow::Borrowed(&[])cvs![],
2916            link_env_remove: ::std::borrow::Cow::Borrowed(&[])cvs![],
2917            archive_format: "gnu".into(),
2918            main_needs_argc_argv: true,
2919            allow_asm: true,
2920            static_initializer_must_be_acyclic: false,
2921            has_thread_local: false,
2922            obj_is_bitcode: false,
2923            min_atomic_width: None,
2924            max_atomic_width: None,
2925            atomic_cas: true,
2926            panic_strategy: PanicStrategy::Unwind,
2927            crt_static_allows_dylibs: false,
2928            crt_static_default: false,
2929            crt_static_respected: false,
2930            stack_probes: StackProbeType::None,
2931            min_global_align: None,
2932            default_codegen_units: None,
2933            default_codegen_backend: None,
2934            trap_unreachable: true,
2935            requires_lto: false,
2936            singlethread: false,
2937            no_builtins: false,
2938            default_visibility: None,
2939            emit_debug_gdb_scripts: true,
2940            requires_uwtable: false,
2941            default_uwtable: false,
2942            simd_types_indirect: true,
2943            limit_rdylib_exports: true,
2944            override_export_symbols: None,
2945            merge_functions: MergeFunctions::Aliases,
2946            mcount: "mcount".into(),
2947            llvm_mcount_intrinsic: None,
2948            llvm_abiname: LlvmAbi::Unspecified,
2949            llvm_floatabi: None,
2950            rustc_abi: None,
2951            relax_elf_relocations: false,
2952            llvm_args: ::std::borrow::Cow::Borrowed(&[])cvs![],
2953            use_ctors_section: false,
2954            eh_frame_header: true,
2955            has_thumb_interworking: false,
2956            debuginfo_kind: Default::default(),
2957            split_debuginfo: Default::default(),
2958            // `Off` is supported by default, but targets can remove this manually, e.g. Windows.
2959            supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
2960            supported_sanitizers: SanitizerSet::empty(),
2961            default_sanitizers: SanitizerSet::empty(),
2962            c_enum_min_bits: None,
2963            generate_arange_section: true,
2964            supports_stack_protector: true,
2965            entry_name: "main".into(),
2966            entry_abi: CanonAbi::C,
2967            supports_fentry: false,
2968            supports_xray: false,
2969            default_address_space: rustc_abi::AddressSpace::ZERO,
2970            small_data_threshold_support: SmallDataThresholdSupport::DefaultForArch,
2971        }
2972    }
2973}
2974
2975/// `TargetOptions` being a separate type is basically an implementation detail of `Target` that is
2976/// used for providing defaults. Perhaps there's a way to merge `TargetOptions` into `Target` so
2977/// this `Deref` implementation is no longer necessary.
2978impl Deref for Target {
2979    type Target = TargetOptions;
2980
2981    #[inline]
2982    fn deref(&self) -> &Self::Target {
2983        &self.options
2984    }
2985}
2986impl DerefMut for Target {
2987    #[inline]
2988    fn deref_mut(&mut self) -> &mut Self::Target {
2989        &mut self.options
2990    }
2991}
2992
2993impl Target {
2994    pub fn is_abi_supported(&self, abi: ExternAbi) -> bool {
2995        let abi_map = AbiMap::from_target(self);
2996        abi_map.canonize_abi(abi, false).is_mapped()
2997    }
2998
2999    /// Minimum integer size in bits that this target can perform atomic
3000    /// operations on.
3001    pub fn min_atomic_width(&self) -> u64 {
3002        self.min_atomic_width.unwrap_or(8)
3003    }
3004
3005    /// Maximum integer size in bits that this target can perform atomic
3006    /// operations on.
3007    pub fn max_atomic_width(&self) -> u64 {
3008        self.max_atomic_width.unwrap_or_else(|| self.pointer_width.into())
3009    }
3010
3011    /// Check some basic consistency of the current target. For JSON targets we are less strict;
3012    /// some of these checks are more guidelines than strict rules.
3013    fn check_consistency(&self, kind: TargetKind) -> Result<(), String> {
3014        macro_rules! check {
3015            ($b:expr, $($msg:tt)*) => {
3016                if !$b {
3017                    return Err(format!($($msg)*));
3018                }
3019            }
3020        }
3021        macro_rules! check_eq {
3022            ($left:expr, $right:expr, $($msg:tt)*) => {
3023                if ($left) != ($right) {
3024                    return Err(format!($($msg)*));
3025                }
3026            }
3027        }
3028        macro_rules! check_ne {
3029            ($left:expr, $right:expr, $($msg:tt)*) => {
3030                if ($left) == ($right) {
3031                    return Err(format!($($msg)*));
3032                }
3033            }
3034        }
3035        macro_rules! check_matches {
3036            ($left:expr, $right:pat, $($msg:tt)*) => {
3037                if !matches!($left, $right) {
3038                    return Err(format!($($msg)*));
3039                }
3040            }
3041        }
3042
3043        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!(
3044            self.is_like_darwin,
3045            self.vendor == "apple",
3046            "`is_like_darwin` must be set if and only if `vendor` is `apple`"
3047        );
3048        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!(
3049            self.is_like_solaris,
3050            matches!(self.os, Os::Solaris | Os::Illumos),
3051            "`is_like_solaris` must be set if and only if `os` is `solaris` or `illumos`"
3052        );
3053        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!(
3054            self.is_like_gpu,
3055            self.arch == Arch::Nvptx64 || self.arch == Arch::AmdGpu,
3056            "`is_like_gpu` must be set if and only if `target` is `nvptx64` or `amdgcn`"
3057        );
3058        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!(
3059            self.is_like_windows,
3060            matches!(self.os, Os::Windows | Os::Uefi | Os::Cygwin),
3061            "`is_like_windows` must be set if and only if `os` is `windows`, `uefi` or `cygwin`"
3062        );
3063        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!(
3064            self.is_like_wasm,
3065            matches!(self.arch, Arch::Wasm32 | Arch::Wasm64),
3066            "`is_like_wasm` must be set if and only if `arch` is `wasm32` or `wasm64`"
3067        );
3068        if self.is_like_msvc {
3069            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");
3070        }
3071        if self.os == Os::Emscripten {
3072            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");
3073        }
3074
3075        // Check that default linker flavor is compatible with some other key properties.
3076        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!(
3077            self.is_like_darwin,
3078            matches!(self.linker_flavor, LinkerFlavor::Darwin(..)),
3079            "`linker_flavor` must be `darwin` if and only if `is_like_darwin` is set"
3080        );
3081        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!(
3082            self.is_like_msvc,
3083            matches!(self.linker_flavor, LinkerFlavor::Msvc(..)),
3084            "`linker_flavor` must be `msvc` if and only if `is_like_msvc` is set"
3085        );
3086        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!(
3087            self.is_like_wasm && self.os != Os::Emscripten,
3088            matches!(self.linker_flavor, LinkerFlavor::WasmLld(..)),
3089            "`linker_flavor` must be `wasm-lld` if and only if `is_like_wasm` is set and the `os` is not `emscripten`",
3090        );
3091        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!(
3092            self.os == Os::Emscripten,
3093            matches!(self.linker_flavor, LinkerFlavor::EmCc),
3094            "`linker_flavor` must be `em-cc` if and only if `os` is `emscripten`"
3095        );
3096        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!(
3097            self.arch == Arch::Bpf,
3098            matches!(self.linker_flavor, LinkerFlavor::Bpf),
3099            "`linker_flavor` must be `bpf` if and only if `arch` is `bpf`"
3100        );
3101
3102        for args in [
3103            &self.pre_link_args,
3104            &self.late_link_args,
3105            &self.late_link_args_dynamic,
3106            &self.late_link_args_static,
3107            &self.post_link_args,
3108        ] {
3109            for (&flavor, flavor_args) in args {
3110                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!(
3111                    !flavor_args.is_empty() || self.arch == Arch::Avr,
3112                    "linker flavor args must not be empty"
3113                );
3114                // Check that flavors mentioned in link args are compatible with the default flavor.
3115                match self.linker_flavor {
3116                    LinkerFlavor::Gnu(..) => {
3117                        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!(
3118                            flavor,
3119                            LinkerFlavor::Gnu(..),
3120                            "mixing GNU and non-GNU linker flavors"
3121                        );
3122                    }
3123                    LinkerFlavor::Darwin(..) => {
3124                        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!(
3125                            flavor,
3126                            LinkerFlavor::Darwin(..),
3127                            "mixing Darwin and non-Darwin linker flavors"
3128                        )
3129                    }
3130                    LinkerFlavor::WasmLld(..) => {
3131                        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!(
3132                            flavor,
3133                            LinkerFlavor::WasmLld(..),
3134                            "mixing wasm and non-wasm linker flavors"
3135                        )
3136                    }
3137                    LinkerFlavor::Unix(..) => {
3138                        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!(
3139                            flavor,
3140                            LinkerFlavor::Unix(..),
3141                            "mixing unix and non-unix linker flavors"
3142                        );
3143                    }
3144                    LinkerFlavor::Msvc(..) => {
3145                        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!(
3146                            flavor,
3147                            LinkerFlavor::Msvc(..),
3148                            "mixing MSVC and non-MSVC linker flavors"
3149                        );
3150                    }
3151                    LinkerFlavor::EmCc | LinkerFlavor::Bpf | LinkerFlavor::Llbc => {
3152                        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")
3153                    }
3154                }
3155
3156                // Check that link args for cc and non-cc versions of flavors are consistent.
3157                let check_noncc = |noncc_flavor| -> Result<(), String> {
3158                    if let Some(noncc_args) = args.get(&noncc_flavor) {
3159                        for arg in flavor_args {
3160                            if let Some(suffix) = arg.strip_prefix("-Wl,") {
3161                                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!(
3162                                    noncc_args.iter().any(|a| a == suffix),
3163                                    " link args for cc and non-cc versions of flavors are not consistent"
3164                                );
3165                            }
3166                        }
3167                    }
3168                    Ok(())
3169                };
3170
3171                match self.linker_flavor {
3172                    LinkerFlavor::Gnu(Cc::Yes, lld) => check_noncc(LinkerFlavor::Gnu(Cc::No, lld))?,
3173                    LinkerFlavor::WasmLld(Cc::Yes) => check_noncc(LinkerFlavor::WasmLld(Cc::No))?,
3174                    LinkerFlavor::Unix(Cc::Yes) => check_noncc(LinkerFlavor::Unix(Cc::No))?,
3175                    _ => {}
3176                }
3177            }
3178
3179            // Check that link args for lld and non-lld versions of flavors are consistent.
3180            for cc in [Cc::No, Cc::Yes] {
3181                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!(
3182                    args.get(&LinkerFlavor::Gnu(cc, Lld::No)),
3183                    args.get(&LinkerFlavor::Gnu(cc, Lld::Yes)),
3184                    "link args for lld and non-lld versions of flavors are not consistent",
3185                );
3186                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!(
3187                    args.get(&LinkerFlavor::Darwin(cc, Lld::No)),
3188                    args.get(&LinkerFlavor::Darwin(cc, Lld::Yes)),
3189                    "link args for lld and non-lld versions of flavors are not consistent",
3190                );
3191            }
3192            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!(
3193                args.get(&LinkerFlavor::Msvc(Lld::No)),
3194                args.get(&LinkerFlavor::Msvc(Lld::Yes)),
3195                "link args for lld and non-lld versions of flavors are not consistent",
3196            );
3197        }
3198
3199        if self.link_self_contained.is_disabled() {
3200            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!(
3201                self.pre_link_objects_self_contained.is_empty()
3202                    && self.post_link_objects_self_contained.is_empty(),
3203                "if `link_self_contained` is disabled, then `pre_link_objects_self_contained` and `post_link_objects_self_contained` must be empty",
3204            );
3205        }
3206
3207        // If your target really needs to deviate from the rules below,
3208        // except it and document the reasons.
3209        // Keep the default "unknown" vendor instead.
3210        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");
3211        if let Os::Other(s) = &self.os {
3212            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");
3213        }
3214        if !self.can_use_os_unknown() {
3215            // Keep the default "none" for bare metal targets instead.
3216            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!(
3217                self.os,
3218                Os::Unknown,
3219                "`unknown` os can only be used on particular targets; use `none` for bare-metal targets"
3220            );
3221        }
3222
3223        // Check dynamic linking stuff.
3224        // We skip this for JSON targets since otherwise, our default values would fail this test.
3225        // These checks are not critical for correctness, but more like default guidelines.
3226        // FIXME (https://github.com/rust-lang/rust/issues/133459): do we want to change the JSON
3227        // target defaults so that they pass these checks?
3228        if kind == TargetKind::Builtin {
3229            // BPF: when targeting user space vms (like rbpf), those can load dynamic libraries.
3230            // hexagon: when targeting QuRT, that OS can load dynamic libraries.
3231            // wasm{32,64}: dynamic linking is inherent in the definition of the VM.
3232            if self.os == Os::None
3233                && !#[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)
3234            {
3235                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!(
3236                    !self.dynamic_linking,
3237                    "dynamic linking is not supported on this OS/architecture"
3238                );
3239            }
3240            if self.only_cdylib
3241                || self.crt_static_allows_dylibs
3242                || !self.late_link_args_dynamic.is_empty()
3243            {
3244                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!(
3245                    self.dynamic_linking,
3246                    "dynamic linking must be allowed when `only_cdylib` or `crt_static_allows_dylibs` or `late_link_args_dynamic` are set"
3247                );
3248            }
3249            // Apparently PIC was slow on wasm at some point, see comments in wasm_base.rs
3250            if self.dynamic_linking && !self.is_like_wasm {
3251                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!(
3252                    self.relocation_model,
3253                    RelocModel::Pic,
3254                    "targets that support dynamic linking must use the `pic` relocation model"
3255                );
3256            }
3257            if self.position_independent_executables {
3258                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!(
3259                    self.relocation_model,
3260                    RelocModel::Pic,
3261                    "targets that support position-independent executables must use the `pic` relocation model"
3262                );
3263            }
3264            // The UEFI targets do not support dynamic linking but still require PIC (#101377).
3265            if self.relocation_model == RelocModel::Pic && self.os != Os::Uefi {
3266                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!(
3267                    self.dynamic_linking || self.position_independent_executables,
3268                    "when the relocation model is `pic`, the target must support dynamic linking or use position-independent executables. \
3269                Set the relocation model to `static` to avoid this requirement"
3270                );
3271            }
3272            if self.static_position_independent_executables {
3273                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!(
3274                    self.position_independent_executables,
3275                    "if `static_position_independent_executables` is set, then `position_independent_executables` must be set"
3276                );
3277            }
3278            if self.position_independent_executables {
3279                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!(
3280                    self.executables,
3281                    "if `position_independent_executables` is set then `executables` must be set"
3282                );
3283            }
3284        }
3285
3286        // Check crt static stuff
3287        if self.crt_static_default || self.crt_static_allows_dylibs {
3288            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!(
3289                self.crt_static_respected,
3290                "static CRT can be enabled but `crt_static_respected` is not set"
3291            );
3292        }
3293
3294        // Ensure built-in targets don't use the `Other` variants.
3295        if kind == TargetKind::Builtin {
3296            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!(
3297                !matches!(self.arch, Arch::Other(_)),
3298                "`Arch::Other` is only meant for JSON targets"
3299            );
3300            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");
3301            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!(
3302                !matches!(self.env, Env::Other(_)),
3303                "`Env::Other` is only meant for JSON targets"
3304            );
3305            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!(
3306                !matches!(self.cfg_abi, CfgAbi::Other(_)),
3307                "`CfgAbi::Other` is only meant for JSON targets"
3308            );
3309            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!(
3310                !matches!(self.llvm_abiname, LlvmAbi::Other(_)),
3311                "`LlvmAbi::Other` is only meant for JSON targets"
3312            );
3313        }
3314
3315        // Check ABI flag consistency, for the architectures where we have proper ABI treatment.
3316        // To ensure targets are trated consistently, please consult with the team before allowing
3317        // new cases.
3318        match self.arch {
3319            Arch::X86 => {
3320                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!(
3321                    self.llvm_abiname == LlvmAbi::Unspecified,
3322                    "`llvm_abiname` is unused on x86-32"
3323                );
3324                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");
3325                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!(
3326                    (&self.rustc_abi, &self.cfg_abi),
3327                    // FIXME: we do not currently set a target_abi for softfloat targets here,
3328                    // but we probably should, so we already allow it.
3329                    (
3330                        Some(RustcAbi::Softfloat),
3331                        CfgAbi::SoftFloat | CfgAbi::Unspecified | CfgAbi::Other(_)
3332                    ) | (
3333                        Some(RustcAbi::X86Sse2) | None,
3334                        CfgAbi::Uwp
3335                            | CfgAbi::Llvm
3336                            | CfgAbi::Sim
3337                            | CfgAbi::Unspecified
3338                            | CfgAbi::Other(_)
3339                    ),
3340                    "invalid x86-32 Rust-specific ABI and `cfg(target_abi)` combination:\n\
3341                    Rust-specific ABI: {:?}\n\
3342                    cfg(target_abi): {}",
3343                    self.rustc_abi,
3344                    self.cfg_abi,
3345                );
3346            }
3347            Arch::X86_64 => {
3348                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!(
3349                    self.llvm_abiname == LlvmAbi::Unspecified,
3350                    "`llvm_abiname` is unused on x86-64"
3351                );
3352                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");
3353                // FIXME: we do not currently set a target_abi for softfloat targets here, but we
3354                // probably should, so we already allow it.
3355                // FIXME: Ensure that target_abi = "x32" correlates with actually using that ABI.
3356                // Do any of the others need a similar check?
3357                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!(
3358                    (&self.rustc_abi, &self.cfg_abi),
3359                    (
3360                        Some(RustcAbi::Softfloat),
3361                        CfgAbi::SoftFloat | CfgAbi::Unspecified | CfgAbi::Other(_)
3362                    ) | (
3363                        None,
3364                        CfgAbi::X32
3365                            | CfgAbi::Llvm
3366                            | CfgAbi::Fortanix
3367                            | CfgAbi::Uwp
3368                            | CfgAbi::MacAbi
3369                            | CfgAbi::Sim
3370                            | CfgAbi::Unspecified
3371                            | CfgAbi::Other(_)
3372                    ),
3373                    "invalid x86-64 Rust-specific ABI and `cfg(target_abi)` combination:\n\
3374                    Rust-specific ABI: {:?}\n\
3375                    cfg(target_abi): {}",
3376                    self.rustc_abi,
3377                    self.cfg_abi,
3378                );
3379            }
3380            Arch::RiscV32 => {
3381                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");
3382                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");
3383                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!(
3384                    (&self.llvm_abiname, &self.cfg_abi),
3385                    (LlvmAbi::Ilp32, CfgAbi::Unspecified | CfgAbi::Other(_))
3386                        | (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_))
3387                        | (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_))
3388                        | (LlvmAbi::Ilp32e, CfgAbi::Ilp32e),
3389                    "invalid RISC-V ABI name and `cfg(target_abi)` combination:\n\
3390                     ABI name: {}\n\
3391                     cfg(target_abi): {}",
3392                    self.llvm_abiname,
3393                    self.cfg_abi,
3394                );
3395            }
3396            Arch::RiscV64 => {
3397                // Note that the `lp64e` is still unstable as it's not (yet) part of the ELF psABI.
3398                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");
3399                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");
3400                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!(
3401                    (&self.llvm_abiname, &self.cfg_abi),
3402                    (LlvmAbi::Lp64, CfgAbi::Unspecified | CfgAbi::Other(_))
3403                        | (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_))
3404                        | (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_))
3405                        | (LlvmAbi::Lp64e, CfgAbi::Unspecified | CfgAbi::Other(_)),
3406                    "invalid RISC-V ABI name and `cfg(target_abi)` combination:\n\
3407                     ABI name: {}\n\
3408                     cfg(target_abi): {}",
3409                    self.llvm_abiname,
3410                    self.cfg_abi,
3411                );
3412            }
3413            Arch::Arm => {
3414                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on ARM"))
                }));
};check!(
3415                    self.llvm_abiname == LlvmAbi::Unspecified,
3416                    "`llvm_abiname` is unused on ARM"
3417                );
3418                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");
3419                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!(
3420                    (&self.llvm_floatabi, &self.cfg_abi),
3421                    (
3422                        Some(FloatAbi::Hard),
3423                        CfgAbi::EabiHf | CfgAbi::Uwp | CfgAbi::Unspecified | CfgAbi::Other(_)
3424                    ) | (Some(FloatAbi::Soft), CfgAbi::Eabi),
3425                    "Invalid combination of float ABI and `cfg(target_abi)` for ARM target\n\
3426                     float ABI: {:?}\n\
3427                     cfg(target_abi): {}",
3428                    self.llvm_floatabi,
3429                    self.cfg_abi,
3430                )
3431            }
3432            Arch::AArch64 => {
3433                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!(
3434                    self.llvm_abiname,
3435                    LlvmAbi::Unspecified | LlvmAbi::Pauthtest,
3436                    "invalid llvm ABI for aarch64"
3437                );
3438                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");
3439                // FIXME: Ensure that target_abi = "ilp32" correlates with actually using that ABI.
3440                // Do any of the others need a similar check?
3441                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!(
3442                    (&self.rustc_abi, &self.cfg_abi),
3443                    (Some(RustcAbi::Softfloat), CfgAbi::SoftFloat)
3444                        | (
3445                            None,
3446                            CfgAbi::Ilp32
3447                                | CfgAbi::Llvm
3448                                | CfgAbi::MacAbi
3449                                | CfgAbi::Pauthtest
3450                                | CfgAbi::Sim
3451                                | CfgAbi::Uwp
3452                                | CfgAbi::Unspecified
3453                                | CfgAbi::Other(_)
3454                        ),
3455                    "invalid aarch64 Rust-specific ABI and `cfg(target_abi)` combination:\n\
3456                    Rust-specific ABI: {:?}\n\
3457                    cfg(target_abi): {}",
3458                    self.rustc_abi,
3459                    self.cfg_abi,
3460                );
3461            }
3462            Arch::PowerPC => {
3463                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on PowerPC"))
                }));
};check!(
3464                    self.llvm_abiname == LlvmAbi::Unspecified,
3465                    "`llvm_abiname` is unused on PowerPC"
3466                );
3467                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");
3468                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!(
3469                    (&self.rustc_abi, &self.cfg_abi),
3470                    (Some(RustcAbi::PowerPcSpe), CfgAbi::Spe)
3471                        | (None, CfgAbi::Unspecified | CfgAbi::Other(_)),
3472                    "invalid PowerPC Rust-specific ABI and `cfg(target_abi)` combination:\n\
3473                    Rust-specific ABI: {:?}\n\
3474                    cfg(target_abi): {}",
3475                    self.rustc_abi,
3476                    self.cfg_abi,
3477                );
3478            }
3479            Arch::PowerPC64 => {
3480                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");
3481                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");
3482                // PowerPC64 targets that are not AIX must set their ABI to either ELFv1 or ELFv2
3483                if self.os == Os::Aix {
3484                    // FIXME: Check that `target_abi` matches the actually configured ABI
3485                    // (vec-default vs vec-ext).
3486                    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!(
3487                        (&self.llvm_abiname, &self.cfg_abi),
3488                        (LlvmAbi::Unspecified, CfgAbi::VecDefault | CfgAbi::VecExtAbi),
3489                        "invalid PowerPC64 AIX ABI name and `cfg(target_abi)` combination:\n\
3490                        ABI name: {}\n\
3491                        cfg(target_abi): {}",
3492                        self.llvm_abiname,
3493                        self.cfg_abi,
3494                    );
3495                } else if self.endian == Endian::Big {
3496                    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!(
3497                        (&self.llvm_abiname, &self.cfg_abi),
3498                        (LlvmAbi::ElfV1, CfgAbi::ElfV1) | (LlvmAbi::ElfV2, CfgAbi::ElfV2),
3499                        "invalid PowerPC64 big-endian ABI name and `cfg(target_abi)` combination:\n\
3500                        ABI name: {}\n\
3501                        cfg(target_abi): {}",
3502                        self.llvm_abiname,
3503                        self.cfg_abi,
3504                    );
3505                } else {
3506                    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!(
3507                        (&self.llvm_abiname, &self.cfg_abi),
3508                        (LlvmAbi::ElfV2, CfgAbi::ElfV2),
3509                        "invalid PowerPC64 little-endian ABI name and `cfg(target_abi)` combination:\n\
3510                        ABI name: {}\n\
3511                        cfg(target_abi): {}",
3512                        self.llvm_abiname,
3513                        self.cfg_abi,
3514                    );
3515                }
3516            }
3517            Arch::S390x => {
3518                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on s390x"))
                }));
};check!(
3519                    self.llvm_abiname == LlvmAbi::Unspecified,
3520                    "`llvm_abiname` is unused on s390x"
3521                );
3522                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");
3523                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!(
3524                    (&self.rustc_abi, &self.cfg_abi),
3525                    (Some(RustcAbi::Softfloat), CfgAbi::SoftFloat)
3526                        | (None, CfgAbi::Unspecified | CfgAbi::Other(_)),
3527                    "invalid s390x Rust-specific ABI and `cfg(target_abi)` combination:\n\
3528                    Rust-specific ABI: {:?}\n\
3529                    cfg(target_abi): {}",
3530                    self.rustc_abi,
3531                    self.cfg_abi,
3532                );
3533            }
3534            Arch::LoongArch32 => {
3535                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");
3536                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");
3537                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!(
3538                    (&self.llvm_abiname, &self.cfg_abi),
3539                    (LlvmAbi::Ilp32s, CfgAbi::SoftFloat)
3540                        | (LlvmAbi::Ilp32f, CfgAbi::Unspecified | CfgAbi::Other(_))
3541                        | (LlvmAbi::Ilp32d, CfgAbi::Unspecified | CfgAbi::Other(_)),
3542                    "invalid LoongArch ABI name and `cfg(target_abi)` combination:\n\
3543                     ABI name: {}\n\
3544                     cfg(target_abi): {}",
3545                    self.llvm_abiname,
3546                    self.cfg_abi,
3547                );
3548            }
3549            Arch::LoongArch64 => {
3550                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");
3551                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");
3552                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!(
3553                    (&self.llvm_abiname, &self.cfg_abi),
3554                    (LlvmAbi::Lp64s, CfgAbi::SoftFloat)
3555                        | (LlvmAbi::Lp64f, CfgAbi::Unspecified | CfgAbi::Other(_))
3556                        | (LlvmAbi::Lp64d, CfgAbi::Unspecified | CfgAbi::Other(_)),
3557                    "invalid LoongArch ABI name and `cfg(target_abi)` combination:\n\
3558                     ABI name: {}\n\
3559                     cfg(target_abi): {}",
3560                    self.llvm_abiname,
3561                    self.cfg_abi,
3562                );
3563            }
3564            Arch::Mips | Arch::Mips32r6 => {
3565                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");
3566                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");
3567                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!(
3568                    (&self.llvm_abiname, &self.cfg_abi),
3569                    (LlvmAbi::O32, CfgAbi::Unspecified | CfgAbi::Other(_)),
3570                    "invalid MIPS ABI name and `cfg(target_abi)` combination:\n\
3571                     ABI name: {}\n\
3572                     cfg(target_abi): {}",
3573                    self.llvm_abiname,
3574                    self.cfg_abi,
3575                );
3576            }
3577            Arch::Mips64 | Arch::Mips64r6 => {
3578                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");
3579                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");
3580                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!(
3581                    (&self.llvm_abiname, &self.cfg_abi),
3582                    // No in-tree targets use "n32" but at least for now we let out-of-tree targets
3583                    // experiment with that.
3584                    (LlvmAbi::N64, CfgAbi::Abi64)
3585                        | (LlvmAbi::N32, CfgAbi::Unspecified | CfgAbi::Other(_)),
3586                    "invalid MIPS ABI name and `cfg(target_abi)` combination:\n\
3587                     ABI name: {}\n\
3588                     cfg(target_abi): {}",
3589                    self.llvm_abiname,
3590                    self.cfg_abi,
3591                );
3592            }
3593            Arch::CSky => {
3594                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on CSky"))
                }));
};check!(
3595                    self.llvm_abiname == LlvmAbi::Unspecified,
3596                    "`llvm_abiname` is unused on CSky"
3597                );
3598                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");
3599                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");
3600                // FIXME: Check that `target_abi` matches the actually configured ABI (v2 vs v2hf).
3601                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!(
3602                    self.cfg_abi,
3603                    CfgAbi::AbiV2 | CfgAbi::AbiV2Hf,
3604                    "invalid `target_abi` for CSky"
3605                );
3606            }
3607            Arch::Wasm32 | Arch::Wasm64 => {
3608                if !(self.llvm_abiname == LlvmAbi::Unspecified) {
    return Err(::alloc::__export::must_use({
                    ::alloc::fmt::format(format_args!("`llvm_abiname` is unused on wasm"))
                }));
};check!(
3609                    self.llvm_abiname == LlvmAbi::Unspecified,
3610                    "`llvm_abiname` is unused on wasm"
3611                );
3612                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");
3613                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");
3614                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!(
3615                    self.cfg_abi,
3616                    CfgAbi::Unspecified | CfgAbi::Other(_),
3617                    "invalid `target_abi` for wasm"
3618                );
3619            }
3620            ref arch => {
3621                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}");
3622                // Ensure consistency among built-in targets, but give JSON targets the opportunity
3623                // to experiment with these.
3624                if kind == TargetKind::Builtin {
3625                    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!(
3626                        self.llvm_abiname == LlvmAbi::Unspecified,
3627                        "`llvm_abiname` is unused on {arch}"
3628                    );
3629                    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}");
3630                    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!(
3631                        self.cfg_abi,
3632                        CfgAbi::Unspecified | CfgAbi::Other(_),
3633                        "`target_abi` is unused on {arch}"
3634                    );
3635                }
3636            }
3637        }
3638
3639        // Check that the given target-features string makes some basic sense.
3640        if !self.features.is_empty() {
3641            let mut features_enabled = FxHashSet::default();
3642            let mut features_disabled = FxHashSet::default();
3643            for feat in self.features.split(',') {
3644                if let Some(feat) = feat.strip_prefix("+") {
3645                    features_enabled.insert(feat);
3646                    if features_disabled.contains(feat) {
3647                        return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is both enabled and disabled",
                feat))
    })format!(
3648                            "target feature `{feat}` is both enabled and disabled"
3649                        ));
3650                    }
3651                } else if let Some(feat) = feat.strip_prefix("-") {
3652                    features_disabled.insert(feat);
3653                    if features_enabled.contains(feat) {
3654                        return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is both enabled and disabled",
                feat))
    })format!(
3655                            "target feature `{feat}` is both enabled and disabled"
3656                        ));
3657                    }
3658                } else {
3659                    return Err(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("target feature `{0}` is invalid, must start with `+` or `-`",
                feat))
    })format!(
3660                        "target feature `{feat}` is invalid, must start with `+` or `-`"
3661                    ));
3662                }
3663            }
3664            // Check that we don't mis-set any of the ABI-relevant features.
3665            let abi_feature_constraints = self.abi_required_features();
3666            for feat in abi_feature_constraints.required {
3667                // The feature might be enabled by default so we can't *require* it to show up.
3668                // But it must not be *disabled*.
3669                if features_disabled.contains(feat) {
3670                    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!(
3671                        "target feature `{feat}` is required by the ABI but gets disabled in target spec"
3672                    ));
3673                }
3674            }
3675            for feat in abi_feature_constraints.incompatible {
3676                // The feature might be disabled by default so we can't *require* it to show up.
3677                // But it must not be *enabled*.
3678                if features_enabled.contains(feat) {
3679                    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!(
3680                        "target feature `{feat}` is incompatible with the ABI but gets enabled in target spec"
3681                    ));
3682                }
3683            }
3684        }
3685
3686        Ok(())
3687    }
3688
3689    /// Test target self-consistency and JSON encoding/decoding roundtrip.
3690    #[cfg(test)]
3691    fn test_target(mut self) {
3692        let recycled_target =
3693            Target::from_json(&serde_json::to_string(&self.to_json()).unwrap()).map(|(j, _)| j);
3694        self.update_to_cli();
3695        self.check_consistency(TargetKind::Builtin)
3696            .unwrap_or_else(|err| panic!("Target consistency check failed:\n{err}"));
3697        assert_eq!(recycled_target, Ok(self));
3698    }
3699
3700    // Add your target to the whitelist if it has `std` library
3701    // and you certainly want "unknown" for the OS name.
3702    fn can_use_os_unknown(&self) -> bool {
3703        self.llvm_target == "wasm32-unknown-unknown"
3704            || self.llvm_target == "wasm64-unknown-unknown"
3705            || (self.env == Env::Sgx && self.vendor == "fortanix")
3706    }
3707
3708    /// Load a built-in target
3709    pub fn expect_builtin(target_tuple: &TargetTuple) -> Target {
3710        match *target_tuple {
3711            TargetTuple::TargetTuple(ref target_tuple) => {
3712                load_builtin(target_tuple).expect("built-in target")
3713            }
3714            TargetTuple::TargetJson { .. } => {
3715                {
    ::core::panicking::panic_fmt(format_args!("built-in targets doesn\'t support target-paths"));
}panic!("built-in targets doesn't support target-paths")
3716            }
3717        }
3718    }
3719
3720    /// Load all built-in targets
3721    pub fn builtins() -> impl Iterator<Item = Target> {
3722        load_all_builtins()
3723    }
3724
3725    /// Search for a JSON file specifying the given target tuple.
3726    ///
3727    /// If none is found in `$RUST_TARGET_PATH`, look for a file called `target.json` inside the
3728    /// sysroot under the target-tuple's `rustlib` directory. Note that it could also just be a
3729    /// bare filename already, so also check for that. If one of the hardcoded targets we know
3730    /// about, just return it directly.
3731    ///
3732    /// The error string could come from any of the APIs called, including filesystem access and
3733    /// JSON decoding.
3734    pub fn search(
3735        target_tuple: &TargetTuple,
3736        sysroot: &Path,
3737        unstable_options: bool,
3738    ) -> Result<(Target, TargetWarnings), String> {
3739        use std::{env, fs};
3740
3741        fn load_file(
3742            path: &Path,
3743            unstable_options: bool,
3744        ) -> Result<(Target, TargetWarnings), String> {
3745            if !unstable_options {
3746                return Err(
3747                    "custom targets are unstable and require `-Zunstable-options`".to_string()
3748                );
3749            }
3750            let contents = fs::read_to_string(path).map_err(|e| e.to_string())?;
3751            Target::from_json(&contents)
3752        }
3753
3754        match *target_tuple {
3755            TargetTuple::TargetTuple(ref target_tuple) => {
3756                // check if tuple is in list of built-in targets
3757                if let Some(t) = load_builtin(target_tuple) {
3758                    return Ok((t, TargetWarnings::empty()));
3759                }
3760
3761                // search for a file named `target_tuple`.json in RUST_TARGET_PATH
3762                let path = {
3763                    let mut target = target_tuple.to_string();
3764                    target.push_str(".json");
3765                    PathBuf::from(target)
3766                };
3767
3768                let target_path = env::var_os("RUST_TARGET_PATH").unwrap_or_default();
3769
3770                for dir in env::split_paths(&target_path) {
3771                    let p = dir.join(&path);
3772                    if p.is_file() {
3773                        return load_file(&p, unstable_options);
3774                    }
3775                }
3776
3777                // Additionally look in the sysroot under `lib/rustlib/<tuple>/target.json`
3778                // as a fallback.
3779                let rustlib_path = crate::relative_target_rustlib_path(sysroot, target_tuple);
3780                let p = PathBuf::from_iter([
3781                    Path::new(sysroot),
3782                    Path::new(&rustlib_path),
3783                    Path::new("target.json"),
3784                ]);
3785                if p.is_file() {
3786                    return load_file(&p, unstable_options);
3787                }
3788
3789                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:?}"))
3790            }
3791            TargetTuple::TargetJson { ref contents, .. } if !unstable_options => {
3792                Err("custom targets are unstable and require `-Zunstable-options`".to_string())
3793            }
3794            TargetTuple::TargetJson { ref contents, .. } => Target::from_json(contents),
3795        }
3796    }
3797
3798    /// Return the target's small data threshold support, converting
3799    /// `DefaultForArch` into a concrete value.
3800    pub fn small_data_threshold_support(&self) -> SmallDataThresholdSupport {
3801        match &self.options.small_data_threshold_support {
3802            // Avoid having to duplicate the small data support in every
3803            // target file by supporting a default value for each
3804            // architecture.
3805            SmallDataThresholdSupport::DefaultForArch => match self.arch {
3806                Arch::Mips | Arch::Mips64 | Arch::Mips32r6 => {
3807                    SmallDataThresholdSupport::LlvmArg("mips-ssection-threshold".into())
3808                }
3809                Arch::Hexagon => {
3810                    SmallDataThresholdSupport::LlvmArg("hexagon-small-data-threshold".into())
3811                }
3812                Arch::M68k => SmallDataThresholdSupport::LlvmArg("m68k-ssection-threshold".into()),
3813                Arch::RiscV32 | Arch::RiscV64 => {
3814                    SmallDataThresholdSupport::LlvmModuleFlag("SmallDataLimit".into())
3815                }
3816                _ => SmallDataThresholdSupport::None,
3817            },
3818            s => s.clone(),
3819        }
3820    }
3821
3822    pub fn object_architecture(
3823        &self,
3824        unstable_target_features: &FxIndexSet<Symbol>,
3825    ) -> Option<(object::Architecture, Option<object::SubArchitecture>)> {
3826        use object::Architecture;
3827        Some(match self.arch {
3828            Arch::Arm => (Architecture::Arm, None),
3829            Arch::AArch64 => (
3830                if self.pointer_width == 32 {
3831                    Architecture::Aarch64_Ilp32
3832                } else {
3833                    Architecture::Aarch64
3834                },
3835                None,
3836            ),
3837            Arch::X86 => (Architecture::I386, None),
3838            Arch::S390x => (Architecture::S390x, None),
3839            Arch::M68k => (Architecture::M68k, None),
3840            Arch::Mips | Arch::Mips32r6 => (Architecture::Mips, None),
3841            Arch::Mips64 | Arch::Mips64r6 => (
3842                // While there are currently no builtin targets
3843                // using the N32 ABI, it is possible to specify
3844                // it using a custom target specification. N32
3845                // is an ILP32 ABI like the Aarch64_Ilp32
3846                // and X86_64_X32 cases above and below this one.
3847                if self.options.llvm_abiname == LlvmAbi::N32 {
3848                    Architecture::Mips64_N32
3849                } else {
3850                    Architecture::Mips64
3851                },
3852                None,
3853            ),
3854            Arch::X86_64 => (
3855                if self.pointer_width == 32 {
3856                    Architecture::X86_64_X32
3857                } else {
3858                    Architecture::X86_64
3859                },
3860                None,
3861            ),
3862            Arch::PowerPC => (Architecture::PowerPc, None),
3863            Arch::PowerPC64 => (Architecture::PowerPc64, None),
3864            Arch::RiscV32 => (Architecture::Riscv32, None),
3865            Arch::RiscV64 => (Architecture::Riscv64, None),
3866            Arch::Sparc => {
3867                if unstable_target_features.contains(&sym::v8plus) {
3868                    // Target uses V8+, aka EM_SPARC32PLUS, aka 64-bit V9 but in 32-bit mode
3869                    (Architecture::Sparc32Plus, None)
3870                } else {
3871                    // Target uses V7 or V8, aka EM_SPARC
3872                    (Architecture::Sparc, None)
3873                }
3874            }
3875            Arch::Sparc64 => (Architecture::Sparc64, None),
3876            Arch::Avr => (Architecture::Avr, None),
3877            Arch::Msp430 => (Architecture::Msp430, None),
3878            Arch::Hexagon => (Architecture::Hexagon, None),
3879            Arch::Xtensa => (Architecture::Xtensa, None),
3880            Arch::Bpf => (Architecture::Bpf, None),
3881            Arch::LoongArch32 => (Architecture::LoongArch32, None),
3882            Arch::LoongArch64 => (Architecture::LoongArch64, None),
3883            Arch::CSky => (Architecture::Csky, None),
3884            Arch::Arm64EC => (Architecture::Aarch64, Some(object::SubArchitecture::Arm64EC)),
3885            Arch::AmdGpu
3886            | Arch::Nvptx64
3887            | Arch::SpirV
3888            | Arch::Wasm32
3889            | Arch::Wasm64
3890            | Arch::Other(_) => return None,
3891        })
3892    }
3893
3894    /// Returns whether this target is known to have unreliable alignment:
3895    /// native C code for the target fails to align some data to the degree
3896    /// required by the C standard. We can't *really* do anything about that
3897    /// since unsafe Rust code may assume alignment any time, but we can at least
3898    /// inhibit some optimizations, and we suppress the alignment checks that
3899    /// would detect this unsoundness.
3900    ///
3901    /// Every target that returns less than `Align::MAX` here is still has a soundness bug.
3902    pub fn max_reliable_alignment(&self) -> Align {
3903        // FIXME(#112480) MSVC on x86-32 is unsound and fails to properly align many types with
3904        // more-than-4-byte-alignment on the stack. This makes alignments larger than 4 generally
3905        // unreliable on 32bit Windows.
3906        if self.is_like_windows && self.arch == Arch::X86 {
3907            Align::from_bytes(4).unwrap()
3908        } else {
3909            Align::MAX
3910        }
3911    }
3912
3913    pub fn vendor_symbol(&self) -> Symbol {
3914        Symbol::intern(&self.vendor)
3915    }
3916}