Repository: rust-lang/cc-rs
Pull request #1413 (2025-02-24 15:48:13)

Parse `rustc` target names
Parse target names instead of using a pre-generated list. Allows target names like those used by certain Linux distributions, even when compiling outside `build.rs`.

I feel fairly confident that the target parsing is complete, and that the parsing approach taken (described in the code, but roughly "parse arch, then env/ABI, then OS, and lastly vendor") is correct.
Unfortunately, since this information is now parsed instead of pre-generated, we cannot just update the information automatically with a PR. Instead, I've added a CI step that opens an issue comment in https://github.com/rust-lang/cc-rs/issues/1426 whenever a nightly `rustc` target names fails to parse correctly. This isn't as nice, but it's at least workable.

Note that ensuring we construct the same LLVM triples as `rustc` is a lot more work; I've started on it a little bit, but it will have to be postponed (it probably also requires a lot of tweaks to `rustc` to really be nice). So for now, I opted to keep a pre-generated list of `rustc` to LLVM triples.

Fixes https://github.com/rust-lang/cc-rs/issues/1297.
Fixes https://github.com/rust-lang/cc-rs/issues/1317.
Fixes https://github.com/rust-lang/cc-rs/issues/1405.
Fixes https://github.com/rust-lang/cc-rs/issues/1407.

NobodyXu: Hmmm the solution here is more complex than I'd imagined.

