Add target_env = "macabi" and target_env = "sim"

This commit is contained in:
Mads Marquart 2025-03-01 03:10:05 +01:00
parent 2886b36df4
commit d434cae18f
33 changed files with 112 additions and 81 deletions

View file

@ -17,7 +17,7 @@ mod tests;
/// The canonical name of the desired SDK for a given target.
pub(super) fn sdk_name(target: &Target) -> &'static str {
match (&*target.os, &*target.abi) {
match (&*target.os, &*target.env) {
("macos", "") => "MacOSX",
("ios", "") => "iPhoneOS",
("ios", "sim") => "iPhoneSimulator",
@ -34,7 +34,7 @@ pub(super) fn sdk_name(target: &Target) -> &'static str {
}
pub(super) fn macho_platform(target: &Target) -> u32 {
match (&*target.os, &*target.abi) {
match (&*target.os, &*target.env) {
("macos", _) => object::macho::PLATFORM_MACOS,
("ios", "macabi") => object::macho::PLATFORM_MACCATALYST,
("ios", "sim") => object::macho::PLATFORM_IOSSIMULATOR,

View file

@ -3026,7 +3026,7 @@ pub(crate) fn are_upstream_rust_objects_already_included(sess: &Session) -> bool
/// We need to communicate five things to the linker on Apple/Darwin targets:
/// - The architecture.
/// - The operating system (and that it's an Apple platform).
/// - The environment / ABI.
/// - The environment.
/// - The deployment target.
/// - The SDK version.
fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavor) {
@ -3040,7 +3040,7 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
// `sess.target.arch` (`target_arch`) is not detailed enough.
let llvm_arch = sess.target.llvm_target.split_once('-').expect("LLVM target must have arch").0;
let target_os = &*sess.target.os;
let target_abi = &*sess.target.abi;
let target_env = &*sess.target.env;
// The architecture name to forward to the linker.
//
@ -3091,14 +3091,14 @@ fn add_apple_link_args(cmd: &mut dyn Linker, sess: &Session, flavor: LinkerFlavo
// > - visionos-simulator
// > - xros-simulator
// > - driverkit
let platform_name = match (target_os, target_abi) {
let platform_name = match (target_os, target_env) {
(os, "") => os,
("ios", "macabi") => "mac-catalyst",
("ios", "sim") => "ios-simulator",
("tvos", "sim") => "tvos-simulator",
("watchos", "sim") => "watchos-simulator",
("visionos", "sim") => "visionos-simulator",
_ => bug!("invalid OS/ABI combination for Apple target: {target_os}, {target_abi}"),
_ => bug!("invalid OS/env combination for Apple target: {target_os}, {target_env}"),
};
let min_version = sess.apple_deployment_target().fmt_full().to_string();

View file

@ -83,7 +83,7 @@ pub fn walk_native_lib_search_dirs<R>(
// Mac Catalyst uses the macOS SDK, but to link to iOS-specific frameworks
// we must have the support library stubs in the library search path (#121430).
if let Some(sdk_root) = apple_sdk_root
&& sess.target.llvm_target.contains("macabi")
&& sess.target.env == "macabi"
{
f(&sdk_root.join("System/iOSSupport/usr/lib"), false)?;
f(&sdk_root.join("System/iOSSupport/System/Library/Frameworks"), true)?;

View file

@ -51,14 +51,14 @@ impl Arch {
})
}
fn target_cpu(self, abi: TargetAbi) -> &'static str {
fn target_cpu(self, env: TargetEnv) -> &'static str {
match self {
Armv7k => "cortex-a8",
Armv7s => "swift", // iOS 10 is only supported on iPhone 5 or higher.
Arm64 => match abi {
TargetAbi::Normal => "apple-a7",
TargetAbi::Simulator => "apple-a12",
TargetAbi::MacCatalyst => "apple-a12",
Arm64 => match env {
TargetEnv::Normal => "apple-a7",
TargetEnv::Simulator => "apple-a12",
TargetEnv::MacCatalyst => "apple-a12",
},
Arm64e => "apple-a12",
Arm64_32 => "apple-s4",
@ -83,14 +83,14 @@ impl Arch {
}
#[derive(Copy, Clone, PartialEq)]
pub(crate) enum TargetAbi {
pub(crate) enum TargetEnv {
Normal,
Simulator,
MacCatalyst,
}
impl TargetAbi {
fn target_abi(self) -> &'static str {
impl TargetEnv {
fn target_env(self) -> &'static str {
match self {
Self::Normal => "",
Self::MacCatalyst => "macabi",
@ -104,13 +104,20 @@ impl TargetAbi {
pub(crate) fn base(
os: &'static str,
arch: Arch,
abi: TargetAbi,
env: TargetEnv,
) -> (TargetOptions, StaticCow<str>, StaticCow<str>) {
let mut opts = TargetOptions {
abi: abi.target_abi().into(),
llvm_floatabi: Some(FloatAbi::Hard),
os: os.into(),
cpu: arch.target_cpu(abi).into(),
env: env.target_env().into(),
// NOTE: We originally set `cfg(target_abi = "macabi")` / `cfg(target_abi = "sim")`,
// before it was discovered that those are actually environments:
// https://github.com/rust-lang/rust/issues/133331
//
// But let's continue setting them for backwards compatibility.
// FIXME(madsmtm): Warn about using these in the future.
abi: env.target_env().into(),
cpu: arch.target_cpu(env).into(),
link_env_remove: link_env_remove(os),
vendor: "apple".into(),
linker_flavor: LinkerFlavor::Darwin(Cc::Yes, Lld::No),
@ -168,14 +175,14 @@ pub(crate) fn base(
// All Apple x86-32 targets have SSE2.
opts.rustc_abi = Some(RustcAbi::X86Sse2);
}
(opts, unversioned_llvm_target(os, arch, abi), arch.target_arch())
(opts, unversioned_llvm_target(os, arch, env), arch.target_arch())
}
/// Generate part of the LLVM target triple.
///
/// See `rustc_codegen_ssa::back::versioned_llvm_target` for the full triple passed to LLVM and
/// Clang.
fn unversioned_llvm_target(os: &str, arch: Arch, abi: TargetAbi) -> StaticCow<str> {
fn unversioned_llvm_target(os: &str, arch: Arch, env: TargetEnv) -> StaticCow<str> {
let arch = arch.target_name();
// Convert to the "canonical" OS name used by LLVM:
// https://github.com/llvm/llvm-project/blob/llvmorg-18.1.8/llvm/lib/TargetParser/Triple.cpp#L236-L282
@ -187,10 +194,10 @@ fn unversioned_llvm_target(os: &str, arch: Arch, abi: TargetAbi) -> StaticCow<st
"visionos" => "xros",
_ => unreachable!("tried to get LLVM target OS for non-Apple platform"),
};
let environment = match abi {
TargetAbi::Normal => "",
TargetAbi::MacCatalyst => "-macabi",
TargetAbi::Simulator => "-simulator",
let environment = match env {
TargetEnv::Normal => "",
TargetEnv::MacCatalyst => "-macabi",
TargetEnv::Simulator => "-simulator",
};
format!("{arch}-apple-{os}{environment}").into()
}
@ -309,7 +316,7 @@ impl OSVersion {
/// This matches what LLVM does, see in part:
/// <https://github.com/llvm/llvm-project/blob/llvmorg-18.1.8/llvm/lib/TargetParser/Triple.cpp#L1900-L1932>
pub fn minimum_deployment_target(target: &Target) -> Self {
let (major, minor, patch) = match (&*target.os, &*target.arch, &*target.abi) {
let (major, minor, patch) = match (&*target.os, &*target.arch, &*target.env) {
("macos", "aarch64", _) => (11, 0, 0),
("ios", "aarch64", "macabi") => (14, 0, 0),
("ios", "aarch64", "sim") => (14, 0, 0),

View file

@ -6,7 +6,7 @@ use crate::spec::targets::{
};
#[test]
fn simulator_targets_set_abi() {
fn simulator_targets_set_env() {
let all_sim_targets = [
x86_64_apple_ios::target(),
x86_64_apple_tvos::target(),
@ -18,7 +18,9 @@ fn simulator_targets_set_abi() {
];
for target in &all_sim_targets {
assert_eq!(target.abi, "sim")
assert_eq!(target.env, "sim");
// Ensure backwards compat
assert_eq!(target.abi, "sim");
}
}

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("macos", Arch::Arm64, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("macos", Arch::Arm64, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("ios", Arch::Arm64, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("ios", Arch::Arm64, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("ios", Arch::Arm64, TargetAbi::MacCatalyst);
let (opts, llvm_target, arch) = base("ios", Arch::Arm64, TargetEnv::MacCatalyst);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("ios", Arch::Arm64, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("ios", Arch::Arm64, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("visionos", Arch::Arm64, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("visionos", Arch::Arm64, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("visionos", Arch::Arm64, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("visionos", Arch::Arm64, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("watchos", Arch::Arm64, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("watchos", Arch::Arm64, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("watchos", Arch::Arm64, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("watchos", Arch::Arm64, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("watchos", Arch::Arm64_32, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("watchos", Arch::Arm64_32, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("macos", Arch::Arm64e, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("macos", Arch::Arm64e, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("ios", Arch::Arm64e, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("ios", Arch::Arm64e, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64e, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("tvos", Arch::Arm64e, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("watchos", Arch::Armv7k, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("watchos", Arch::Armv7k, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("ios", Arch::Armv7s, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("ios", Arch::Armv7s, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,10 +1,10 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
// i386-apple-ios is a simulator target, even though it isn't declared
// that way in the target name like the other ones...
let (opts, llvm_target, arch) = base("ios", Arch::I386, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("ios", Arch::I386, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("macos", Arch::I686, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("macos", Arch::I686, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("macos", Arch::X86_64, TargetAbi::Normal);
let (opts, llvm_target, arch) = base("macos", Arch::X86_64, TargetEnv::Normal);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,10 +1,10 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
// x86_64-apple-ios is a simulator target, even though it isn't declared
// that way in the target name like the other ones...
let (opts, llvm_target, arch) = base("ios", Arch::X86_64, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("ios", Arch::X86_64, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("ios", Arch::X86_64, TargetAbi::MacCatalyst);
let (opts, llvm_target, arch) = base("ios", Arch::X86_64, TargetEnv::MacCatalyst);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,10 +1,10 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
// x86_64-apple-tvos is a simulator target, even though it isn't declared
// that way in the target name like the other ones...
let (opts, llvm_target, arch) = base("tvos", Arch::X86_64, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("tvos", Arch::X86_64, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (opts, llvm_target, arch) = base("watchos", Arch::X86_64, TargetAbi::Simulator);
let (opts, llvm_target, arch) = base("watchos", Arch::X86_64, TargetEnv::Simulator);
Target {
llvm_target,
metadata: TargetMetadata {

View file

@ -1,8 +1,8 @@
use crate::spec::base::apple::{Arch, TargetAbi, base};
use crate::spec::base::apple::{Arch, TargetEnv, base};
use crate::spec::{SanitizerSet, Target, TargetMetadata, TargetOptions};
pub(crate) fn target() -> Target {
let (mut opts, llvm_target, arch) = base("macos", Arch::X86_64h, TargetAbi::Normal);
let (mut opts, llvm_target, arch) = base("macos", Arch::X86_64h, TargetEnv::Normal);
opts.max_atomic_width = Some(128);
opts.supported_sanitizers =
SanitizerSet::ADDRESS | SanitizerSet::CFI | SanitizerSet::LEAK | SanitizerSet::THREAD;

View file

@ -56,6 +56,17 @@ Rust programs can be built for these targets by specifying `--target`, if
$ rustc --target aarch64-apple-ios-macabi your-code.rs
```
The target can be differentiated from the iOS targets with the
`target_env = "macabi"` cfg (or `target_abi = "macabi"` before Rust CURRENT_RUSTC_VERSION).
```rust
if cfg!(target_env = "macabi") {
// Do something only on Mac Catalyst.
}
```
This is similar to the `TARGET_OS_MACCATALYST` define in C code.
## Testing
Mac Catalyst binaries can be run directly on macOS 10.15 Catalina or newer.

View file

@ -66,6 +66,20 @@ Rust programs can be built for these targets by specifying `--target`, if
$ rustc --target aarch64-apple-ios your-code.rs
```
The simulator variants can be differentiated from the variants running
on-device with the `target_env = "sim"` cfg (or `target_abi = "sim"` before
Rust CURRENT_RUSTC_VERSION).
```rust
if cfg!(all(target_vendor = "apple", target_env = "sim")) {
// Do something on the iOS/tvOS/visionOS/watchOS Simulator.
} {
// Everything else, like Windows and non-Simulator iOS.
}
```
This is similar to the `TARGET_OS_SIMULATOR` define in C code.
## Testing
There is no support for running the Rust or standard library testsuite at the

View file

@ -637,6 +637,7 @@ fn matches_env() {
("x86_64-unknown-linux-gnu", "gnu"),
("x86_64-fortanix-unknown-sgx", "sgx"),
("arm-unknown-linux-musleabi", "musl"),
("aarch64-apple-ios-macabi", "macabi"),
];
for (target, env) in envs {
let config: Config = cfg().target(target).build();
@ -647,11 +648,7 @@ fn matches_env() {
#[test]
fn matches_abi() {
let abis = [
("aarch64-apple-ios-macabi", "macabi"),
("x86_64-unknown-linux-gnux32", "x32"),
("arm-unknown-linux-gnueabi", "eabi"),
];
let abis = [("x86_64-unknown-linux-gnux32", "x32"), ("arm-unknown-linux-gnueabi", "eabi")];
for (target, abi) in abis {
let config: Config = cfg().target(target).build();
assert!(config.matches_abi(abi), "{target} {abi}");

View file

@ -156,7 +156,7 @@ warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`
LL | target_env = "_UNEXPECTED_VALUE",
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: expected values for `target_env` are: ``, `gnu`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `nto71_iosock`, `nto80`, `ohos`, `p1`, `p2`, `relibc`, `sgx`, `uclibc`, and `v5`
= note: expected values for `target_env` are: ``, `gnu`, `macabi`, `msvc`, `musl`, `newlib`, `nto70`, `nto71`, `nto71_iosock`, `nto80`, `ohos`, `p1`, `p2`, `relibc`, `sgx`, `sim`, `uclibc`, and `v5`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
warning: unexpected `cfg` condition value: `_UNEXPECTED_VALUE`