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