I was thinking of simply splitting target, and replace alpine/* with unknown if os is linux
madsmtm: > I was thinking of simply splitting target, and replace alpine/* with unknown if os is linux

Yeah, and [that approach](https://github.com/rust-lang/cc-rs/issues/1297#issuecomment-2505800183) _would_ solve the Alpine/Chimera issues, but won't solve the problem people have otherwise been having regarding Rust bootstrapping and custom/new targets, see https://github.com/rust-lang/rust/issues/137064 / https://github.com/rust-lang/rust/pull/137460 (bootstrap has downgraded to `cc v1.1.22` because of this, which breaks a lot of other things).

Personally, I'm still a little bit on the fence about this, it'd be _really_ nice if we could just only support upstream targets. But ultimately, I don't think that's a good decision for the Rust project as a whole.
madsmtm: WDYT @ChrisDenton? I get the feeling you're more in touch with other `rustc` devs than I, what's your general take?
madsmtm: For completeness, I'll note that there _are_ other options, I just dislike them even more than this:
- Bootstrap sets `TARGET`, `CARGO_CFG_TARGET_ARCH`, `CARGO_CFG_TARGET_VENDOR`, `CARGO_CFG_TARGET_OS`, `CARGO_CFG_TARGET_ENV` and `CARGO_CFG_TARGET_ABI` before invoking `cc`.
- We use the pre-generated list, and fall back to very simple "split into three/four parts, and assume `arch-vendor-os`/`arch-vendor-os-env`" if not available there.

NobodyXu: > but won't solve the problem people have otherwise been having regarding Rust bootstrapping and custom/new targets, see https://github.com/rust-lang/rust/issues/137064 / https://github.com/rust-lang/rust/pull/137460 (bootstrap has downgraded to `cc v1.1.22` because of this, which breaks a lot of other things).

I got it, but it feels like this PR has hard coded so many stuff and make maintaining harder

I still prefer some of the information to be generated from rustc or somewhere else instead of hardcoding everything, maybe we can modify gen-target-info to check env/abi etc for non-straight forward mappings and put them in a sorted array?
ChrisDenton: From a rustc perspective, we do want cc-rs to work with new/custom targets as well as possible. Though that doesn't necessarily mean accepting any arbitrary target string. There could be at least some rules if it helps.

Also there are perhaps some optimizations here.  How much of the target info do we actually use? I suspect we only care about the targets we have special cases for, e.g. `targert_os=="windows"` etc.

Discerning the llvm target is a bit trickier. Though I think in part it's made worse by rustc itself not always being consistent (or even accurate, particularly for tier 3 targets). That is something that could be improved on the rustc side.

I'd also add that llvm deals with parts of the triple it doesn't understand by replacing them with "unknown". I'm not sure if we can/should take advantage of that but I thought I should note it.
madsmtm: > I got it, but it feels like this PR has hard coded so many stuff and make maintaining harder

I don't like it either, but it really seems like the only option to me.

> I still prefer some of the information to be generated from rustc or somewhere else instead of hardcoding everything, maybe we can modify gen-target-info to check env/abi etc for non-straight forward mappings and put them in a sorted array?

Hmm, not a bad idea, though it wouldn't help to reduce the majority of the work here, it would only really help for [this part](https://github.com/rust-lang/cc-rs/blob/23ca474a4f029292ff2e684ef3884b8b047f4666/src/target/parser.rs#L316-L384) of the parsing (e.g. `parse_arch` is still necessary, as is `parse_envabi`).

The bigger problem is that "non-straight forward mappings" is hard to define, since the mapping isn't defined at all!

> From a rustc perspective, we do want cc-rs to work with new/custom targets as well as possible. Though that doesn't necessarily mean accepting any arbitrary target string. There could be at least some rules if it helps.

I doubt `cc-rs` has the sway to say no to a proposed target name, that's the purview of `t-compiler`, no? But yes, I'd _really_ like some rules for target names!

> Also there are perhaps some optimizations here. How much of the target info do we actually use? I suspect we only care about the targets we have special cases for, e.g. `targert_os=="windows"` etc.

Probably true, I think `target_env` isn't really used for anything other than on Windows (msvc/gnu) and for musl atm. But we'll likely need all the information to generate the right LLVM triple, and I suspect it'll be useful for the `CROSS_COMPILE` prefix too in the future.

> Discerning the llvm target is a bit trickier. Though I think in part it's made worse by rustc itself not always being consistent (or even accurate, particularly for tier 3 targets). That is something that could be improved on the rustc side.

Indeed, and I plan to do that in the future (but wanted to land this PR first).

ChrisDenton: > I doubt `cc-rs` has the sway to say no to a proposed target name, that's the purview of `t-compiler`, no? But yes, I'd really like some rules for target names!

It has as much sway as the rest of the project, The best thing would be to make an MCP (or maybe it'd require an RFC) to specify some constraints we'd want or otherwise define how to choose target tuples for new targets. Otherwise it would be a case of monitoring new target MCPs and raising objections if their naming isn't great (which would be more hassle at the end of the day).
madsmtm: CC @workingjubilee, you've been fairly involved with `rustc` target names. Could you verify my assumptions about the target names (and if you have time, look over the parsing code)?

Core assumptions about `rustc` target names:
- Each target name has 2, 3 or 4 components.
- 2-components names are of the format `arch-os`.
- 3-components names are of either the format `arch-vendor-os` or `arch-os-env+abi`.
  - To differentiate these, we inspect the last component, and try to parse the env/ABI - and if that fails, assume that the target is of the format `arch-vendor-os`.
  - I guess we could try to parse the OS instead, but the list of OSes is long and may be changed by custom toolchains, so that seems more likely to cause problems?
- 4-components names are of the format `arch-vendor-os-env+abi`.

madsmtm: Update: I've now filed https://github.com/rust-lang/compiler-team/issues/850, to try to make `rustc` target triples more consistent and easier to parse.

I'd still _prefer_ to not have to call out to separate processes to determine information like this, but I guess if we can avoid it in `build.rs`, I'd probably be okay with invoking `$RUSTC --print cfg --target $target` - for some reason I've been very convinced while making this issue that this wasn't an option, but now I don't see why it isn't, apart from performance? Maybe because it will require changes in bootstrap to make it correctly set `$RUSTC`, and other projects could similarly be slightly incorrect because they don't set that? Uncertain.

Regarding LLVM triples, Chris filed https://github.com/rust-lang/compiler-team/issues/846 to request a flag that we could use to get the triple. Meanwhile, I've begun the work of normalizing a few LLVM triples (see backlinks), to make them more consistent with `rustc`'s target information (I'd prefer that route, but it depends a bit on how consistent I can make the LLVM triples that `rustc` uses).
madsmtm: Cool. I've opened https://github.com/rust-lang/cc-rs/issues/1430 to discuss using `rustc --print cfg` instead, and https://github.com/rust-lang/cc-rs/issues/1431 to track the construction of LLVM triples.
madsmtm: I merged the changes from https://github.com/rust-lang/cc-rs/pull/1429, but I explicitly did not translate `wali` to `unknown`; this means that the `test-rustc-targets.yml` workflow will fail, which will give me a chance to test it (I will activate it manually after this is merged, and then file a follow-up PR that resolves the issue).

Patch:
diff --git a/dev-tools/gen-target-info/src/lib.rs b/dev-tools/gen-target-info/src/lib.rs
index 48bb555..ea4420a 100644
--- a/dev-tools/gen-target-info/src/lib.rs
+++ b/dev-tools/gen-target-info/src/lib.rs
@@ -3,6 +3,3 @@ pub use target_specs::*;
 
 mod read;
 pub use read::*;
-
-mod write;
-pub use write::*;
diff --git a/dev-tools/gen-target-info/src/main.rs b/dev-tools/gen-target-info/src/main.rs
index 383d292..b7f8dad 100644
--- a/dev-tools/gen-target-info/src/main.rs
+++ b/dev-tools/gen-target-info/src/main.rs
@@ -5,76 +5,18 @@ use gen_target_info::{
     get_target_spec_from_msrv, get_target_specs_from_json, get_targets_msrv, RustcTargetSpecs,
 };
 
-const PRELUDE: &str = r#"//! This file is generated code. Please edit the generator
-//! in dev-tools/gen-target-info if you need to make changes.
+const PRELUDE: &str = r#"//! This file is generated code. Please edit the generator in
+//! dev-tools/gen-target-info if you need to make changes, or see
+//! src/target/llvm.rs if you need to configure a specific LLVM triple.
 
 "#;
 
 fn generate_target_mapping(f: &mut File, target_specs: &RustcTargetSpecs) -> std::io::Result<()> {
-    writeln!(f, "use super::TargetInfo;")?;
-    writeln!(f)?;
-    writeln!(
-        f,
-        "pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &["
-    )?;
+    writeln!(f, "#[rustfmt::skip]")?;
+    writeln!(f, "pub(crate) const LLVM_TARGETS: &[(&str, &str)] = &[")?;
 
-    for (triple, spec) in &target_specs.0 {
-        let full_arch = triple.split_once('-').unwrap().0;
-        let arch = &spec.arch;
-        let vendor = spec.vendor.as_deref().unwrap_or("unknown");
-        let os = spec.os.as_deref().unwrap_or("none");
-        let env = spec.env.as_deref().unwrap_or("");
-        let abi = spec.abi.as_deref().unwrap_or("");
-
-        // FIXME(madsmtm): Unnecessary once we bump MSRV to Rust 1.74
-        let llvm_target = if spec.llvm_target == "armv7-apple-ios7.0.0" {
-            "armv7-apple-ios".to_string()
-        } else if os == "uefi" {
-            // Override the UEFI LLVM targets.
-            //
-            // The rustc mappings (as of 1.82) for the UEFI targets are:
-            // * i686-unknown-uefi -> i686-unknown-windows-gnu
-            // * x86_64-unknown-uefi -> x86_64-unknown-windows
-            // * aarch64-unknown-uefi -> aarch64-unknown-windows
-            //
-            // However, in cc-rs all the UEFI targets use
-            // -windows-gnu. This has been the case since 2021 [1].
-            // * i686-unknown-uefi -> i686-unknown-windows-gnu
-            // * x86_64-unknown-uefi -> x86_64-unknown-windows-gnu
-            // * aarch64-unknown-uefi -> aarch64-unknown-windows-gnu
-            //
-            // For now, override the UEFI mapping to keep the behavior
-            // of cc-rs unchanged.
-            //
-            // TODO: as discussed in [2], it may be possible to switch
-            // to new UEFI targets added to clang, and regardless it
-            // would be good to have consistency between rustc and
-            // cc-rs.
-            //
-            // [1]: https://github.com/rust-lang/cc-rs/pull/623
-            // [2]: https://github.com/rust-lang/cc-rs/pull/1264
-            let arch = if spec.arch == "x86" {
-                "i686"
-            } else {
-                &spec.arch
-            };
-            format!("{}-unknown-windows-gnu", arch)
-        } else {
-            spec.llvm_target.clone()
-        };
-
-        writeln!(f, "    (")?;
-        writeln!(f, "        {triple:?},")?;
-        writeln!(f, "        TargetInfo {{")?;
-        writeln!(f, "            full_arch: {full_arch:?},")?;
-        writeln!(f, "            arch: {arch:?},")?;
-        writeln!(f, "            vendor: {vendor:?},")?;
-        writeln!(f, "            os: {os:?},")?;
-        writeln!(f, "            env: {env:?},")?;
-        writeln!(f, "            abi: {abi:?},")?;
-        writeln!(f, "            llvm_target: {llvm_target:?},")?;
-        writeln!(f, "        }},")?;
-        writeln!(f, "    ),")?;
+    for (target_name, spec) in &target_specs.0 {
+        writeln!(f, "    ({target_name:?}, {:?}),", spec.llvm_target)?;
     }
 
     writeln!(f, "];")?;
@@ -92,13 +34,13 @@ fn main() {
         .unwrap()
         != 0
     {
-        for target_triple in get_targets_msrv().lines() {
-            let target_triple = target_triple.unwrap();
-            let target_triple = target_triple.trim();
+        for target_name in get_targets_msrv().lines() {
+            let target_name = target_name.unwrap();
+            let target_name = target_name.trim();
             target_specs
                 .0
-                .entry(target_triple.to_string())
-                .or_insert_with(|| get_target_spec_from_msrv(target_triple));
+                .entry(target_name.to_string())
+                .or_insert_with(|| get_target_spec_from_msrv(target_name));
         }
     }
 
diff --git a/dev-tools/gen-target-info/src/write.rs b/dev-tools/gen-target-info/src/write.rs
deleted file mode 100644
index 5ea545e..0000000
--- a/dev-tools/gen-target-info/src/write.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-use std::{collections::BTreeMap, fmt::Write as _, fs, io::Write as _};
-
-pub fn write_target_tuple_mapping(
-    f: &mut fs::File,
-    variable_name: &str,
-    data: &BTreeMap<&str, &str>,
-) {
-    let mut content = format!("pub const {variable_name}: &[(&str, &str)] = &[\n");
-
-    for (f1, f2) in data {
-        write!(&mut content, r#"    ("{f1}", "{f2}"),"#).unwrap();
-        content.push('\n');
-    }
-
-    content.push_str("];\n");
-
-    f.write_all(content.as_bytes()).unwrap();
-}
diff --git a/src/lib.rs b/src/lib.rs
index e5c3d44..c259a07 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -145,11 +145,11 @@
 //!
 //! * Unix platforms require `cc` to be the C compiler. This can be found by
 //!   installing cc/clang on Linux distributions and Xcode on macOS, for example.
-//! * Windows platforms targeting MSVC (e.g. your target triple ends in `-msvc`)
+//! * Windows platforms targeting MSVC (e.g. your target name ends in `-msvc`)
 //!   require Visual Studio to be installed. `cc-rs` attempts to locate it, and
 //!   if it fails, `cl.exe` is expected to be available in `PATH`. This can be
 //!   set up by running the appropriate developer tools shell.
-//! * Windows platforms targeting MinGW (e.g. your target triple ends in `-gnu`)
+//! * Windows platforms targeting MinGW (e.g. your target name ends in `-gnu`)
 //!   require `cc` to be available in `PATH`. We recommend the
 //!   [MinGW-w64](https://www.mingw-w64.org/) distribution.
 //!   You may also acquire it via
@@ -2177,9 +2177,9 @@ impl Build {
                         //   libstdc++ (this behavior was changed in llvm 14).
                         //
                         // This breaks C++11 (or greater) builds if targeting FreeBSD with the
-                        // generic xxx-unknown-freebsd triple on clang 13 or below *without*
+                        // generic xxx-unknown-freebsd target on clang 13 or below *without*
                         // explicitly specifying that libc++ should be used.
-                        // When cross-compiling, we can't infer from the rust/cargo target triple
+                        // When cross-compiling, we can't infer from the rust/cargo target name
                         // which major version of FreeBSD we are targeting, so we need to make sure
                         // that libc++ is used (unless the user has explicitly specified otherwise).
                         // There's no compelling reason to use a different approach when compiling
@@ -2227,14 +2227,14 @@ impl Build {
                     // So instead, we pass the deployment target with `-m*-version-min=`, and only
                     // pass it here on visionOS and Mac Catalyst where that option does not exist:
                     // https://github.com/rust-lang/cc-rs/issues/1383
-                    let clang_target = if target.os == "visionos" || target.abi == "macabi" {
-                        Cow::Owned(
-                            target.versioned_llvm_target(&self.apple_deployment_target(target)),
-                        )
+                    let version = if target.os == "visionos" || target.abi == "macabi" {
+                        Some(self.apple_deployment_target(target))
                     } else {
-                        Cow::Borrowed(target.llvm_target)
+                        None
                     };
 
+                    let clang_target =
+                        target.llvm_target(&self.get_raw_target()?, version.as_deref());
                     cmd.push_cc_arg(format!("--target={clang_target}").into());
                 }
             }
@@ -2260,7 +2260,13 @@ impl Build {
                         // <https://github.com/microsoft/STL/pull/4741>.
                         cmd.push_cc_arg("-arch:SSE2".into());
                     } else {
-                        cmd.push_cc_arg(format!("--target={}", target.llvm_target).into());
+                        cmd.push_cc_arg(
+                            format!(
+                                "--target={}",
+                                target.llvm_target(&self.get_raw_target()?, None)
+                            )
+                            .into(),
+                        );
                     }
                 } else if target.full_arch == "i586" {
                     cmd.push_cc_arg("-arch:IA32".into());
@@ -3545,7 +3551,9 @@ impl Build {
 
     fn get_target(&self) -> Result<TargetInfo<'_>, Error> {
         match &self.target {
-            Some(t) if Some(&**t) != self.getenv_unwrap_str("TARGET").ok().as_deref() => t.parse(),
+            Some(t) if Some(&**t) != self.getenv_unwrap_str("TARGET").ok().as_deref() => {
+                TargetInfo::from_rustc_target(t)
+            }
             // Fetch target information from environment if not set, or if the
             // target was the same as the TARGET environment variable, in
             // case the user did `build.target(&env::var("TARGET").unwrap())`.
diff --git a/src/target.rs b/src/target.rs
index 3d6cb91..ed432df 100644
--- a/src/target.rs
+++ b/src/target.rs
@@ -1,10 +1,5 @@
-//! Very basic parsing of `rustc` target triples.
-//!
-//! See the `target-lexicon` crate for a more principled approach to this.
-
-use std::str::FromStr;
-
-use crate::{Error, ErrorKind};
+//! Parsing of `rustc` target names to match the values exposed to Cargo
+//! build scripts (`CARGO_CFG_*`).
 
 mod apple;
 mod generated;
@@ -43,90 +38,4 @@ pub(crate) struct TargetInfo<'a> {
     ///
     /// This is the same as the value of `cfg!(target_abi)`.
     pub abi: &'a str,
-    /// The unversioned LLVM/Clang target triple.
-    ///
-    /// NOTE: You should never need to match on this explicitly, use the other
-    /// fields on [`TargetInfo`] instead.
-    pub llvm_target: &'a str,
-}
-
-impl FromStr for TargetInfo<'_> {
-    type Err = Error;
-
-    /// This will fail when using a custom target triple unknown to `rustc`.
-    fn from_str(target_triple: &str) -> Result<Self, Error> {
-        if let Ok(index) =
-            generated::LIST.binary_search_by_key(&target_triple, |(target_triple, _)| target_triple)
-        {
-            let (_, info) = &generated::LIST[index];
-            Ok(info.clone())
-        } else {
-            Err(Error::new(
-                ErrorKind::UnknownTarget,
-                format!(
-                    "unknown target `{target_triple}`.
-
-NOTE: `cc-rs` only supports a fixed set of targets when not in a build script.
-- If adding a new target, you will need to fork of `cc-rs` until the target
-  has landed on nightly and the auto-generated list has been updated. See also
-  the `rustc` dev guide on adding a new target:
-  https://rustc-dev-guide.rust-lang.org/building/new-target.html
-- If using a custom target, prefer to upstream it to `rustc` if possible,
-  otherwise open an issue with `cc-rs`:
-  https://github.com/rust-lang/cc-rs/issues/new
-"
-                ),
-            ))
-        }
-    }
-}
-
-#[cfg(test)]
-mod tests {
-    use std::str::FromStr;
-
-    use super::TargetInfo;
-
-    // Test tier 1 targets
-    #[test]
-    fn tier1() {
-        let targets = [
-            "aarch64-unknown-linux-gnu",
-            "aarch64-apple-darwin",
-            "i686-pc-windows-gnu",
-            "i686-pc-windows-msvc",
-            "i686-unknown-linux-gnu",
-            "x86_64-apple-darwin",
-            "x86_64-pc-windows-gnu",
-            "x86_64-pc-windows-msvc",
-            "x86_64-unknown-linux-gnu",
-        ];
-
-        for target in targets {
-            // Check that it parses
-            let _ = TargetInfo::from_str(target).unwrap();
-        }
-    }
-
-    // Various custom target triples not (or no longer) known by `rustc`
-    #[test]
-    fn cannot_parse_extra() {
-        let targets = [
-            "aarch64-unknown-none-gnu",
-            "aarch64-uwp-windows-gnu",
-            "arm-frc-linux-gnueabi",
-            "arm-unknown-netbsd-eabi",
-            "armv7neon-unknown-linux-gnueabihf",
-            "armv7neon-unknown-linux-musleabihf",
-            "thumbv7-unknown-linux-gnueabihf",
-            "thumbv7-unknown-linux-musleabihf",
-            "x86_64-rumprun-netbsd",
-            "x86_64-unknown-linux",
-        ];
-
-        for target in targets {
-            // Check that it does not parse
-            let _ = TargetInfo::from_str(target).unwrap_err();
-        }
-    }
 }
diff --git a/src/target/generated.rs b/src/target/generated.rs
index f7ae82d..57781f7 100644
--- a/src/target/generated.rs
+++ b/src/target/generated.rs
@@ -1,3559 +1,303 @@
-//! This file is generated code. Please edit the generator
-//! in dev-tools/gen-target-info if you need to make changes.
+//! This file is generated code. Please edit the generator in
+//! dev-tools/gen-target-info if you need to make changes, or see
+//! src/target/llvm.rs if you need to configure a specific LLVM triple.
 
-use super::TargetInfo;
-
-pub(crate) const LIST: &[(&str, TargetInfo<'static>)] = &[
-    (
-        "aarch64-apple-darwin",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "macos",
-            env: "",
-            abi: "",
-            llvm_target: "arm64-apple-macosx",
-        },
-    ),
-    (
-        "aarch64-apple-ios",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "",
-            llvm_target: "arm64-apple-ios",
-        },
-    ),
-    (
-        "aarch64-apple-ios-macabi",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "macabi",
-            llvm_target: "arm64-apple-ios-macabi",
-        },
-    ),
-    (
-        "aarch64-apple-ios-sim",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "sim",
-            llvm_target: "arm64-apple-ios-simulator",
-        },
-    ),
-    (
-        "aarch64-apple-tvos",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "tvos",
-            env: "",
-            abi: "",
-            llvm_target: "arm64-apple-tvos",
-        },
-    ),
-    (
-        "aarch64-apple-tvos-sim",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "tvos",
-            env: "",
-            abi: "sim",
-            llvm_target: "arm64-apple-tvos-simulator",
-        },
-    ),
-    (
-        "aarch64-apple-visionos",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "visionos",
-            env: "",
-            abi: "",
-            llvm_target: "arm64-apple-xros",
-        },
-    ),
-    (
-        "aarch64-apple-visionos-sim",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "visionos",
-            env: "",
-            abi: "sim",
-            llvm_target: "arm64-apple-xros-simulator",
-        },
-    ),
-    (
-        "aarch64-apple-watchos",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "watchos",
-            env: "",
-            abi: "",
-            llvm_target: "arm64-apple-watchos",
-        },
-    ),
-    (
-        "aarch64-apple-watchos-sim",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "watchos",
-            env: "",
-            abi: "sim",
-            llvm_target: "arm64-apple-watchos-simulator",
-        },
-    ),
-    (
-        "aarch64-fuchsia",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "fuchsia",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-fuchsia",
-        },
-    ),
-    (
-        "aarch64-kmc-solid_asp3",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "kmc",
-            os: "solid_asp3",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-none",
-        },
-    ),
-    (
-        "aarch64-linux-android",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "android",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-linux-android",
-        },
-    ),
-    (
-        "aarch64-nintendo-switch-freestanding",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "nintendo",
-            os: "horizon",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-none",
-        },
-    ),
-    (
-        "aarch64-pc-windows-gnullvm",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "pc",
-            os: "windows",
-            env: "gnu",
-            abi: "llvm",
-            llvm_target: "aarch64-pc-windows-gnu",
-        },
-    ),
-    (
-        "aarch64-pc-windows-msvc",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "pc",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "aarch64-pc-windows-msvc",
-        },
-    ),
-    (
-        "aarch64-unknown-freebsd",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-freebsd",
-        },
-    ),
-    (
-        "aarch64-unknown-fuchsia",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "fuchsia",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-fuchsia",
-        },
-    ),
-    (
-        "aarch64-unknown-hermit",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "hermit",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-hermit",
-        },
-    ),
-    (
-        "aarch64-unknown-illumos",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "illumos",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-solaris2.11",
-        },
-    ),
-    (
-        "aarch64-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "aarch64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "aarch64-unknown-linux-gnu_ilp32",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "ilp32",
-            llvm_target: "aarch64-unknown-linux-gnu_ilp32",
-        },
-    ),
-    (
-        "aarch64-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "aarch64-unknown-linux-musl",
-        },
-    ),
-    (
-        "aarch64-unknown-linux-ohos",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "ohos",
-            abi: "",
-            llvm_target: "aarch64-unknown-linux-ohos",
-        },
-    ),
-    (
-        "aarch64-unknown-netbsd",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-netbsd",
-        },
-    ),
-    (
-        "aarch64-unknown-none",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-none",
-        },
-    ),
-    (
-        "aarch64-unknown-none-softfloat",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "softfloat",
-            llvm_target: "aarch64-unknown-none",
-        },
-    ),
-    (
-        "aarch64-unknown-nto-qnx700",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "nto",
-            env: "nto70",
-            abi: "",
-            llvm_target: "aarch64-unknown-unknown",
-        },
-    ),
-    (
-        "aarch64-unknown-nto-qnx710",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "nto",
-            env: "nto71",
-            abi: "",
-            llvm_target: "aarch64-unknown-unknown",
-        },
-    ),
-    (
-        "aarch64-unknown-nto-qnx710_iosock",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "nto",
-            env: "nto71_iosock",
-            abi: "",
-            llvm_target: "aarch64-unknown-unknown",
-        },
-    ),
-    (
-        "aarch64-unknown-nto-qnx800",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "nto",
-            env: "nto80",
-            abi: "",
-            llvm_target: "aarch64-unknown-unknown",
-        },
-    ),
-    (
-        "aarch64-unknown-nuttx",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-none",
-        },
-    ),
-    (
-        "aarch64-unknown-openbsd",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "openbsd",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-openbsd",
-        },
-    ),
-    (
-        "aarch64-unknown-redox",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "redox",
-            env: "relibc",
-            abi: "",
-            llvm_target: "aarch64-unknown-redox",
-        },
-    ),
-    (
-        "aarch64-unknown-teeos",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "teeos",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-none",
-        },
-    ),
-    (
-        "aarch64-unknown-trusty",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "trusty",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-unknown-musl",
-        },
-    ),
-    (
-        "aarch64-unknown-uefi",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "uefi",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64-unknown-windows-gnu",
-        },
-    ),
-    (
-        "aarch64-uwp-windows-msvc",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "uwp",
-            os: "windows",
-            env: "msvc",
-            abi: "uwp",
-            llvm_target: "aarch64-pc-windows-msvc",
-        },
-    ),
-    (
-        "aarch64-wrs-vxworks",
-        TargetInfo {
-            full_arch: "aarch64",
-            arch: "aarch64",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "",
-            llvm_target: "aarch64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "aarch64_be-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "aarch64_be",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "aarch64_be-unknown-linux-gnu",
-        },
-    ),
-    (
-        "aarch64_be-unknown-linux-gnu_ilp32",
-        TargetInfo {
-            full_arch: "aarch64_be",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "ilp32",
-            llvm_target: "aarch64_be-unknown-linux-gnu_ilp32",
-        },
-    ),
-    (
-        "aarch64_be-unknown-netbsd",
-        TargetInfo {
-            full_arch: "aarch64_be",
-            arch: "aarch64",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "aarch64_be-unknown-netbsd",
-        },
-    ),
-    (
-        "amdgcn-amd-amdhsa",
-        TargetInfo {
-            full_arch: "amdgcn",
-            arch: "amdgpu",
-            vendor: "amd",
-            os: "amdhsa",
-            env: "",
-            abi: "",
-            llvm_target: "amdgcn-amd-amdhsa",
-        },
-    ),
-    (
-        "arm-linux-androideabi",
-        TargetInfo {
-            full_arch: "arm",
-            arch: "arm",
-            vendor: "unknown",
-            os: "android",
-            env: "",
-            abi: "eabi",
-            llvm_target: "arm-linux-androideabi",
-        },
-    ),
-    (
-        "arm-unknown-linux-gnueabi",
-        TargetInfo {
-            full_arch: "arm",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabi",
-            llvm_target: "arm-unknown-linux-gnueabi",
-        },
-    ),
-    (
-        "arm-unknown-linux-gnueabihf",
-        TargetInfo {
-            full_arch: "arm",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabihf",
-            llvm_target: "arm-unknown-linux-gnueabihf",
-        },
-    ),
-    (
-        "arm-unknown-linux-musleabi",
-        TargetInfo {
-            full_arch: "arm",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "eabi",
-            llvm_target: "arm-unknown-linux-musleabi",
-        },
-    ),
-    (
-        "arm-unknown-linux-musleabihf",
-        TargetInfo {
-            full_arch: "arm",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "eabihf",
-            llvm_target: "arm-unknown-linux-musleabihf",
-        },
-    ),
-    (
-        "arm64_32-apple-watchos",
-        TargetInfo {
-            full_arch: "arm64_32",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "watchos",
-            env: "",
-            abi: "",
-            llvm_target: "arm64_32-apple-watchos",
-        },
-    ),
-    (
-        "arm64e-apple-darwin",
-        TargetInfo {
-            full_arch: "arm64e",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "macos",
-            env: "",
-            abi: "",
-            llvm_target: "arm64e-apple-macosx",
-        },
-    ),
-    (
-        "arm64e-apple-ios",
-        TargetInfo {
-            full_arch: "arm64e",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "",
-            llvm_target: "arm64e-apple-ios",
-        },
-    ),
-    (
-        "arm64e-apple-tvos",
-        TargetInfo {
-            full_arch: "arm64e",
-            arch: "aarch64",
-            vendor: "apple",
-            os: "tvos",
-            env: "",
-            abi: "",
-            llvm_target: "arm64e-apple-tvos",
-        },
-    ),
-    (
-        "arm64ec-pc-windows-msvc",
-        TargetInfo {
-            full_arch: "arm64ec",
-            arch: "arm64ec",
-            vendor: "pc",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "arm64ec-pc-windows-msvc",
-        },
-    ),
-    (
-        "armeb-unknown-linux-gnueabi",
-        TargetInfo {
-            full_arch: "armeb",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabi",
-            llvm_target: "armeb-unknown-linux-gnueabi",
-        },
-    ),
-    (
-        "armebv7r-none-eabi",
-        TargetInfo {
-            full_arch: "armebv7r",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armebv7r-none-eabi",
-        },
-    ),
-    (
-        "armebv7r-none-eabihf",
-        TargetInfo {
-            full_arch: "armebv7r",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armebv7r-none-eabihf",
-        },
-    ),
-    (
-        "armv4t-none-eabi",
-        TargetInfo {
-            full_arch: "armv4t",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv4t-none-eabi",
-        },
-    ),
-    (
-        "armv4t-unknown-linux-gnueabi",
-        TargetInfo {
-            full_arch: "armv4t",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabi",
-            llvm_target: "armv4t-unknown-linux-gnueabi",
-        },
-    ),
-    (
-        "armv5te-none-eabi",
-        TargetInfo {
-            full_arch: "armv5te",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv5te-none-eabi",
-        },
-    ),
-    (
-        "armv5te-unknown-linux-gnueabi",
-        TargetInfo {
-            full_arch: "armv5te",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabi",
-            llvm_target: "armv5te-unknown-linux-gnueabi",
-        },
-    ),
-    (
-        "armv5te-unknown-linux-musleabi",
-        TargetInfo {
-            full_arch: "armv5te",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "eabi",
-            llvm_target: "armv5te-unknown-linux-musleabi",
-        },
-    ),
-    (
-        "armv5te-unknown-linux-uclibceabi",
-        TargetInfo {
-            full_arch: "armv5te",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "uclibc",
-            abi: "eabi",
-            llvm_target: "armv5te-unknown-linux-uclibcgnueabi",
-        },
-    ),
-    (
-        "armv6-unknown-freebsd",
-        TargetInfo {
-            full_arch: "armv6",
-            arch: "arm",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv6-unknown-freebsd-gnueabihf",
-        },
-    ),
-    (
-        "armv6-unknown-netbsd-eabihf",
-        TargetInfo {
-            full_arch: "armv6",
-            arch: "arm",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv6-unknown-netbsdelf-eabihf",
-        },
-    ),
-    (
-        "armv6k-nintendo-3ds",
-        TargetInfo {
-            full_arch: "armv6k",
-            arch: "arm",
-            vendor: "nintendo",
-            os: "horizon",
-            env: "newlib",
-            abi: "eabihf",
-            llvm_target: "armv6k-none-eabihf",
-        },
-    ),
-    (
-        "armv7-apple-ios",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "",
-            llvm_target: "armv7-apple-ios",
-        },
-    ),
-    (
-        "armv7-linux-androideabi",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "android",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv7-none-linux-android",
-        },
-    ),
-    (
-        "armv7-rtems-eabihf",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "rtems",
-            env: "newlib",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-none-eabihf",
-        },
-    ),
-    (
-        "armv7-sony-vita-newlibeabihf",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "sony",
-            os: "vita",
-            env: "newlib",
-            abi: "eabihf",
-            llvm_target: "thumbv7a-vita-eabihf",
-        },
-    ),
-    (
-        "armv7-unknown-freebsd",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-freebsd-gnueabihf",
-        },
-    ),
-    (
-        "armv7-unknown-linux-gnueabi",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabi",
-            llvm_target: "armv7-unknown-linux-gnueabi",
-        },
-    ),
-    (
-        "armv7-unknown-linux-gnueabihf",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-linux-gnueabihf",
-        },
-    ),
-    (
-        "armv7-unknown-linux-musleabi",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "eabi",
-            llvm_target: "armv7-unknown-linux-musleabi",
-        },
-    ),
-    (
-        "armv7-unknown-linux-musleabihf",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-linux-musleabihf",
-        },
-    ),
-    (
-        "armv7-unknown-linux-ohos",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "ohos",
-            abi: "eabi",
-            llvm_target: "armv7-unknown-linux-ohos",
-        },
-    ),
-    (
-        "armv7-unknown-linux-uclibceabi",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "uclibc",
-            abi: "eabi",
-            llvm_target: "armv7-unknown-linux-gnueabi",
-        },
-    ),
-    (
-        "armv7-unknown-linux-uclibceabihf",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "uclibc",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-linux-gnueabihf",
-        },
-    ),
-    (
-        "armv7-unknown-netbsd-eabihf",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-netbsdelf-eabihf",
-        },
-    ),
-    (
-        "armv7-unknown-trusty",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "unknown",
-            os: "trusty",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv7-unknown-unknown-gnueabi",
-        },
-    ),
-    (
-        "armv7-wrs-vxworks-eabihf",
-        TargetInfo {
-            full_arch: "armv7",
-            arch: "arm",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-linux-gnueabihf",
-        },
-    ),
-    (
-        "armv7a-kmc-solid_asp3-eabi",
-        TargetInfo {
-            full_arch: "armv7a",
-            arch: "arm",
-            vendor: "kmc",
-            os: "solid_asp3",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv7a-none-eabi",
-        },
-    ),
-    (
-        "armv7a-kmc-solid_asp3-eabihf",
-        TargetInfo {
-            full_arch: "armv7a",
-            arch: "arm",
-            vendor: "kmc",
-            os: "solid_asp3",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv7a-none-eabihf",
-        },
-    ),
-    (
-        "armv7a-none-eabi",
-        TargetInfo {
-            full_arch: "armv7a",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv7a-none-eabi",
-        },
-    ),
-    (
-        "armv7a-none-eabihf",
-        TargetInfo {
-            full_arch: "armv7a",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv7a-none-eabihf",
-        },
-    ),
-    (
-        "armv7a-nuttx-eabi",
-        TargetInfo {
-            full_arch: "armv7a",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv7a-none-eabi",
-        },
-    ),
-    (
-        "armv7a-nuttx-eabihf",
-        TargetInfo {
-            full_arch: "armv7a",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv7a-none-eabihf",
-        },
-    ),
-    (
-        "armv7k-apple-watchos",
-        TargetInfo {
-            full_arch: "armv7k",
-            arch: "arm",
-            vendor: "apple",
-            os: "watchos",
-            env: "",
-            abi: "",
-            llvm_target: "armv7k-apple-watchos",
-        },
-    ),
-    (
-        "armv7r-none-eabi",
-        TargetInfo {
-            full_arch: "armv7r",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv7r-none-eabi",
-        },
-    ),
-    (
-        "armv7r-none-eabihf",
-        TargetInfo {
-            full_arch: "armv7r",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv7r-none-eabihf",
-        },
-    ),
-    (
-        "armv7s-apple-ios",
-        TargetInfo {
-            full_arch: "armv7s",
-            arch: "arm",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "",
-            llvm_target: "armv7s-apple-ios",
-        },
-    ),
-    (
-        "armv8r-none-eabihf",
-        TargetInfo {
-            full_arch: "armv8r",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "armv8r-none-eabihf",
-        },
-    ),
-    (
-        "asmjs-unknown-emscripten",
-        TargetInfo {
-            full_arch: "asmjs",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "emscripten",
-            env: "",
-            abi: "",
-            llvm_target: "wasm32-unknown-emscripten",
-        },
-    ),
-    (
-        "avr-none",
-        TargetInfo {
-            full_arch: "avr",
-            arch: "avr",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "avr-unknown-unknown",
-        },
-    ),
-    (
-        "avr-unknown-gnu-atmega328",
-        TargetInfo {
-            full_arch: "avr",
-            arch: "avr",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "avr-unknown-unknown",
-        },
-    ),
-    (
-        "bpfeb-unknown-none",
-        TargetInfo {
-            full_arch: "bpfeb",
-            arch: "bpf",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "bpfeb",
-        },
-    ),
-    (
-        "bpfel-unknown-none",
-        TargetInfo {
-            full_arch: "bpfel",
-            arch: "bpf",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "bpfel",
-        },
-    ),
-    (
-        "csky-unknown-linux-gnuabiv2",
-        TargetInfo {
-            full_arch: "csky",
-            arch: "csky",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "abiv2",
-            llvm_target: "csky-unknown-linux-gnuabiv2",
-        },
-    ),
-    (
-        "csky-unknown-linux-gnuabiv2hf",
-        TargetInfo {
-            full_arch: "csky",
-            arch: "csky",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "abiv2hf",
-            llvm_target: "csky-unknown-linux-gnuabiv2",
-        },
-    ),
-    (
-        "hexagon-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "hexagon",
-            arch: "hexagon",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "hexagon-unknown-linux-musl",
-        },
-    ),
-    (
-        "hexagon-unknown-none-elf",
-        TargetInfo {
-            full_arch: "hexagon",
-            arch: "hexagon",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "hexagon-unknown-none-elf",
-        },
-    ),
-    (
-        "i386-apple-ios",
-        TargetInfo {
-            full_arch: "i386",
-            arch: "x86",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "sim",
-            llvm_target: "i386-apple-ios-simulator",
-        },
-    ),
-    (
-        "i586-pc-windows-msvc",
-        TargetInfo {
-            full_arch: "i586",
-            arch: "x86",
-            vendor: "pc",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "i586-pc-windows-msvc",
-        },
-    ),
-    (
-        "i586-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "i586",
-            arch: "x86",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "i586-unknown-linux-gnu",
-        },
-    ),
-    (
-        "i586-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "i586",
-            arch: "x86",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "i586-unknown-linux-musl",
-        },
-    ),
-    (
-        "i586-unknown-netbsd",
-        TargetInfo {
-            full_arch: "i586",
-            arch: "x86",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "i586-unknown-netbsdelf",
-        },
-    ),
-    (
-        "i586-unknown-redox",
-        TargetInfo {
-            full_arch: "i586",
-            arch: "x86",
-            vendor: "unknown",
-            os: "redox",
-            env: "relibc",
-            abi: "",
-            llvm_target: "i586-unknown-redox",
-        },
-    ),
-    (
-        "i686-apple-darwin",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "apple",
-            os: "macos",
-            env: "",
-            abi: "",
-            llvm_target: "i686-apple-macosx",
-        },
-    ),
-    (
-        "i686-linux-android",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "android",
-            env: "",
-            abi: "",
-            llvm_target: "i686-linux-android",
-        },
-    ),
-    (
-        "i686-pc-nto-qnx700",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "pc",
-            os: "nto",
-            env: "nto70",
-            abi: "",
-            llvm_target: "i586-pc-unknown",
-        },
-    ),
-    (
-        "i686-pc-windows-gnu",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "pc",
-            os: "windows",
-            env: "gnu",
-            abi: "",
-            llvm_target: "i686-pc-windows-gnu",
-        },
-    ),
-    (
-        "i686-pc-windows-gnullvm",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "pc",
-            os: "windows",
-            env: "gnu",
-            abi: "llvm",
-            llvm_target: "i686-pc-windows-gnu",
-        },
-    ),
-    (
-        "i686-pc-windows-msvc",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "pc",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "i686-pc-windows-msvc",
-        },
-    ),
-    (
-        "i686-unknown-freebsd",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "",
-            llvm_target: "i686-unknown-freebsd",
-        },
-    ),
-    (
-        "i686-unknown-haiku",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "haiku",
-            env: "",
-            abi: "",
-            llvm_target: "i686-unknown-haiku",
-        },
-    ),
-    (
-        "i686-unknown-hurd-gnu",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "hurd",
-            env: "gnu",
-            abi: "",
-            llvm_target: "i686-unknown-hurd-gnu",
-        },
-    ),
-    (
-        "i686-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "i686-unknown-linux-gnu",
-        },
-    ),
-    (
-        "i686-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "i686-unknown-linux-musl",
-        },
-    ),
-    (
-        "i686-unknown-netbsd",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "i686-unknown-netbsdelf",
-        },
-    ),
-    (
-        "i686-unknown-openbsd",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "openbsd",
-            env: "",
-            abi: "",
-            llvm_target: "i686-unknown-openbsd",
-        },
-    ),
-    (
-        "i686-unknown-uefi",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "unknown",
-            os: "uefi",
-            env: "",
-            abi: "",
-            llvm_target: "i686-unknown-windows-gnu",
-        },
-    ),
-    (
-        "i686-uwp-windows-gnu",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "uwp",
-            os: "windows",
-            env: "gnu",
-            abi: "uwp",
-            llvm_target: "i686-pc-windows-gnu",
-        },
-    ),
-    (
-        "i686-uwp-windows-msvc",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "uwp",
-            os: "windows",
-            env: "msvc",
-            abi: "uwp",
-            llvm_target: "i686-pc-windows-msvc",
-        },
-    ),
-    (
-        "i686-win7-windows-gnu",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "win7",
-            os: "windows",
-            env: "gnu",
-            abi: "",
-            llvm_target: "i686-pc-windows-gnu",
-        },
-    ),
-    (
-        "i686-win7-windows-msvc",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "win7",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "i686-pc-windows-msvc",
-        },
-    ),
-    (
-        "i686-wrs-vxworks",
-        TargetInfo {
-            full_arch: "i686",
-            arch: "x86",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "",
-            llvm_target: "i686-unknown-linux-gnu",
-        },
-    ),
-    (
-        "loongarch64-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "loongarch64",
-            arch: "loongarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "loongarch64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "loongarch64-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "loongarch64",
-            arch: "loongarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "loongarch64-unknown-linux-musl",
-        },
-    ),
-    (
-        "loongarch64-unknown-linux-ohos",
-        TargetInfo {
-            full_arch: "loongarch64",
-            arch: "loongarch64",
-            vendor: "unknown",
-            os: "linux",
-            env: "ohos",
-            abi: "",
-            llvm_target: "loongarch64-unknown-linux-ohos",
-        },
-    ),
-    (
-        "loongarch64-unknown-none",
-        TargetInfo {
-            full_arch: "loongarch64",
-            arch: "loongarch64",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "loongarch64-unknown-none",
-        },
-    ),
-    (
-        "loongarch64-unknown-none-softfloat",
-        TargetInfo {
-            full_arch: "loongarch64",
-            arch: "loongarch64",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "softfloat",
-            llvm_target: "loongarch64-unknown-none",
-        },
-    ),
-    (
-        "m68k-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "m68k",
-            arch: "m68k",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "m68k-unknown-linux-gnu",
-        },
-    ),
-    (
-        "m68k-unknown-none-elf",
-        TargetInfo {
-            full_arch: "m68k",
-            arch: "m68k",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "m68k",
-        },
-    ),
-    (
-        "mips-mti-none-elf",
-        TargetInfo {
-            full_arch: "mips",
-            arch: "mips",
-            vendor: "mti",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "mips",
-        },
-    ),
-    (
-        "mips-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "mips",
-            arch: "mips",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "mips-unknown-linux-gnu",
-        },
-    ),
-    (
-        "mips-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "mips",
-            arch: "mips",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "mips-unknown-linux-musl",
-        },
-    ),
-    (
-        "mips-unknown-linux-uclibc",
-        TargetInfo {
-            full_arch: "mips",
-            arch: "mips",
-            vendor: "unknown",
-            os: "linux",
-            env: "uclibc",
-            abi: "",
-            llvm_target: "mips-unknown-linux-uclibc",
-        },
-    ),
-    (
-        "mips64-openwrt-linux-musl",
-        TargetInfo {
-            full_arch: "mips64",
-            arch: "mips64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "abi64",
-            llvm_target: "mips64-unknown-linux-musl",
-        },
-    ),
-    (
-        "mips64-unknown-linux-gnuabi64",
-        TargetInfo {
-            full_arch: "mips64",
-            arch: "mips64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "abi64",
-            llvm_target: "mips64-unknown-linux-gnuabi64",
-        },
-    ),
-    (
-        "mips64-unknown-linux-muslabi64",
-        TargetInfo {
-            full_arch: "mips64",
-            arch: "mips64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "abi64",
-            llvm_target: "mips64-unknown-linux-musl",
-        },
-    ),
-    (
-        "mips64el-unknown-linux-gnuabi64",
-        TargetInfo {
-            full_arch: "mips64el",
-            arch: "mips64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "abi64",
-            llvm_target: "mips64el-unknown-linux-gnuabi64",
-        },
-    ),
-    (
-        "mips64el-unknown-linux-muslabi64",
-        TargetInfo {
-            full_arch: "mips64el",
-            arch: "mips64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "abi64",
-            llvm_target: "mips64el-unknown-linux-musl",
-        },
-    ),
-    (
-        "mipsel-mti-none-elf",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "mti",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "mipsel",
-        },
-    ),
-    (
-        "mipsel-sony-psp",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "sony",
-            os: "psp",
-            env: "",
-            abi: "",
-            llvm_target: "mipsel-sony-psp",
-        },
-    ),
-    (
-        "mipsel-sony-psx",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "sony",
-            os: "psx",
-            env: "",
-            abi: "",
-            llvm_target: "mipsel-sony-psx",
-        },
-    ),
-    (
-        "mipsel-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "mipsel-unknown-linux-gnu",
-        },
-    ),
-    (
-        "mipsel-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "mipsel-unknown-linux-musl",
-        },
-    ),
-    (
-        "mipsel-unknown-linux-uclibc",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "unknown",
-            os: "linux",
-            env: "uclibc",
-            abi: "",
-            llvm_target: "mipsel-unknown-linux-uclibc",
-        },
-    ),
-    (
-        "mipsel-unknown-netbsd",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "mipsel-unknown-netbsd",
-        },
-    ),
-    (
-        "mipsel-unknown-none",
-        TargetInfo {
-            full_arch: "mipsel",
-            arch: "mips",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "mipsel-unknown-none",
-        },
-    ),
-    (
-        "mipsisa32r6-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "mipsisa32r6",
-            arch: "mips32r6",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "mipsisa32r6-unknown-linux-gnu",
-        },
-    ),
-    (
-        "mipsisa32r6el-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "mipsisa32r6el",
-            arch: "mips32r6",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "mipsisa32r6el-unknown-linux-gnu",
-        },
-    ),
-    (
-        "mipsisa64r6-unknown-linux-gnuabi64",
-        TargetInfo {
-            full_arch: "mipsisa64r6",
-            arch: "mips64r6",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "abi64",
-            llvm_target: "mipsisa64r6-unknown-linux-gnuabi64",
-        },
-    ),
-    (
-        "mipsisa64r6el-unknown-linux-gnuabi64",
-        TargetInfo {
-            full_arch: "mipsisa64r6el",
-            arch: "mips64r6",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "abi64",
-            llvm_target: "mipsisa64r6el-unknown-linux-gnuabi64",
-        },
-    ),
-    (
-        "msp430-none-elf",
-        TargetInfo {
-            full_arch: "msp430",
-            arch: "msp430",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "msp430-none-elf",
-        },
-    ),
-    (
-        "nvptx64-nvidia-cuda",
-        TargetInfo {
-            full_arch: "nvptx64",
-            arch: "nvptx64",
-            vendor: "nvidia",
-            os: "cuda",
-            env: "",
-            abi: "",
-            llvm_target: "nvptx64-nvidia-cuda",
-        },
-    ),
-    (
-        "powerpc-unknown-freebsd",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "",
-            llvm_target: "powerpc-unknown-freebsd13.0",
-        },
-    ),
-    (
-        "powerpc-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "powerpc-unknown-linux-gnu",
-        },
-    ),
-    (
-        "powerpc-unknown-linux-gnuspe",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "spe",
-            llvm_target: "powerpc-unknown-linux-gnuspe",
-        },
-    ),
-    (
-        "powerpc-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "powerpc-unknown-linux-musl",
-        },
-    ),
-    (
-        "powerpc-unknown-linux-muslspe",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "spe",
-            llvm_target: "powerpc-unknown-linux-muslspe",
-        },
-    ),
-    (
-        "powerpc-unknown-netbsd",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "powerpc-unknown-netbsd",
-        },
-    ),
-    (
-        "powerpc-unknown-openbsd",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "unknown",
-            os: "openbsd",
-            env: "",
-            abi: "",
-            llvm_target: "powerpc-unknown-openbsd",
-        },
-    ),
-    (
-        "powerpc-wrs-vxworks",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "",
-            llvm_target: "powerpc-unknown-linux-gnu",
-        },
-    ),
-    (
-        "powerpc-wrs-vxworks-spe",
-        TargetInfo {
-            full_arch: "powerpc",
-            arch: "powerpc",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "spe",
-            llvm_target: "powerpc-unknown-linux-gnuspe",
-        },
-    ),
-    (
-        "powerpc64-ibm-aix",
-        TargetInfo {
-            full_arch: "powerpc64",
-            arch: "powerpc64",
-            vendor: "ibm",
-            os: "aix",
-            env: "",
-            abi: "vec-extabi",
-            llvm_target: "powerpc64-ibm-aix",
-        },
-    ),
-    (
-        "powerpc64-unknown-freebsd",
-        TargetInfo {
-            full_arch: "powerpc64",
-            arch: "powerpc64",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "",
-            llvm_target: "powerpc64-unknown-freebsd",
-        },
-    ),
-    (
-        "powerpc64-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "powerpc64",
-            arch: "powerpc64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "powerpc64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "powerpc64-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "powerpc64",
-            arch: "powerpc64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "powerpc64-unknown-linux-musl",
-        },
-    ),
-    (
-        "powerpc64-unknown-openbsd",
-        TargetInfo {
-            full_arch: "powerpc64",
-            arch: "powerpc64",
-            vendor: "unknown",
-            os: "openbsd",
-            env: "",
-            abi: "",
-            llvm_target: "powerpc64-unknown-openbsd",
-        },
-    ),
-    (
-        "powerpc64-wrs-vxworks",
-        TargetInfo {
-            full_arch: "powerpc64",
-            arch: "powerpc64",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "",
-            llvm_target: "powerpc64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "powerpc64le-unknown-freebsd",
-        TargetInfo {
-            full_arch: "powerpc64le",
-            arch: "powerpc64",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "",
-            llvm_target: "powerpc64le-unknown-freebsd",
-        },
-    ),
-    (
-        "powerpc64le-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "powerpc64le",
-            arch: "powerpc64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "powerpc64le-unknown-linux-gnu",
-        },
-    ),
-    (
-        "powerpc64le-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "powerpc64le",
-            arch: "powerpc64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "powerpc64le-unknown-linux-musl",
-        },
-    ),
-    (
-        "riscv32-wrs-vxworks",
-        TargetInfo {
-            full_arch: "riscv32",
-            arch: "riscv32",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32e-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32e",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "ilp32e",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32em-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32em",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "ilp32e",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32emc-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32emc",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "ilp32e",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32gc-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "riscv32gc",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "riscv32-unknown-linux-gnu",
-        },
-    ),
-    (
-        "riscv32gc-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "riscv32gc",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "riscv32-unknown-linux-musl",
-        },
-    ),
-    (
-        "riscv32i-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32i",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32im-risc0-zkvm-elf",
-        TargetInfo {
-            full_arch: "riscv32im",
-            arch: "riscv32",
-            vendor: "risc0",
-            os: "zkvm",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32im-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32im",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32ima-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32ima",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imac-esp-espidf",
-        TargetInfo {
-            full_arch: "riscv32imac",
-            arch: "riscv32",
-            vendor: "espressif",
-            os: "espidf",
-            env: "newlib",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imac-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32imac",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imac-unknown-nuttx-elf",
-        TargetInfo {
-            full_arch: "riscv32imac",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imac-unknown-xous-elf",
-        TargetInfo {
-            full_arch: "riscv32imac",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "xous",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imafc-esp-espidf",
-        TargetInfo {
-            full_arch: "riscv32imafc",
-            arch: "riscv32",
-            vendor: "espressif",
-            os: "espidf",
-            env: "newlib",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imafc-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32imafc",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imafc-unknown-nuttx-elf",
-        TargetInfo {
-            full_arch: "riscv32imafc",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imc-esp-espidf",
-        TargetInfo {
-            full_arch: "riscv32imc",
-            arch: "riscv32",
-            vendor: "espressif",
-            os: "espidf",
-            env: "newlib",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imc-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv32imc",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv32imc-unknown-nuttx-elf",
-        TargetInfo {
-            full_arch: "riscv32imc",
-            arch: "riscv32",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "",
-            llvm_target: "riscv32",
-        },
-    ),
-    (
-        "riscv64-linux-android",
-        TargetInfo {
-            full_arch: "riscv64",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "android",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64-linux-android",
-        },
-    ),
-    (
-        "riscv64-wrs-vxworks",
-        TargetInfo {
-            full_arch: "riscv64",
-            arch: "riscv64",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "",
-            llvm_target: "riscv64",
-        },
-    ),
-    (
-        "riscv64gc-unknown-freebsd",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64-unknown-freebsd",
-        },
-    ),
-    (
-        "riscv64gc-unknown-fuchsia",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "fuchsia",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64-unknown-fuchsia",
-        },
-    ),
-    (
-        "riscv64gc-unknown-hermit",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "hermit",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64-unknown-hermit",
-        },
-    ),
-    (
-        "riscv64gc-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "riscv64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "riscv64gc-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "riscv64-unknown-linux-musl",
-        },
-    ),
-    (
-        "riscv64gc-unknown-netbsd",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64-unknown-netbsd",
-        },
-    ),
-    (
-        "riscv64gc-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64",
-        },
-    ),
-    (
-        "riscv64gc-unknown-nuttx-elf",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64",
-        },
-    ),
-    (
-        "riscv64gc-unknown-openbsd",
-        TargetInfo {
-            full_arch: "riscv64gc",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "openbsd",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64-unknown-openbsd",
-        },
-    ),
-    (
-        "riscv64imac-unknown-none-elf",
-        TargetInfo {
-            full_arch: "riscv64imac",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64",
-        },
-    ),
-    (
-        "riscv64imac-unknown-nuttx-elf",
-        TargetInfo {
-            full_arch: "riscv64imac",
-            arch: "riscv64",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "",
-            llvm_target: "riscv64",
-        },
-    ),
-    (
-        "s390x-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "s390x",
-            arch: "s390x",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "s390x-unknown-linux-gnu",
-        },
-    ),
-    (
-        "s390x-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "s390x",
-            arch: "s390x",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "s390x-unknown-linux-musl",
-        },
-    ),
-    (
-        "sparc-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "sparc",
-            arch: "sparc",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "sparc-unknown-linux-gnu",
-        },
-    ),
-    (
-        "sparc-unknown-none-elf",
-        TargetInfo {
-            full_arch: "sparc",
-            arch: "sparc",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "sparc-unknown-none-elf",
-        },
-    ),
-    (
-        "sparc64-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "sparc64",
-            arch: "sparc64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "sparc64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "sparc64-unknown-netbsd",
-        TargetInfo {
-            full_arch: "sparc64",
-            arch: "sparc64",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "sparc64-unknown-netbsd",
-        },
-    ),
-    (
-        "sparc64-unknown-openbsd",
-        TargetInfo {
-            full_arch: "sparc64",
-            arch: "sparc64",
-            vendor: "unknown",
-            os: "openbsd",
-            env: "",
-            abi: "",
-            llvm_target: "sparc64-unknown-openbsd",
-        },
-    ),
-    (
-        "sparcv9-sun-solaris",
-        TargetInfo {
-            full_arch: "sparcv9",
-            arch: "sparc64",
-            vendor: "sun",
-            os: "solaris",
-            env: "",
-            abi: "",
-            llvm_target: "sparcv9-sun-solaris",
-        },
-    ),
-    (
-        "thumbv4t-none-eabi",
-        TargetInfo {
-            full_arch: "thumbv4t",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv4t-none-eabi",
-        },
-    ),
-    (
-        "thumbv5te-none-eabi",
-        TargetInfo {
-            full_arch: "thumbv5te",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv5te-none-eabi",
-        },
-    ),
-    (
-        "thumbv6m-none-eabi",
-        TargetInfo {
-            full_arch: "thumbv6m",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv6m-none-eabi",
-        },
-    ),
-    (
-        "thumbv6m-nuttx-eabi",
-        TargetInfo {
-            full_arch: "thumbv6m",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv6m-none-eabi",
-        },
-    ),
-    (
-        "thumbv7a-nuttx-eabi",
-        TargetInfo {
-            full_arch: "thumbv7a",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv7a-none-eabi",
-        },
-    ),
-    (
-        "thumbv7a-nuttx-eabihf",
-        TargetInfo {
-            full_arch: "thumbv7a",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "thumbv7a-none-eabihf",
-        },
-    ),
-    (
-        "thumbv7a-pc-windows-msvc",
-        TargetInfo {
-            full_arch: "thumbv7a",
-            arch: "arm",
-            vendor: "pc",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "thumbv7a-pc-windows-msvc",
-        },
-    ),
-    (
-        "thumbv7a-uwp-windows-msvc",
-        TargetInfo {
-            full_arch: "thumbv7a",
-            arch: "arm",
-            vendor: "uwp",
-            os: "windows",
-            env: "msvc",
-            abi: "uwp",
-            llvm_target: "thumbv7a-pc-windows-msvc",
-        },
-    ),
-    (
-        "thumbv7em-none-eabi",
-        TargetInfo {
-            full_arch: "thumbv7em",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv7em-none-eabi",
-        },
-    ),
-    (
-        "thumbv7em-none-eabihf",
-        TargetInfo {
-            full_arch: "thumbv7em",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "thumbv7em-none-eabihf",
-        },
-    ),
-    (
-        "thumbv7em-nuttx-eabi",
-        TargetInfo {
-            full_arch: "thumbv7em",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv7em-none-eabi",
-        },
-    ),
-    (
-        "thumbv7em-nuttx-eabihf",
-        TargetInfo {
-            full_arch: "thumbv7em",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "thumbv7em-none-eabihf",
-        },
-    ),
-    (
-        "thumbv7m-none-eabi",
-        TargetInfo {
-            full_arch: "thumbv7m",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv7m-none-eabi",
-        },
-    ),
-    (
-        "thumbv7m-nuttx-eabi",
-        TargetInfo {
-            full_arch: "thumbv7m",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv7m-none-eabi",
-        },
-    ),
-    (
-        "thumbv7neon-linux-androideabi",
-        TargetInfo {
-            full_arch: "thumbv7neon",
-            arch: "arm",
-            vendor: "unknown",
-            os: "android",
-            env: "",
-            abi: "eabi",
-            llvm_target: "armv7-none-linux-android",
-        },
-    ),
-    (
-        "thumbv7neon-unknown-linux-gnueabihf",
-        TargetInfo {
-            full_arch: "thumbv7neon",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-linux-gnueabihf",
-        },
-    ),
-    (
-        "thumbv7neon-unknown-linux-musleabihf",
-        TargetInfo {
-            full_arch: "thumbv7neon",
-            arch: "arm",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "eabihf",
-            llvm_target: "armv7-unknown-linux-musleabihf",
-        },
-    ),
-    (
-        "thumbv8m.base-none-eabi",
-        TargetInfo {
-            full_arch: "thumbv8m.base",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv8m.base-none-eabi",
-        },
-    ),
-    (
-        "thumbv8m.base-nuttx-eabi",
-        TargetInfo {
-            full_arch: "thumbv8m.base",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv8m.base-none-eabi",
-        },
-    ),
-    (
-        "thumbv8m.main-none-eabi",
-        TargetInfo {
-            full_arch: "thumbv8m.main",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv8m.main-none-eabi",
-        },
-    ),
-    (
-        "thumbv8m.main-none-eabihf",
-        TargetInfo {
-            full_arch: "thumbv8m.main",
-            arch: "arm",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "thumbv8m.main-none-eabihf",
-        },
-    ),
-    (
-        "thumbv8m.main-nuttx-eabi",
-        TargetInfo {
-            full_arch: "thumbv8m.main",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabi",
-            llvm_target: "thumbv8m.main-none-eabi",
-        },
-    ),
-    (
-        "thumbv8m.main-nuttx-eabihf",
-        TargetInfo {
-            full_arch: "thumbv8m.main",
-            arch: "arm",
-            vendor: "unknown",
-            os: "nuttx",
-            env: "",
-            abi: "eabihf",
-            llvm_target: "thumbv8m.main-none-eabihf",
-        },
-    ),
-    (
-        "wasm32-unknown-emscripten",
-        TargetInfo {
-            full_arch: "wasm32",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "emscripten",
-            env: "",
-            abi: "",
-            llvm_target: "wasm32-unknown-emscripten",
-        },
-    ),
-    (
-        "wasm32-unknown-unknown",
-        TargetInfo {
-            full_arch: "wasm32",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "unknown",
-            env: "",
-            abi: "",
-            llvm_target: "wasm32-unknown-unknown",
-        },
-    ),
-    (
-        "wasm32-wali-linux-musl",
-        TargetInfo {
-            full_arch: "wasm32",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "wasm32-wasi",
-        },
-    ),
-    (
-        "wasm32-wasi",
-        TargetInfo {
-            full_arch: "wasm32",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "wasi",
-            env: "",
-            abi: "",
-            llvm_target: "wasm32-wasi",
-        },
-    ),
-    (
-        "wasm32-wasip1",
-        TargetInfo {
-            full_arch: "wasm32",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "wasi",
-            env: "p1",
-            abi: "",
-            llvm_target: "wasm32-wasip1",
-        },
-    ),
-    (
-        "wasm32-wasip1-threads",
-        TargetInfo {
-            full_arch: "wasm32",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "wasi",
-            env: "p1",
-            abi: "",
-            llvm_target: "wasm32-wasi",
-        },
-    ),
-    (
-        "wasm32-wasip2",
-        TargetInfo {
-            full_arch: "wasm32",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "wasi",
-            env: "p2",
-            abi: "",
-            llvm_target: "wasm32-wasip2",
-        },
-    ),
-    (
-        "wasm32v1-none",
-        TargetInfo {
-            full_arch: "wasm32v1",
-            arch: "wasm32",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "wasm32-unknown-unknown",
-        },
-    ),
-    (
-        "wasm64-unknown-unknown",
-        TargetInfo {
-            full_arch: "wasm64",
-            arch: "wasm64",
-            vendor: "unknown",
-            os: "unknown",
-            env: "",
-            abi: "",
-            llvm_target: "wasm64-unknown-unknown",
-        },
-    ),
-    (
-        "x86_64-apple-darwin",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "apple",
-            os: "macos",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-apple-macosx",
-        },
-    ),
-    (
-        "x86_64-apple-ios",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "sim",
-            llvm_target: "x86_64-apple-ios-simulator",
-        },
-    ),
-    (
-        "x86_64-apple-ios-macabi",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "apple",
-            os: "ios",
-            env: "",
-            abi: "macabi",
-            llvm_target: "x86_64-apple-ios-macabi",
-        },
-    ),
-    (
-        "x86_64-apple-tvos",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "apple",
-            os: "tvos",
-            env: "",
-            abi: "sim",
-            llvm_target: "x86_64-apple-tvos-simulator",
-        },
-    ),
-    (
-        "x86_64-apple-watchos-sim",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "apple",
-            os: "watchos",
-            env: "",
-            abi: "sim",
-            llvm_target: "x86_64-apple-watchos-simulator",
-        },
-    ),
-    (
-        "x86_64-fortanix-unknown-sgx",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "fortanix",
-            os: "unknown",
-            env: "sgx",
-            abi: "fortanix",
-            llvm_target: "x86_64-elf",
-        },
-    ),
-    (
-        "x86_64-fuchsia",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "fuchsia",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-fuchsia",
-        },
-    ),
-    (
-        "x86_64-linux-android",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "android",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-linux-android",
-        },
-    ),
-    (
-        "x86_64-pc-cygwin",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "cygwin",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-pc-cygwin",
-        },
-    ),
-    (
-        "x86_64-pc-nto-qnx710",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "nto",
-            env: "nto71",
-            abi: "",
-            llvm_target: "x86_64-pc-unknown",
-        },
-    ),
-    (
-        "x86_64-pc-nto-qnx710_iosock",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "nto",
-            env: "nto71_iosock",
-            abi: "",
-            llvm_target: "x86_64-pc-unknown",
-        },
-    ),
-    (
-        "x86_64-pc-nto-qnx800",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "nto",
-            env: "nto80",
-            abi: "",
-            llvm_target: "x86_64-pc-unknown",
-        },
-    ),
-    (
-        "x86_64-pc-solaris",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "solaris",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-pc-solaris",
-        },
-    ),
-    (
-        "x86_64-pc-windows-gnu",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "windows",
-            env: "gnu",
-            abi: "",
-            llvm_target: "x86_64-pc-windows-gnu",
-        },
-    ),
-    (
-        "x86_64-pc-windows-gnullvm",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "windows",
-            env: "gnu",
-            abi: "llvm",
-            llvm_target: "x86_64-pc-windows-gnu",
-        },
-    ),
-    (
-        "x86_64-pc-windows-msvc",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "pc",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "x86_64-pc-windows-msvc",
-        },
-    ),
-    (
-        "x86_64-sun-solaris",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "sun",
-            os: "solaris",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-pc-solaris",
-        },
-    ),
-    (
-        "x86_64-unikraft-linux-musl",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unikraft",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "x86_64-unknown-linux-musl",
-        },
-    ),
-    (
-        "x86_64-unknown-dragonfly",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "dragonfly",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-dragonfly",
-        },
-    ),
-    (
-        "x86_64-unknown-freebsd",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "freebsd",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-freebsd",
-        },
-    ),
-    (
-        "x86_64-unknown-fuchsia",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "fuchsia",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-fuchsia",
-        },
-    ),
-    (
-        "x86_64-unknown-haiku",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "haiku",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-haiku",
-        },
-    ),
-    (
-        "x86_64-unknown-hermit",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "hermit",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-hermit",
-        },
-    ),
-    (
-        "x86_64-unknown-hurd-gnu",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "hurd",
-            env: "gnu",
-            abi: "",
-            llvm_target: "x86_64-unknown-hurd-gnu",
-        },
-    ),
-    (
-        "x86_64-unknown-illumos",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "illumos",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-pc-solaris",
-        },
-    ),
-    (
-        "x86_64-unknown-l4re-uclibc",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "l4re",
-            env: "uclibc",
-            abi: "",
-            llvm_target: "x86_64-unknown-l4re-uclibc",
-        },
-    ),
-    (
-        "x86_64-unknown-linux-gnu",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "",
-            llvm_target: "x86_64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "x86_64-unknown-linux-gnux32",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "linux",
-            env: "gnu",
-            abi: "x32",
-            llvm_target: "x86_64-unknown-linux-gnux32",
-        },
-    ),
-    (
-        "x86_64-unknown-linux-musl",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "linux",
-            env: "musl",
-            abi: "",
-            llvm_target: "x86_64-unknown-linux-musl",
-        },
-    ),
-    (
-        "x86_64-unknown-linux-none",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "linux",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-linux-none",
-        },
-    ),
-    (
-        "x86_64-unknown-linux-ohos",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "linux",
-            env: "ohos",
-            abi: "",
-            llvm_target: "x86_64-unknown-linux-ohos",
-        },
-    ),
-    (
-        "x86_64-unknown-netbsd",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "netbsd",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-netbsd",
-        },
-    ),
-    (
-        "x86_64-unknown-none",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-none-elf",
-        },
-    ),
-    (
-        "x86_64-unknown-none-linuxkernel",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "none",
-            env: "gnu",
-            abi: "",
-            llvm_target: "x86_64-unknown-none-elf",
-        },
-    ),
-    (
-        "x86_64-unknown-openbsd",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "openbsd",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-openbsd",
-        },
-    ),
-    (
-        "x86_64-unknown-redox",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "redox",
-            env: "relibc",
-            abi: "",
-            llvm_target: "x86_64-unknown-redox",
-        },
-    ),
-    (
-        "x86_64-unknown-trusty",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "trusty",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-unknown-musl",
-        },
-    ),
-    (
-        "x86_64-unknown-uefi",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "unknown",
-            os: "uefi",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64-unknown-windows-gnu",
-        },
-    ),
-    (
-        "x86_64-uwp-windows-gnu",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "uwp",
-            os: "windows",
-            env: "gnu",
-            abi: "uwp",
-            llvm_target: "x86_64-pc-windows-gnu",
-        },
-    ),
-    (
-        "x86_64-uwp-windows-msvc",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "uwp",
-            os: "windows",
-            env: "msvc",
-            abi: "uwp",
-            llvm_target: "x86_64-pc-windows-msvc",
-        },
-    ),
-    (
-        "x86_64-win7-windows-gnu",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "win7",
-            os: "windows",
-            env: "gnu",
-            abi: "",
-            llvm_target: "x86_64-pc-windows-gnu",
-        },
-    ),
-    (
-        "x86_64-win7-windows-msvc",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "win7",
-            os: "windows",
-            env: "msvc",
-            abi: "",
-            llvm_target: "x86_64-pc-windows-msvc",
-        },
-    ),
-    (
-        "x86_64-wrs-vxworks",
-        TargetInfo {
-            full_arch: "x86_64",
-            arch: "x86_64",
-            vendor: "wrs",
-            os: "vxworks",
-            env: "gnu",
-            abi: "",
-            llvm_target: "x86_64-unknown-linux-gnu",
-        },
-    ),
-    (
-        "x86_64h-apple-darwin",
-        TargetInfo {
-            full_arch: "x86_64h",
-            arch: "x86_64",
-            vendor: "apple",
-            os: "macos",
-            env: "",
-            abi: "",
-            llvm_target: "x86_64h-apple-macosx",
-        },
-    ),
-    (
-        "xtensa-esp32-espidf",
-        TargetInfo {
-            full_arch: "xtensa",
-            arch: "xtensa",
-            vendor: "espressif",
-            os: "espidf",
-            env: "newlib",
-            abi: "",
-            llvm_target: "xtensa-none-elf",
-        },
-    ),
-    (
-        "xtensa-esp32-none-elf",
-        TargetInfo {
-            full_arch: "xtensa",
-            arch: "xtensa",
-            vendor: "espressif",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "xtensa-none-elf",
-        },
-    ),
-    (
-        "xtensa-esp32s2-espidf",
-        TargetInfo {
-            full_arch: "xtensa",
-            arch: "xtensa",
-            vendor: "espressif",
-            os: "espidf",
-            env: "newlib",
-            abi: "",
-            llvm_target: "xtensa-none-elf",
-        },
-    ),
-    (
-        "xtensa-esp32s2-none-elf",
-        TargetInfo {
-            full_arch: "xtensa",
-            arch: "xtensa",
-            vendor: "espressif",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "xtensa-none-elf",
-        },
-    ),
-    (
-        "xtensa-esp32s3-espidf",
-        TargetInfo {
-            full_arch: "xtensa",
-            arch: "xtensa",
-            vendor: "espressif",
-            os: "espidf",
-            env: "newlib",
-            abi: "",
-            llvm_target: "xtensa-none-elf",
-        },
-    ),
-    (
-        "xtensa-esp32s3-none-elf",
-        TargetInfo {
-            full_arch: "xtensa",
-            arch: "xtensa",
-            vendor: "espressif",
-            os: "none",
-            env: "",
-            abi: "",
-            llvm_target: "xtensa-none-elf",
-        },
-    ),
+#[rustfmt::skip]
+pub(crate) const LLVM_TARGETS: &[(&str, &str)] = &[
+    ("aarch64-apple-darwin", "arm64-apple-macosx"),
+    ("aarch64-apple-ios", "arm64-apple-ios"),
+    ("aarch64-apple-ios-macabi", "arm64-apple-ios-macabi"),
+    ("aarch64-apple-ios-sim", "arm64-apple-ios-simulator"),
+    ("aarch64-apple-tvos", "arm64-apple-tvos"),
+    ("aarch64-apple-tvos-sim", "arm64-apple-tvos-simulator"),
+    ("aarch64-apple-visionos", "arm64-apple-xros"),
+    ("aarch64-apple-visionos-sim", "arm64-apple-xros-simulator"),
+    ("aarch64-apple-watchos", "arm64-apple-watchos"),
+    ("aarch64-apple-watchos-sim", "arm64-apple-watchos-simulator"),
+    ("aarch64-fuchsia", "aarch64-fuchsia"),
+    ("aarch64-kmc-solid_asp3", "aarch64-unknown-none"),
+    ("aarch64-linux-android", "aarch64-linux-android"),
+    ("aarch64-nintendo-switch-freestanding", "aarch64-unknown-none"),
+    ("aarch64-pc-windows-gnullvm", "aarch64-pc-windows-gnu"),
+    ("aarch64-pc-windows-msvc", "aarch64-pc-windows-msvc"),
+    ("aarch64-unknown-freebsd", "aarch64-unknown-freebsd"),
+    ("aarch64-unknown-fuchsia", "aarch64-unknown-fuchsia"),
+    ("aarch64-unknown-hermit", "aarch64-unknown-hermit"),
+    ("aarch64-unknown-illumos", "aarch64-unknown-solaris2.11"),
+    ("aarch64-unknown-linux-gnu", "aarch64-unknown-linux-gnu"),
+    ("aarch64-unknown-linux-gnu_ilp32", "aarch64-unknown-linux-gnu_ilp32"),
+    ("aarch64-unknown-linux-musl", "aarch64-unknown-linux-musl"),
+    ("aarch64-unknown-linux-ohos", "aarch64-unknown-linux-ohos"),
+    ("aarch64-unknown-netbsd", "aarch64-unknown-netbsd"),
+    ("aarch64-unknown-none", "aarch64-unknown-none"),
+    ("aarch64-unknown-none-softfloat", "aarch64-unknown-none"),
+    ("aarch64-unknown-nto-qnx700", "aarch64-unknown-unknown"),
+    ("aarch64-unknown-nto-qnx710", "aarch64-unknown-unknown"),
+    ("aarch64-unknown-nto-qnx710_iosock", "aarch64-unknown-unknown"),
+    ("aarch64-unknown-nto-qnx800", "aarch64-unknown-unknown"),
+    ("aarch64-unknown-nuttx", "aarch64-unknown-none"),
+    ("aarch64-unknown-openbsd", "aarch64-unknown-openbsd"),
+    ("aarch64-unknown-redox", "aarch64-unknown-redox"),
+    ("aarch64-unknown-teeos", "aarch64-unknown-none"),
+    ("aarch64-unknown-trusty", "aarch64-unknown-unknown-musl"),
+    ("aarch64-unknown-uefi", "aarch64-unknown-windows"),
+    ("aarch64-uwp-windows-msvc", "aarch64-pc-windows-msvc"),
+    ("aarch64-wrs-vxworks", "aarch64-unknown-linux-gnu"),
+    ("aarch64_be-unknown-linux-gnu", "aarch64_be-unknown-linux-gnu"),
+    ("aarch64_be-unknown-linux-gnu_ilp32", "aarch64_be-unknown-linux-gnu_ilp32"),
+    ("aarch64_be-unknown-netbsd", "aarch64_be-unknown-netbsd"),
+    ("amdgcn-amd-amdhsa", "amdgcn-amd-amdhsa"),
+    ("arm-linux-androideabi", "arm-linux-androideabi"),
+    ("arm-unknown-linux-gnueabi", "arm-unknown-linux-gnueabi"),
+    ("arm-unknown-linux-gnueabihf", "arm-unknown-linux-gnueabihf"),
+    ("arm-unknown-linux-musleabi", "arm-unknown-linux-musleabi"),
+    ("arm-unknown-linux-musleabihf", "arm-unknown-linux-musleabihf"),
+    ("arm64_32-apple-watchos", "arm64_32-apple-watchos"),
+    ("arm64e-apple-darwin", "arm64e-apple-macosx"),
+    ("arm64e-apple-ios", "arm64e-apple-ios"),
+    ("arm64e-apple-tvos", "arm64e-apple-tvos"),
+    ("arm64ec-pc-windows-msvc", "arm64ec-pc-windows-msvc"),
+    ("armeb-unknown-linux-gnueabi", "armeb-unknown-linux-gnueabi"),
+    ("armebv7r-none-eabi", "armebv7r-none-eabi"),
+    ("armebv7r-none-eabihf", "armebv7r-none-eabihf"),
+    ("armv4t-none-eabi", "armv4t-none-eabi"),
+    ("armv4t-unknown-linux-gnueabi", "armv4t-unknown-linux-gnueabi"),
+    ("armv5te-none-eabi", "armv5te-none-eabi"),
+    ("armv5te-unknown-linux-gnueabi", "armv5te-unknown-linux-gnueabi"),
+    ("armv5te-unknown-linux-musleabi", "armv5te-unknown-linux-musleabi"),
+    ("armv5te-unknown-linux-uclibceabi", "armv5te-unknown-linux-uclibcgnueabi"),
+    ("armv6-unknown-freebsd", "armv6-unknown-freebsd-gnueabihf"),
+    ("armv6-unknown-netbsd-eabihf", "armv6-unknown-netbsdelf-eabihf"),
+    ("armv6k-nintendo-3ds", "armv6k-none-eabihf"),
+    ("armv7-apple-ios", "armv7-apple-ios7.0.0"),
+    ("armv7-linux-androideabi", "armv7-none-linux-android"),
+    ("armv7-rtems-eabihf", "armv7-unknown-none-eabihf"),
+    ("armv7-sony-vita-newlibeabihf", "thumbv7a-vita-eabihf"),
+    ("armv7-unknown-freebsd", "armv7-unknown-freebsd-gnueabihf"),
+    ("armv7-unknown-linux-gnueabi", "armv7-unknown-linux-gnueabi"),
+    ("armv7-unknown-linux-gnueabihf", "armv7-unknown-linux-gnueabihf"),
+    ("armv7-unknown-linux-musleabi", "armv7-unknown-linux-musleabi"),
+    ("armv7-unknown-linux-musleabihf", "armv7-unknown-linux-musleabihf"),
+    ("armv7-unknown-linux-ohos", "armv7-unknown-linux-ohos"),
+    ("armv7-unknown-linux-uclibceabi", "armv7-unknown-linux-gnueabi"),
+    ("armv7-unknown-linux-uclibceabihf", "armv7-unknown-linux-gnueabihf"),
+    ("armv7-unknown-netbsd-eabihf", "armv7-unknown-netbsdelf-eabihf"),
+    ("armv7-unknown-trusty", "armv7-unknown-unknown-gnueabi"),
+    ("armv7-wrs-vxworks-eabihf", "armv7-unknown-linux-gnueabihf"),
+    ("armv7a-kmc-solid_asp3-eabi", "armv7a-none-eabi"),
+    ("armv7a-kmc-solid_asp3-eabihf", "armv7a-none-eabihf"),
+    ("armv7a-none-eabi", "armv7a-none-eabi"),
+    ("armv7a-none-eabihf", "armv7a-none-eabihf"),
+    ("armv7a-nuttx-eabi", "armv7a-none-eabi"),
+    ("armv7a-nuttx-eabihf", "armv7a-none-eabihf"),
+    ("armv7k-apple-watchos", "armv7k-apple-watchos"),
+    ("armv7r-none-eabi", "armv7r-none-eabi"),
+    ("armv7r-none-eabihf", "armv7r-none-eabihf"),
+    ("armv7s-apple-ios", "armv7s-apple-ios"),
+    ("armv8r-none-eabihf", "armv8r-none-eabihf"),
+    ("asmjs-unknown-emscripten", "wasm32-unknown-emscripten"),
+    ("avr-none", "avr-unknown-unknown"),
+    ("avr-unknown-gnu-atmega328", "avr-unknown-unknown"),
+    ("bpfeb-unknown-none", "bpfeb"),
+    ("bpfel-unknown-none", "bpfel"),
+    ("csky-unknown-linux-gnuabiv2", "csky-unknown-linux-gnuabiv2"),
+    ("csky-unknown-linux-gnuabiv2hf", "csky-unknown-linux-gnuabiv2"),
+    ("hexagon-unknown-linux-musl", "hexagon-unknown-linux-musl"),
+    ("hexagon-unknown-none-elf", "hexagon-unknown-none-elf"),
+    ("i386-apple-ios", "i386-apple-ios-simulator"),
+    ("i586-pc-windows-msvc", "i586-pc-windows-msvc"),
+    ("i586-unknown-linux-gnu", "i586-unknown-linux-gnu"),
+    ("i586-unknown-linux-musl", "i586-unknown-linux-musl"),
+    ("i586-unknown-netbsd", "i586-unknown-netbsdelf"),
+    ("i586-unknown-redox", "i586-unknown-redox"),
+    ("i686-apple-darwin", "i686-apple-macosx"),
+    ("i686-linux-android", "i686-linux-android"),
+    ("i686-pc-nto-qnx700", "i586-pc-unknown"),
+    ("i686-pc-windows-gnu", "i686-pc-windows-gnu"),
+    ("i686-pc-windows-gnullvm", "i686-pc-windows-gnu"),
+    ("i686-pc-windows-msvc", "i686-pc-windows-msvc"),
+    ("i686-unknown-freebsd", "i686-unknown-freebsd"),
+    ("i686-unknown-haiku", "i686-unknown-haiku"),
+    ("i686-unknown-hurd-gnu", "i686-unknown-hurd-gnu"),
+    ("i686-unknown-linux-gnu", "i686-unknown-linux-gnu"),
+    ("i686-unknown-linux-musl", "i686-unknown-linux-musl"),
+    ("i686-unknown-netbsd", "i686-unknown-netbsdelf"),
+    ("i686-unknown-openbsd", "i686-unknown-openbsd"),
+    ("i686-unknown-uefi", "i686-unknown-windows-gnu"),
+    ("i686-uwp-windows-gnu", "i686-pc-windows-gnu"),
+    ("i686-uwp-windows-msvc", "i686-pc-windows-msvc"),
+    ("i686-win7-windows-gnu", "i686-pc-windows-gnu"),
+    ("i686-win7-windows-msvc", "i686-pc-windows-msvc"),
+    ("i686-wrs-vxworks", "i686-unknown-linux-gnu"),
+    ("loongarch64-unknown-linux-gnu", "loongarch64-unknown-linux-gnu"),
+    ("loongarch64-unknown-linux-musl", "loongarch64-unknown-linux-musl"),
+    ("loongarch64-unknown-linux-ohos", "loongarch64-unknown-linux-ohos"),
+    ("loongarch64-unknown-none", "loongarch64-unknown-none"),
+    ("loongarch64-unknown-none-softfloat", "loongarch64-unknown-none"),
+    ("m68k-unknown-linux-gnu", "m68k-unknown-linux-gnu"),
+    ("m68k-unknown-none-elf", "m68k"),
+    ("mips-mti-none-elf", "mips"),
+    ("mips-unknown-linux-gnu", "mips-unknown-linux-gnu"),
+    ("mips-unknown-linux-musl", "mips-unknown-linux-musl"),
+    ("mips-unknown-linux-uclibc", "mips-unknown-linux-uclibc"),
+    ("mips64-openwrt-linux-musl", "mips64-unknown-linux-musl"),
+    ("mips64-unknown-linux-gnuabi64", "mips64-unknown-linux-gnuabi64"),
+    ("mips64-unknown-linux-muslabi64", "mips64-unknown-linux-musl"),
+    ("mips64el-unknown-linux-gnuabi64", "mips64el-unknown-linux-gnuabi64"),
+    ("mips64el-unknown-linux-muslabi64", "mips64el-unknown-linux-musl"),
+    ("mipsel-mti-none-elf", "mipsel"),
+    ("mipsel-sony-psp", "mipsel-sony-psp"),
+    ("mipsel-sony-psx", "mipsel-sony-psx"),
+    ("mipsel-unknown-linux-gnu", "mipsel-unknown-linux-gnu"),
+    ("mipsel-unknown-linux-musl", "mipsel-unknown-linux-musl"),
+    ("mipsel-unknown-linux-uclibc", "mipsel-unknown-linux-uclibc"),
+    ("mipsel-unknown-netbsd", "mipsel-unknown-netbsd"),
+    ("mipsel-unknown-none", "mipsel-unknown-none"),
+    ("mipsisa32r6-unknown-linux-gnu", "mipsisa32r6-unknown-linux-gnu"),
+    ("mipsisa32r6el-unknown-linux-gnu", "mipsisa32r6el-unknown-linux-gnu"),
+    ("mipsisa64r6-unknown-linux-gnuabi64", "mipsisa64r6-unknown-linux-gnuabi64"),
+    ("mipsisa64r6el-unknown-linux-gnuabi64", "mipsisa64r6el-unknown-linux-gnuabi64"),
+    ("msp430-none-elf", "msp430-none-elf"),
+    ("nvptx64-nvidia-cuda", "nvptx64-nvidia-cuda"),
+    ("powerpc-unknown-freebsd", "powerpc-unknown-freebsd13.0"),
+    ("powerpc-unknown-linux-gnu", "powerpc-unknown-linux-gnu"),
+    ("powerpc-unknown-linux-gnuspe", "powerpc-unknown-linux-gnuspe"),
+    ("powerpc-unknown-linux-musl", "powerpc-unknown-linux-musl"),
+    ("powerpc-unknown-linux-muslspe", "powerpc-unknown-linux-muslspe"),
+    ("powerpc-unknown-netbsd", "powerpc-unknown-netbsd"),
+    ("powerpc-unknown-openbsd", "powerpc-unknown-openbsd"),
+    ("powerpc-wrs-vxworks", "powerpc-unknown-linux-gnu"),
+    ("powerpc-wrs-vxworks-spe", "powerpc-unknown-linux-gnuspe"),
+    ("powerpc64-ibm-aix", "powerpc64-ibm-aix"),
+    ("powerpc64-unknown-freebsd", "powerpc64-unknown-freebsd"),
+    ("powerpc64-unknown-linux-gnu", "powerpc64-unknown-linux-gnu"),
+    ("powerpc64-unknown-linux-musl", "powerpc64-unknown-linux-musl"),
+    ("powerpc64-unknown-openbsd", "powerpc64-unknown-openbsd"),
+    ("powerpc64-wrs-vxworks", "powerpc64-unknown-linux-gnu"),
+    ("powerpc64le-unknown-freebsd", "powerpc64le-unknown-freebsd"),
+    ("powerpc64le-unknown-linux-gnu", "powerpc64le-unknown-linux-gnu"),
+    ("powerpc64le-unknown-linux-musl", "powerpc64le-unknown-linux-musl"),
+    ("riscv32-wrs-vxworks", "riscv32"),
+    ("riscv32e-unknown-none-elf", "riscv32"),
+    ("riscv32em-unknown-none-elf", "riscv32"),
+    ("riscv32emc-unknown-none-elf", "riscv32"),
+    ("riscv32gc-unknown-linux-gnu", "riscv32-unknown-linux-gnu"),
+    ("riscv32gc-unknown-linux-musl", "riscv32-unknown-linux-musl"),
+    ("riscv32i-unknown-none-elf", "riscv32"),
+    ("riscv32im-risc0-zkvm-elf", "riscv32"),
+    ("riscv32im-unknown-none-elf", "riscv32"),
+    ("riscv32ima-unknown-none-elf", "riscv32"),
+    ("riscv32imac-esp-espidf", "riscv32"),
+    ("riscv32imac-unknown-none-elf", "riscv32"),
+    ("riscv32imac-unknown-nuttx-elf", "riscv32"),
+    ("riscv32imac-unknown-xous-elf", "riscv32"),
+    ("riscv32imafc-esp-espidf", "riscv32"),
+    ("riscv32imafc-unknown-none-elf", "riscv32"),
+    ("riscv32imafc-unknown-nuttx-elf", "riscv32"),
+    ("riscv32imc-esp-espidf", "riscv32"),
+    ("riscv32imc-unknown-none-elf", "riscv32"),
+    ("riscv32imc-unknown-nuttx-elf", "riscv32"),
+    ("riscv64-linux-android", "riscv64-linux-android"),
+    ("riscv64-wrs-vxworks", "riscv64"),
+    ("riscv64gc-unknown-freebsd", "riscv64-unknown-freebsd"),
+    ("riscv64gc-unknown-fuchsia", "riscv64-unknown-fuchsia"),
+    ("riscv64gc-unknown-hermit", "riscv64-unknown-hermit"),
+    ("riscv64gc-unknown-linux-gnu", "riscv64-unknown-linux-gnu"),
+    ("riscv64gc-unknown-linux-musl", "riscv64-unknown-linux-musl"),
+    ("riscv64gc-unknown-netbsd", "riscv64-unknown-netbsd"),
+    ("riscv64gc-unknown-none-elf", "riscv64"),
+    ("riscv64gc-unknown-nuttx-elf", "riscv64"),
+    ("riscv64gc-unknown-openbsd", "riscv64-unknown-openbsd"),
+    ("riscv64imac-unknown-none-elf", "riscv64"),
+    ("riscv64imac-unknown-nuttx-elf", "riscv64"),
+    ("s390x-unknown-linux-gnu", "s390x-unknown-linux-gnu"),
+    ("s390x-unknown-linux-musl", "s390x-unknown-linux-musl"),
+    ("sparc-unknown-linux-gnu", "sparc-unknown-linux-gnu"),
+    ("sparc-unknown-none-elf", "sparc-unknown-none-elf"),
+    ("sparc64-unknown-linux-gnu", "sparc64-unknown-linux-gnu"),
+    ("sparc64-unknown-netbsd", "sparc64-unknown-netbsd"),
+    ("sparc64-unknown-openbsd", "sparc64-unknown-openbsd"),
+    ("sparcv9-sun-solaris", "sparcv9-sun-solaris"),
+    ("thumbv4t-none-eabi", "thumbv4t-none-eabi"),
+    ("thumbv5te-none-eabi", "thumbv5te-none-eabi"),
+    ("thumbv6m-none-eabi", "thumbv6m-none-eabi"),
+    ("thumbv6m-nuttx-eabi", "thumbv6m-none-eabi"),
+    ("thumbv7a-nuttx-eabi", "thumbv7a-none-eabi"),
+    ("thumbv7a-nuttx-eabihf", "thumbv7a-none-eabihf"),
+    ("thumbv7a-pc-windows-msvc", "thumbv7a-pc-windows-msvc"),
+    ("thumbv7a-uwp-windows-msvc", "thumbv7a-pc-windows-msvc"),
+    ("thumbv7em-none-eabi", "thumbv7em-none-eabi"),
+    ("thumbv7em-none-eabihf", "thumbv7em-none-eabihf"),
+    ("thumbv7em-nuttx-eabi", "thumbv7em-none-eabi"),
+    ("thumbv7em-nuttx-eabihf", "thumbv7em-none-eabihf"),
+    ("thumbv7m-none-eabi", "thumbv7m-none-eabi"),
+    ("thumbv7m-nuttx-eabi", "thumbv7m-none-eabi"),
+    ("thumbv7neon-linux-androideabi", "armv7-none-linux-android"),
+    ("thumbv7neon-unknown-linux-gnueabihf", "armv7-unknown-linux-gnueabihf"),
+    ("thumbv7neon-unknown-linux-musleabihf", "armv7-unknown-linux-musleabihf"),
+    ("thumbv8m.base-none-eabi", "thumbv8m.base-none-eabi"),
+    ("thumbv8m.base-nuttx-eabi", "thumbv8m.base-none-eabi"),
+    ("thumbv8m.main-none-eabi", "thumbv8m.main-none-eabi"),
+    ("thumbv8m.main-none-eabihf", "thumbv8m.main-none-eabihf"),
+    ("thumbv8m.main-nuttx-eabi", "thumbv8m.main-none-eabi"),
+    ("thumbv8m.main-nuttx-eabihf", "thumbv8m.main-none-eabihf"),
+    ("wasm32-unknown-emscripten", "wasm32-unknown-emscripten"),
+    ("wasm32-unknown-unknown", "wasm32-unknown-unknown"),
+    ("wasm32-wali-linux-musl", "wasm32-wasi"),
+    ("wasm32-wasi", "wasm32-wasi"),
+    ("wasm32-wasip1", "wasm32-wasip1"),
+    ("wasm32-wasip1-threads", "wasm32-wasi"),
+    ("wasm32-wasip2", "wasm32-wasip2"),
+    ("wasm32v1-none", "wasm32-unknown-unknown"),
+    ("wasm64-unknown-unknown", "wasm64-unknown-unknown"),
+    ("x86_64-apple-darwin", "x86_64-apple-macosx"),
+    ("x86_64-apple-ios", "x86_64-apple-ios-simulator"),
+    ("x86_64-apple-ios-macabi", "x86_64-apple-ios-macabi"),
+    ("x86_64-apple-tvos", "x86_64-apple-tvos-simulator"),
+    ("x86_64-apple-watchos-sim", "x86_64-apple-watchos-simulator"),
+    ("x86_64-fortanix-unknown-sgx", "x86_64-elf"),
+    ("x86_64-fuchsia", "x86_64-fuchsia"),
+    ("x86_64-linux-android", "x86_64-linux-android"),
+    ("x86_64-pc-cygwin", "x86_64-pc-cygwin"),
+    ("x86_64-pc-nto-qnx710", "x86_64-pc-unknown"),
+    ("x86_64-pc-nto-qnx710_iosock", "x86_64-pc-unknown"),
+    ("x86_64-pc-nto-qnx800", "x86_64-pc-unknown"),
+    ("x86_64-pc-solaris", "x86_64-pc-solaris"),
+    ("x86_64-pc-windows-gnu", "x86_64-pc-windows-gnu"),
+    ("x86_64-pc-windows-gnullvm", "x86_64-pc-windows-gnu"),
+    ("x86_64-pc-windows-msvc", "x86_64-pc-windows-msvc"),
+    ("x86_64-sun-solaris", "x86_64-pc-solaris"),
+    ("x86_64-unikraft-linux-musl", "x86_64-unknown-linux-musl"),
+    ("x86_64-unknown-dragonfly", "x86_64-unknown-dragonfly"),
+    ("x86_64-unknown-freebsd", "x86_64-unknown-freebsd"),
+    ("x86_64-unknown-fuchsia", "x86_64-unknown-fuchsia"),
+    ("x86_64-unknown-haiku", "x86_64-unknown-haiku"),
+    ("x86_64-unknown-hermit", "x86_64-unknown-hermit"),
+    ("x86_64-unknown-hurd-gnu", "x86_64-unknown-hurd-gnu"),
+    ("x86_64-unknown-illumos", "x86_64-pc-solaris"),
+    ("x86_64-unknown-l4re-uclibc", "x86_64-unknown-l4re-uclibc"),
+    ("x86_64-unknown-linux-gnu", "x86_64-unknown-linux-gnu"),
+    ("x86_64-unknown-linux-gnux32", "x86_64-unknown-linux-gnux32"),
+    ("x86_64-unknown-linux-musl", "x86_64-unknown-linux-musl"),
+    ("x86_64-unknown-linux-none", "x86_64-unknown-linux-none"),
+    ("x86_64-unknown-linux-ohos", "x86_64-unknown-linux-ohos"),
+    ("x86_64-unknown-netbsd", "x86_64-unknown-netbsd"),
+    ("x86_64-unknown-none", "x86_64-unknown-none-elf"),
+    ("x86_64-unknown-none-linuxkernel", "x86_64-unknown-none-elf"),
+    ("x86_64-unknown-openbsd", "x86_64-unknown-openbsd"),
+    ("x86_64-unknown-redox", "x86_64-unknown-redox"),
+    ("x86_64-unknown-trusty", "x86_64-unknown-unknown-musl"),
+    ("x86_64-unknown-uefi", "x86_64-unknown-windows"),
+    ("x86_64-uwp-windows-gnu", "x86_64-pc-windows-gnu"),
+    ("x86_64-uwp-windows-msvc", "x86_64-pc-windows-msvc"),
+    ("x86_64-win7-windows-gnu", "x86_64-pc-windows-gnu"),
+    ("x86_64-win7-windows-msvc", "x86_64-pc-windows-msvc"),
+    ("x86_64-wrs-vxworks", "x86_64-unknown-linux-gnu"),
+    ("x86_64h-apple-darwin", "x86_64h-apple-macosx"),
+    ("xtensa-esp32-espidf", "xtensa-none-elf"),
+    ("xtensa-esp32-none-elf", "xtensa-none-elf"),
+    ("xtensa-esp32s2-espidf", "xtensa-none-elf"),
+    ("xtensa-esp32s2-none-elf", "xtensa-none-elf"),
+    ("xtensa-esp32s3-espidf", "xtensa-none-elf"),
+    ("xtensa-esp32s3-none-elf", "xtensa-none-elf"),
 ];
diff --git a/src/target/llvm.rs b/src/target/llvm.rs
index a8ae362..124ab2a 100644
--- a/src/target/llvm.rs
+++ b/src/target/llvm.rs
@@ -1,84 +1,315 @@
-use super::TargetInfo;
+use std::borrow::Cow;
+
+use super::{generated, TargetInfo};
 
 impl TargetInfo<'_> {
-    /// The versioned LLVM/Clang target triple.
-    pub(crate) fn versioned_llvm_target(&self, version: &str) -> String {
-        // Only support versioned Apple targets for now.
-        assert_eq!(self.vendor, "apple");
-
-        let mut components = self.llvm_target.split("-");
-        let arch = components.next().expect("llvm_target should have arch");
-        let vendor = components.next().expect("llvm_target should have vendor");
-        let os = components.next().expect("LLVM target should have os");
-        let environment = components.next();
-        assert_eq!(components.next(), None, "too many LLVM target components");
-
-        if let Some(env) = environment {
-            format!("{arch}-{vendor}-{os}{version}-{env}")
-        } else {
-            format!("{arch}-{vendor}-{os}{version}")
+    /// The LLVM/Clang target triple.
+    ///
+    /// See <https://clang.llvm.org/docs/CrossCompilation.html#target-triple>.
+    ///
+    /// Rust and Clang don't really agree on target naming, so we first try to
+    /// find the matching trible based on `rustc`'s output, but if no such
+    /// triple exists, we attempt to construct the triple from scratch.
+    ///
+    /// NOTE: You should never need to match on this explicitly, use the
+    /// fields on [`TargetInfo`] instead.
+    pub(crate) fn llvm_target(
+        &self,
+        rustc_target: &str,
+        version: Option<&str>,
+    ) -> Cow<'static, str> {
+        if rustc_target == "armv7-apple-ios" {
+            // FIXME(madsmtm): Unnecessary once we bump MSRV to Rust 1.74
+            return Cow::Borrowed("armv7-apple-ios");
+        } else if self.os == "uefi" {
+            // Override the UEFI LLVM targets.
+            //
+            // The rustc mappings (as of 1.82) for the UEFI targets are:
+            // * i686-unknown-uefi -> i686-unknown-windows-gnu
+            // * x86_64-unknown-uefi -> x86_64-unknown-windows
+            // * aarch64-unknown-uefi -> aarch64-unknown-windows
+            //
+            // However, in cc-rs all the UEFI targets use
+            // -windows-gnu. This has been the case since 2021 [1].
+            // * i686-unknown-uefi -> i686-unknown-windows-gnu
+            // * x86_64-unknown-uefi -> x86_64-unknown-windows-gnu
+            // * aarch64-unknown-uefi -> aarch64-unknown-windows-gnu
+            //
+            // For now, override the UEFI mapping to keep the behavior
+            // of cc-rs unchanged.
+            //
+            // TODO: as discussed in [2], it may be possible to switch
+            // to new UEFI targets added to clang, and regardless it
+            // would be good to have consistency between rustc and
+            // cc-rs.
+            //
+            // [1]: https://github.com/rust-lang/cc-rs/pull/623
+            // [2]: https://github.com/rust-lang/cc-rs/pull/1264
+            return Cow::Owned(format!("{}-unknown-windows-gnu", self.full_arch));
+        }
+
+        // If no version is requested, let's take the triple directly from
+        // `rustc` (the logic below is not yet good enough for most targets).
+        //
+        // FIXME(madsmtm): This should ideally be removed.
+        if version.is_none() {
+            if let Ok(index) = generated::LLVM_TARGETS
+                .binary_search_by_key(&rustc_target, |(rustc_target, _)| rustc_target)
+            {
+                let (_, llvm_target) = &generated::LLVM_TARGETS[index];
+                return Cow::Borrowed(llvm_target);
+            }
         }
-    }
-}
 
-/// Rust and Clang don't really agree on naming, so do a best-effort
-/// conversion to support out-of-tree / custom target-spec targets.
-pub(crate) fn guess_llvm_target_triple(
-    full_arch: &str,
-    vendor: &str,
-    os: &str,
-    env: &str,
-    abi: &str,
-) -> String {
-    let arch = match full_arch {
-        riscv32 if riscv32.starts_with("riscv32") => "riscv32",
-        riscv64 if riscv64.starts_with("riscv64") => "riscv64",
-        arch => arch,
-    };
-    let os = match os {
-        "darwin" => "macosx",
-        "visionos" => "xros",
-        "uefi" => "windows",
-        os => os,
-    };
-    let env = match env {
-        "newlib" | "nto70" | "nto71" | "nto71_iosock" | "ohos" | "p1" | "p2" | "relibc" | "sgx"
-        | "uclibc" => "",
-        env => env,
-    };
-    let abi = match abi {
-        "sim" => "simulator",
-        "llvm" | "softfloat" | "uwp" | "vec-extabi" => "",
-        "ilp32" => "_ilp32",
-        abi => abi,
-    };
-    match (env, abi) {
-        ("", "") => format!("{arch}-{vendor}-{os}"),
-        (env, abi) => format!("{arch}-{vendor}-{os}-{env}{abi}"),
+        // Otherwise, attempt to construct the triple from the target info.
+
+        let arch = match self.full_arch {
+            riscv32 if riscv32.starts_with("riscv32") => "riscv32",
+            riscv64 if riscv64.starts_with("riscv64") => "riscv64",
+            "aarch64" if self.vendor == "apple" => "arm64",
+            "armv7" if self.vendor == "sony" => "thumbv7a", // FIXME
+            arch => arch,
+        };
+        let vendor = match self.vendor {
+            "kmc" | "nintendo" => "unknown",
+            "unknown" if self.os == "android" => "linux",
+            "uwp" => "pc",
+            "espressif" => "",
+            _ if self.arch == "msp430" => "",
+            vendor => vendor,
+        };
+        let os = match self.os {
+            "macos" => "macosx",
+            "visionos" => "xros",
+            "uefi" => "windows",
+            "solid_asp3" | "horizon" | "teeos" | "nuttx" | "espidf" => "none",
+            "nto" => "unknown",    // FIXME
+            "trusty" => "unknown", // FIXME
+            os => os,
+        };
+        let version = version.unwrap_or("");
+        let env = match self.env {
+            "newlib" | "nto70" | "nto71" | "nto71_iosock" | "p1" | "p2" | "relibc" | "sgx"
+            | "uclibc" => "",
+            env => env,
+        };
+        let abi = match self.abi {
+            "sim" => "simulator",
+            "llvm" | "softfloat" | "uwp" | "vec-extabi" => "",
+            "ilp32" => "_ilp32",
+            "abi64" => "",
+            abi => abi,
+        };
+        Cow::Owned(match (vendor, env, abi) {
+            ("", "", "") => format!("{arch}-{os}{version}"),
+            ("", env, abi) => format!("{arch}-{os}{version}-{env}{abi}"),
+            (vendor, "", "") => format!("{arch}-{vendor}-{os}{version}"),
+            (vendor, env, abi) => format!("{arch}-{vendor}-{os}{version}-{env}{abi}"),
+        })
     }
 }
 
 #[cfg(test)]
 mod tests {
-    use super::*;
+    use std::process::Command;
+
+    use crate::TargetInfo;
+
+    #[test]
+    fn test_old_ios_target() {
+        assert_eq!(
+            TargetInfo {
+                full_arch: "armv7",
+                arch: "armv7",
+                vendor: "apple",
+                os: "ios",
+                env: "",
+                abi: "",
+            }
+            .llvm_target("armv7-apple-ios", None),
+            "armv7-apple-ios"
+        );
+    }
 
     #[test]
-    fn test_basic_llvm_triple_guessing() {
+    fn basic_llvm_triple_guessing() {
         assert_eq!(
-            guess_llvm_target_triple("aarch64", "unknown", "linux", "", ""),
+            TargetInfo {
+                full_arch: "aarch64",
+                arch: "aarch64",
+                vendor: "unknown",
+                os: "linux",
+                env: "",
+                abi: "",
+            }
+            .llvm_target("invalid", None),
             "aarch64-unknown-linux"
         );
         assert_eq!(
-            guess_llvm_target_triple("x86_64", "unknown", "linux", "gnu", ""),
+            TargetInfo {
+                full_arch: "x86_64",
+                arch: "x86_64",
+                vendor: "unknown",
+                os: "linux",
+                env: "gnu",
+                abi: "",
+            }
+            .llvm_target("invalid", None),
             "x86_64-unknown-linux-gnu"
         );
         assert_eq!(
-            guess_llvm_target_triple("x86_64", "unknown", "linux", "gnu", "eabi"),
+            TargetInfo {
+                full_arch: "x86_64",
+                arch: "x86_64",
+                vendor: "unknown",
+                os: "linux",
+                env: "gnu",
+                abi: "eabi",
+            }
+            .llvm_target("invalid", None),
             "x86_64-unknown-linux-gnueabi"
         );
         assert_eq!(
-            guess_llvm_target_triple("x86_64", "apple", "darwin", "", ""),
+            TargetInfo {
+                full_arch: "x86_64",
+                arch: "x86_64",
+                vendor: "apple",
+                os: "macos",
+                env: "",
+                abi: "",
+            }
+            .llvm_target("invalid", None),
             "x86_64-apple-macosx"
         );
     }
+
+    #[test]
+    fn llvm_version() {
+        assert_eq!(
+            TargetInfo {
+                full_arch: "aarch64",
+                arch: "aarch64",
+                vendor: "apple",
+                os: "ios",
+                env: "",
+                abi: "sim",
+            }
+            .llvm_target("aarch64-apple-ios-sim", Some("14.0")),
+            "arm64-apple-ios14.0-simulator"
+        );
+        assert_eq!(
+            TargetInfo {
+                full_arch: "aarch64",
+                arch: "aarch64",
+                vendor: "apple",
+                os: "visionos",
+                env: "",
+                abi: "",
+            }
+            .llvm_target("aarch64-apple-visionos", Some("2.0")),
+            "arm64-apple-xros2.0"
+        );
+        assert_eq!(
+            TargetInfo {
+                full_arch: "aarch64",
+                arch: "aarch64",
+                vendor: "apple",
+                os: "ios",
+                env: "",
+                abi: "macabi",
+            }
+            .llvm_target("aarch64-apple-ios-macabi", Some("13.1")),
+            "arm64-apple-ios13.1-macabi"
+        );
+    }
+
+    #[test]
+    fn uefi() {
+        assert_eq!(
+            TargetInfo {
+                full_arch: "i686",
+                arch: "x86",
+                vendor: "unknown",
+                os: "uefi",
+                env: "",
+                abi: "",
+            }
+            .llvm_target("i686-unknown-uefi", None),
+            "i686-unknown-windows-gnu"
+        );
+        assert_eq!(
+            TargetInfo {
+                full_arch: "x86_64",
+                arch: "x86_64",
+                vendor: "unknown",
+                os: "uefi",
+                env: "",
+                abi: "",
+            }
+            .llvm_target("x86_64-unknown-uefi", None),
+            "x86_64-unknown-windows-gnu"
+        );
+        assert_eq!(
+            TargetInfo {
+                full_arch: "aarch64",
+                arch: "aarch64",
+                vendor: "unknown",
+                os: "uefi",
+                env: "",
+                abi: "",
+            }
+            .llvm_target("aarch64-unknown-uefi", None),
+            "aarch64-unknown-windows-gnu"
+        );
+    }
+
+    #[test]
+    #[ignore = "not yet done"]
+    fn llvm_for_all_rustc_targets() {
+        let rustc = std::env::var("RUSTC").unwrap_or_else(|_| "rustc".to_string());
+
+        let target_list = Command::new(&rustc)
+            .arg("--print=target-list")
+            .output()
+            .unwrap()
+            .stdout;
+        let target_list = String::from_utf8(target_list).unwrap();
+
+        let mut has_failure = false;
+        for target in target_list.lines() {
+            let spec_json = Command::new(&rustc)
+                .arg("--target")
+                .arg(target)
+                .arg("-Zunstable-options")
+                .arg("--print=target-spec-json")
+                .env("RUSTC_BOOTSTRAP", "1") // Crimes
+                .output()
+                .unwrap()
+                .stdout;
+            let spec_json = String::from_utf8(spec_json).unwrap();
+
+            // JSON crimes
+            let expected = spec_json
+                .split_once("llvm-target\": \"")
+                .unwrap()
+                .1
+                .split_once("\"")
+                .unwrap()
+                .0;
+            let actual = TargetInfo::from_rustc_target(target)
+                .map(|target| target.llvm_target("invalid", None));
+
+            if Some(expected) != actual.as_deref().ok() {
+                eprintln!("failed comparing {target}:");
+                eprintln!("  expected: Ok({expected:?})");
+                eprintln!("    actual: {actual:?}");
+                eprintln!();
+                has_failure = true;
+            }
+        }
+
+        if has_failure {
+            panic!("failed comparing targets");
+        }
+    }
 }
diff --git a/src/target/parser.rs b/src/target/parser.rs
index eb88669..ca356be 100644
--- a/src/target/parser.rs
+++ b/src/target/parser.rs
@@ -1,10 +1,6 @@
-use std::{env, str::FromStr};
+use std::env;
 
-use crate::{
-    target::{llvm, TargetInfo},
-    utilities::OnceLock,
-    Error, ErrorKind,
-};
+use crate::{target::TargetInfo, utilities::OnceLock, Error, ErrorKind};
 
 #[derive(Debug)]
 struct TargetInfoParserInner {
@@ -14,7 +10,6 @@ struct TargetInfoParserInner {
     os: Box<str>,
     env: Box<str>,
     abi: Box<str>,
-    llvm_target: Box<str>,
 }
 
 impl TargetInfoParserInner {
@@ -24,17 +19,17 @@ impl TargetInfoParserInner {
         // No need to emit `rerun-if-env-changed` for this,
         // as it is controlled by Cargo itself.
         #[allow(clippy::disallowed_methods)]
-        let target_triple = env::var("TARGET").map_err(|err| {
+        let target_name = env::var("TARGET").map_err(|err| {
             Error::new(
                 ErrorKind::EnvVarNotFound,
                 format!("failed reading TARGET: {err}"),
             )
         })?;
 
-        // Parse the full architecture name from the target triple.
-        let (full_arch, _rest) = target_triple.split_once('-').ok_or(Error::new(
+        // Parse the full architecture name from the target name.
+        let (full_arch, _rest) = target_name.split_once('-').ok_or(Error::new(
             ErrorKind::InvalidTarget,
-            format!("target `{target_triple}` had an unknown architecture"),
+            format!("target `{target_name}` only had a single component (at least two required)"),
         ))?;
 
         let cargo_env = |name, fallback: Option<&str>| -> Result<Box<str>, Error> {
@@ -47,7 +42,7 @@ impl TargetInfoParserInner {
                     Some(fallback) => Ok(fallback.into()),
                     None => Err(Error::new(
                         ErrorKind::EnvVarNotFound,
-                        format!("did not find fallback information for target `{target_triple}`, and failed reading {name}: {err}"),
+                        format!("did not find fallback information for target `{target_name}`, and failed reading {name}: {err}"),
                     )),
                 },
             }
@@ -64,10 +59,10 @@ impl TargetInfoParserInner {
         //
         // These may not be set in case the user depended on being able to
         // just set `TARGET` outside of build scripts; in those cases, fall
-        // back back to data from the known set of target triples instead.
+        // back back to data from the known set of target names instead.
         //
         // See discussion in #1225 for further details.
-        let fallback_target = TargetInfo::from_str(&target_triple).ok();
+        let fallback_target = TargetInfo::from_rustc_target(&target_name).ok();
         let ft = fallback_target.as_ref();
         let arch = cargo_env("CARGO_CFG_TARGET_ARCH", ft.map(|t| t.arch))?;
         let vendor = cargo_env("CARGO_CFG_TARGET_VENDOR", ft.map(|t| t.vendor))?;
@@ -75,16 +70,10 @@ impl TargetInfoParserInner {
         let env = cargo_env("CARGO_CFG_TARGET_ENV", ft.map(|t| t.env))?;
         // `target_abi` was stabilized in Rust 1.78, which is higher than our
         // MSRV, so it may not always be available; In that case, fall back to
-        // `""`, which is _probably_ correct for unknown target triples.
+        // `""`, which is _probably_ correct for unknown target names.
         let abi = cargo_env("CARGO_CFG_TARGET_ABI", ft.map(|t| t.abi))
             .unwrap_or_else(|_| String::default().into_boxed_str());
 
-        // Prefer `rustc`'s LLVM target triple information.
-        let llvm_target = match fallback_target {
-            Some(ft) => ft.llvm_target.to_string(),
-            None => llvm::guess_llvm_target_triple(full_arch, &vendor, &os, &env, &abi),
-        };
-
         Ok(Self {
             full_arch: full_arch.to_string().into_boxed_str(),
             arch,
@@ -92,7 +81,6 @@ impl TargetInfoParserInner {
             os,
             env,
             abi,
-            llvm_target: llvm_target.into_boxed_str(),
         })
     }
 }
@@ -114,7 +102,6 @@ impl TargetInfoParser {
                 os,
                 env,
                 abi,
-                llvm_target,
             }) => Ok(TargetInfo {
                 full_arch,
                 arch,
@@ -122,9 +109,453 @@ impl TargetInfoParser {
                 os,
                 env,
                 abi,
-                llvm_target,
             }),
             Err(e) => Err(e.clone()),
         }
     }
 }
+
+/// Parse the full architecture in the target name into the simpler
+/// `cfg(target_arch = "...")` that `rustc` exposes.
+fn parse_arch(full_arch: &str) -> Option<&str> {
+    // NOTE: Some of these don't necessarily match an existing target in
+    // `rustc`. They're parsed anyhow to be as forward-compatible as possible,
+    // while still being correct.
+    //
+    // See also:
+    // https://docs.rs/cfg-expr/0.18.0/cfg_expr/targets/index.html
+    // https://docs.rs/target-lexicon/0.13.2/target_lexicon/enum.Architecture.html
+    // https://gcc.gnu.org/onlinedocs/gcc/Submodel-Options.html
+    // `clang -print-targets`
+    Some(match full_arch {
+        arch if arch.starts_with("mipsisa32r6") => "mips32r6", // mipsisa32r6 | mipsisa32r6el
+        arch if arch.starts_with("mipsisa64r6") => "mips64r6", // mipsisa64r6 | mipsisa64r6el
+
+        arch if arch.starts_with("mips64") => "mips64", // mips64 | mips64el
+        arch if arch.starts_with("mips") => "mips",     // mips | mipsel
+
+        arch if arch.starts_with("loongarch64") => "loongarch64",
+        arch if arch.starts_with("loongarch32") => "loongarch32",
+
+        arch if arch.starts_with("powerpc64") => "powerpc64", // powerpc64 | powerpc64le
+        arch if arch.starts_with("powerpc") => "powerpc",
+        arch if arch.starts_with("ppc64") => "powerpc64",
+        arch if arch.starts_with("ppc") => "powerpc",
+
+        arch if arch.starts_with("x86_64") => "x86_64", // x86_64 | x86_64h
+        arch if arch.starts_with("i") && arch.ends_with("86") => "x86", // i386 | i586 | i686
+
+        "arm64ec" => "arm64ec", // https://github.com/rust-lang/rust/issues/131172
+        arch if arch.starts_with("aarch64") => "aarch64", // arm64e | arm64_32
+        arch if arch.starts_with("arm64") => "aarch64", // aarch64 | aarch64_be
+
+        arch if arch.starts_with("arm") => "arm", // arm | armv7s | armeb | ...
+        arch if arch.starts_with("thumb") => "arm", // thumbv4t | thumbv7a | thumbv8m | ...
+
+        arch if arch.starts_with("riscv64") => "riscv64",
+        arch if arch.starts_with("riscv32") => "riscv32",
+
+        arch if arch.starts_with("wasm64") => "wasm64",
+        arch if arch.starts_with("wasm32") => "wasm32", // wasm32 | wasm32v1
+        "asmjs" => "wasm32",
+
+        arch if arch.starts_with("nvptx64") => "nvptx64",
+        arch if arch.starts_with("nvptx") => "nvptx",
+
+        arch if arch.starts_with("bpf") => "bpf", // bpfeb | bpfel
+
+        // https://github.com/bytecodealliance/wasmtime/tree/v30.0.1/pulley
+        arch if arch.starts_with("pulley64") => "pulley64",
+        arch if arch.starts_with("pulley32") => "pulley32",
+
+        // https://github.com/Clever-ISA/Clever-ISA
+        arch if arch.starts_with("clever") => "clever",
+
+        "sparc" | "sparcv7" | "sparcv8" => "sparc",
+        "sparc64" | "sparcv9" => "sparc64",
+
+        "amdgcn" => "amdgpu",
+        "avr" => "avr",
+        "csky" => "csky",
+        "hexagon" => "hexagon",
+        "m68k" => "m68k",
+        "msp430" => "msp430",
+        "r600" => "r600",
+        "s390x" => "s390x",
+        "xtensa" => "xtensa",
+
+        _ => return None,
+    })
+}
+
+/// Parse environment and ABI from the last component of the target name.
+fn parse_envabi(last_component: &str) -> Option<(&str, &str)> {
+    let (env, abi) = match last_component {
+        // Combined environment and ABI
+
+        // gnullvm | gnueabi | gnueabihf | gnuabiv2 | gnuabi64 | gnuspe | gnux32 | gnu_ilp32
+        env_and_abi if env_and_abi.starts_with("gnu") => {
+            let abi = env_and_abi.strip_prefix("gnu").unwrap();
+            let abi = abi.strip_prefix("_").unwrap_or(abi);
+            ("gnu", abi)
+        }
+        // musl | musleabi | musleabihf | muslabi64 | muslspe
+        env_and_abi if env_and_abi.starts_with("musl") => {
+            ("musl", env_and_abi.strip_prefix("musl").unwrap())
+        }
+        // uclibc | uclibceabi | uclibceabihf
+        env_and_abi if env_and_abi.starts_with("uclibc") => {
+            ("uclibc", env_and_abi.strip_prefix("uclibc").unwrap())
+        }
+        // newlib | newlibeabihf
+        env_and_abi if env_and_abi.starts_with("newlib") => {
+            ("newlib", env_and_abi.strip_prefix("newlib").unwrap())
+        }
+
+        // Environments
+        "msvc" => ("msvc", ""),
+        "ohos" => ("ohos", ""),
+        "qnx700" => ("nto70", ""),
+        "qnx710_iosock" => ("nto71_iosock", ""),
+        "qnx710" => ("nto71", ""),
+        "qnx800" => ("nto80", ""),
+        "sgx" => ("sgx", ""),
+        "threads" => ("threads", ""),
+
+        // ABIs
+        "abi64" => ("", "abi64"),
+        "abiv2" => ("", "spe"),
+        "eabi" => ("", "eabi"),
+        "eabihf" => ("", "eabihf"),
+        "macabi" => ("", "macabi"),
+        "sim" => ("", "sim"),
+        "softfloat" => ("", "softfloat"),
+        "spe" => ("", "spe"),
+        "x32" => ("", "x32"),
+
+        // Badly named targets, ELF is already known from target OS.
+        // Probably too late to fix now though.
+        "elf" => ("", ""),
+        // Undesirable to expose to user code (yet):
+        // https://github.com/rust-lang/rust/pull/131166#issuecomment-2389541917
+        "freestanding" => ("", ""),
+
+        _ => return None,
+    };
+    Some((env, abi))
+}
+
+impl<'a> TargetInfo<'a> {
+    pub(crate) fn from_rustc_target(target: &'a str) -> Result<Self, Error> {
+        // FIXME(madsmtm): This target should be renamed, cannot be parsed
+        // with the means we do below (since `none` must not be interpreted
+        // as an env/ABI).
+        if target == "x86_64-unknown-linux-none" {
+            return Ok(Self {
+                full_arch: "x86_64",
+                arch: "x86_64",
+                vendor: "unknown",
+                os: "linux",
+                env: "",
+                abi: "",
+            });
+        }
+
+        let mut components = target.split('-');
+
+        // Insist that the target name contains at least a valid architecture.
+        let full_arch = components.next().ok_or(Error::new(
+            ErrorKind::InvalidTarget,
+            "target was empty".to_string(),
+        ))?;
+        let arch = parse_arch(full_arch).ok_or_else(|| {
+            Error::new(
+                ErrorKind::UnknownTarget,
+                format!("target `{target}` had an unknown architecture"),
+            )
+        })?;
+
+        // Newer target names have begun omitting the vendor, so the only
+        // component we know must be there is the OS name.
+        let components: Vec<_> = components.collect();
+        let (vendor, os, mut env, mut abi) = match &*components {
+            [] => {
+                return Err(Error::new(
+                    ErrorKind::InvalidTarget,
+                    format!("target `{target}` must have at least two components"),
+                ))
+            }
+            // Two components; format is `arch-os`.
+            [os] => ("unknown", *os, "", ""),
+            // The three-component case is a bit tricky to handle, it could
+            // either have the format `arch-vendor-os` or `arch-os-env+abi`.
+            [vendor_or_os, os_or_envabi] => {
+                // We differentiate between these by checking if the last
+                // component is an env/ABI; if it isn't, then it's probably
+                // an OS instead.
+                if let Some((env, abi)) = parse_envabi(os_or_envabi) {
+                    ("unknown", *vendor_or_os, env, abi)
+                } else {
+                    (*vendor_or_os, *os_or_envabi, "", "")
+                }
+            }
+            // Four components; format is `arch-vendor-os-env+abi`.
+            [vendor, os, envabi] => {
+                let (env, abi) = parse_envabi(envabi).ok_or_else(|| {
+                    Error::new(
+                        ErrorKind::UnknownTarget,
+                        format!("unknown environment/ABI `{envabi}` in target `{target}`"),
+                    )
+                })?;
+                (*vendor, *os, env, abi)
+            }
+            _ => {
+                return Err(Error::new(
+                    ErrorKind::InvalidTarget,
+                    format!("too many components in target `{target}`"),
+                ))
+            }
+        };
+
+        // Part of the architecture name is carried over into the ABI.
+        match full_arch {
+            // https://github.com/rust-lang/compiler-team/issues/830
+            arch if arch.starts_with("riscv32e") => {
+                abi = "ilp32e";
+            }
+            _ => {}
+        }
+
+        // Various environment/ABIs are determined based on OS name.
+        match os {
+            "3ds" | "rtems" | "espidf" => env = "newlib",
+            "vxworks" => env = "gnu",
+            "redox" => env = "relibc",
+            "aix" => abi = "vec-extabi",
+            _ => {}
+        }
+
+        // Extra overrides for badly named targets.
+        match target {
+            // Actually simulator targets.
+            "i386-apple-ios" | "x86_64-apple-ios" | "x86_64-apple-tvos" => {
+                abi = "sim";
+            }
+            // Name should've contained `muslabi64`.
+            "mips64-openwrt-linux-musl" => {
+                abi = "abi64";
+            }
+            // Specifies abi even though not in name.
+            "armv6-unknown-freebsd" | "armv6k-nintendo-3ds" | "armv7-unknown-freebsd" => {
+                abi = "eabihf";
+            }
+            // Specifies abi even though not in name.
+            "armv7-unknown-linux-ohos" | "armv7-unknown-trusty" => {
+                abi = "eabi";
+            }
+            _ => {}
+        }
+
+        let os = match os {
+            // Horizon is the common/internal OS name for 3DS and the Switch.
+            "3ds" | "switch" => "horizon",
+            // FIXME(madsmtm): macOS targets are badly named.
+            "darwin" => "macos",
+
+            // WASI targets contain the preview version in them too. Should've
+            // been `wasi-p1`/`wasi-p2`, but that's probably too late now.
+            os if os.starts_with("wasi") => {
+                env = os.strip_prefix("wasi").unwrap();
+                "wasi"
+            }
+            // FIXME(madsmtm): Badly named targets `*-linux-androideabi`,
+            // should be `*-android-eabi`.
+            "androideabi" => {
+                abi = "eabi";
+                "android"
+            }
+
+            os => os,
+        };
+
+        let vendor = match vendor {
+            // esp, esp32, esp32s2 etc.
+            vendor if vendor.starts_with("esp") => "espressif",
+            // FIXME(madsmtm): https://github.com/rust-lang/rust/issues/131165
+            "openwrt" => "unknown",
+            // FIXME(madsmtm): Badly named targets `*-linux-android*`,
+            // "linux" makes no sense as the vendor name.
+            "linux" if os == "android" || os == "androideabi" => "unknown",
+            // Some Linux distributions set their name as the target vendor,
+            // so we have to assume that it can be an arbitary string.
+            vendor => vendor,
+        };
+
+        // Intentionally also marked as an ABI:
+        // https://github.com/rust-lang/rust/pull/86922
+        if vendor == "fortanix" {
+            abi = "fortanix";
+        }
+        if vendor == "uwp" {
+            abi = "uwp";
+        }
+
+        Ok(Self {
+            full_arch,
+            arch,
+            vendor,
+            os,
+            env,
+            abi,
+        })
+    }
+}
+
+#[cfg(test)]
+#[allow(unexpected_cfgs)]
+mod tests {
+    use std::process::Command;
+
+    use super::TargetInfo;
+    use crate::ErrorKind;
+
+    // Test tier 1 targets.
+    #[test]
+    fn tier1() {
+        let targets = [
+            "aarch64-unknown-linux-gnu",
+            "aarch64-apple-darwin",
+            "i686-pc-windows-gnu",
+            "i686-pc-windows-msvc",
+            "i686-unknown-linux-gnu",
+            "x86_64-apple-darwin",
+            "x86_64-pc-windows-gnu",
+            "x86_64-pc-windows-msvc",
+            "x86_64-unknown-linux-gnu",
+        ];
+
+        for target in targets {
+            // Check that they parse.
+            let _ = TargetInfo::from_rustc_target(target).unwrap();
+        }
+    }
+
+    // Various custom target names not (or no longer) known by `rustc`.
+    #[test]
+    fn parse_extra() {
+        let targets = [
+            "aarch64-unknown-none-gnu",
+            "aarch64-uwp-windows-gnu",
+            "arm-frc-linux-gnueabi",
+            "arm-unknown-netbsd-eabi",
+            "armv7neon-unknown-linux-gnueabihf",
+            "armv7neon-unknown-linux-musleabihf",
+            "thumbv7-unknown-linux-gnueabihf",
+            "thumbv7-unknown-linux-musleabihf",
+            "armv7-apple-ios",
+            "wasm32-wasi",
+            "x86_64-rumprun-netbsd",
+            "x86_64-unknown-linux",
+            "x86_64-alpine-linux-musl",
+            "x86_64-chimera-linux-musl",
+            "x86_64-foxkit-linux-musl",
+            "arm-poky-linux-gnueabi",
+            "x86_64-unknown-moturus",
+        ];
+
+        for target in targets {
+            // Check that they parse.
+            let _ = TargetInfo::from_rustc_target(target).unwrap();
+        }
+    }
+
+    fn target_from_rustc_cfgs<'a>(target: &'a str, cfgs: &'a str) -> TargetInfo<'a> {
+        // Cannot determine full architecture from cfgs.
+        let (full_arch, _rest) = target.split_once('-').expect("target to have arch");
+
+        let mut target = TargetInfo {
+            full_arch: full_arch.into(),
+            arch: "invalid-none-set".into(),
+            vendor: "invalid-none-set".into(),
+            os: "invalid-none-set".into(),
+            env: "invalid-none-set".into(),
+            // Not set in older Rust versions
+            abi: "".into(),
+        };
+
+        for cfg in cfgs.lines() {
+            if let Some((name, value)) = cfg.split_once('=') {
+                // Remove whitespace, if `rustc` decided to insert any.
+                let name = name.trim();
+                let value = value.trim();
+
+                // Remove quotes around value.
+                let value = value.strip_prefix('"').unwrap_or(value);
+                let value = value.strip_suffix('"').unwrap_or(value);
+
+                match name {
+                    "target_arch" => target.arch = value,
+                    "target_vendor" => target.vendor = value,
+                    "target_os" => target.os = value,
+                    "target_env" => target.env = value,
+                    "target_abi" => target.abi = value,
+                    _ => {}
+                }
+            } else {
+                // Skip cfgs like `debug_assertions` and `unix`.
+            }
+        }
+
+        target
+    }
+
+    #[test]
+    fn unknown_env_determined_as_unknown() {
+        let err = TargetInfo::from_rustc_target("aarch64-unknown-linux-bogus").unwrap_err();
+        assert!(matches!(err.kind, ErrorKind::UnknownTarget));
+    }
+
+    // Used in .github/workflows/test-rustc-targets.yml
+    #[test]
+    #[cfg_attr(
+        not(rustc_target_test),
+        ignore = "must enable explicitly with --cfg=rustc_target_test"
+    )]
+    fn parse_rustc_targets() {
+        let rustc = std::env::var("RUSTC").unwrap_or_else(|_| "rustc".to_string());
+
+        let target_list = Command::new(&rustc)
+            .arg("--print=target-list")
+            .output()
+            .unwrap()
+            .stdout;
+        let target_list = String::from_utf8(target_list).unwrap();
+
+        let mut has_failure = false;
+        for target in target_list.lines() {
+            let cfgs = Command::new(&rustc)
+                .arg("--target")
+                .arg(target)
+                .arg("--print=cfg")
+                .output()
+                .unwrap()
+                .stdout;
+            let cfgs = String::from_utf8(cfgs).unwrap();
+
+            let expected = target_from_rustc_cfgs(target, &cfgs);
+            let actual = TargetInfo::from_rustc_target(target);
+
+            if Some(&expected) != actual.as_ref().ok() {
+                eprintln!("failed comparing {target}:");
+                eprintln!("  expected: Ok({expected:?})");
+                eprintln!("    actual: {actual:?}");
+                eprintln!();
+                has_failure = true;
+            }
+        }
+
+        if has_failure {
+            panic!("failed comparing targets");
+        }
+    }
+}
diff --git a/src/windows/find_tools.rs b/src/windows/find_tools.rs
index ce4f0c6..ec7c786 100644
--- a/src/windows/find_tools.rs
+++ b/src/windows/find_tools.rs
@@ -110,9 +110,9 @@ impl EnvGetter for StdEnvGetter {
 /// Attempts to find a tool within an MSVC installation using the Windows
 /// registry as a point to search from.
 ///
-/// The `arch_or_target` argument is the architecture or the Rust target
-/// triple that the tool should work for (e.g. compile or link for). The
-/// supported architecture names are:
+/// The `arch_or_target` argument is the architecture or the Rust target name
+/// that the tool should work for (e.g. compile or link for). The supported
+/// architecture names are:
 /// - `"x64"` or `"x86_64"`
 /// - `"arm64"` or `"aarch64"`
 /// - `"arm64ec"`


Test patch:
diff --git a/.github/workflows/test-rustc-targets.yml b/.github/workflows/test-rustc-targets.yml
new file mode 100644
index 0000000..4608759
--- /dev/null
+++ b/.github/workflows/test-rustc-targets.yml
@@ -0,0 +1,52 @@
+name: Test nightly `rustc` targets and add issue comment if changed
+
+on:
+  workflow_dispatch: # Allow running on-demand
+  schedule:
+    - cron: '0 3 * * 1,4' # Every Monday and Thursdag
+  push:
+    branches:
+      - 'main'
+    paths:
+      - 'src/target/**'
+
+jobs:
+  regenerate:
+    if: github.repository_owner == 'rust-lang'
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+        with:
+          persist-credentials: true
+
+      - name: Install current nightly Rust
+        run: |
+          rustup toolchain install nightly --no-self-update --profile minimal
+          rustup default nightly
+      - run: cargo update
+      - uses: Swatinem/rust-cache@v2
+
+      - name: Test with `RUSTFLAGS=--cfg=rustc_target_test cargo test --lib`
+        id: test
+        continue-on-error: true # We want to open an issue if it fails
+        run: cargo test --lib 2>&1 | tee test_output.txt
+        env:
+          RUSTFLAGS: --cfg=rustc_target_test
+
+      # Added to https://github.com/rust-lang/cc-rs/issues/1426
+      - name: Add issue comment if test failed
+        if: steps.test.outcome == 'failure'
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        run: |
+          gh issue comment 1426 --body "
+          Failed parsing `rustc` target on `$(rustc --version)`.
+
+          <details><summary>Test output</summary>
+          <p>
+          \`\`\`
+          $(cat test_output.txt)
+          \`\`\`
+          </p>
+          </details>
+          " --head $(git branch --show-current)