| { | ||
| "git": { | ||
| "sha1": "f53e817b50f6f93a573c20c641116c60bd074336" | ||
| "sha1": "1ca8b2af7a19faa4d090cc5deba3f7a0cd721174" | ||
| }, | ||
| "path_in_vcs": "" | ||
| } |
+3
-3
@@ -13,3 +13,3 @@ # This file is automatically @generated by Cargo. | ||
| name = "cc" | ||
| version = "1.2.39" | ||
| version = "1.2.40" | ||
| dependencies = [ | ||
@@ -47,5 +47,5 @@ "find-msvc-tools", | ||
| name = "find-msvc-tools" | ||
| version = "0.1.2" | ||
| version = "0.1.3" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "1ced73b1dacfc750a6db6c0a0c3a3853c8b41997e2e2c563dc90804ae6867959" | ||
| checksum = "0399f9d26e5191ce32c498bebd31e7a3ceabc2745f0ac54af3f335126c3f24b3" | ||
@@ -52,0 +52,0 @@ [[package]] |
+6
-2
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "cc" | ||
| version = "1.2.39" | ||
| version = "1.2.40" | ||
| authors = ["Alex Crichton <alex@alexcrichton.com>"] | ||
@@ -55,3 +55,3 @@ build = false | ||
| [dependencies.find-msvc-tools] | ||
| version = "0.1.2" | ||
| version = "0.1.3" | ||
@@ -78,1 +78,5 @@ [dependencies.jobserver] | ||
| check-cfg = ["cfg(disable_clang_cl_tests)"] | ||
| [profile.release] | ||
| opt-level = 3 | ||
| lto = true |
+34
-32
@@ -10,2 +10,36 @@ # Changelog | ||
| ## [1.2.40](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.39...cc-v1.2.40) - 2025-10-03 | ||
| ### Other | ||
| - Reorder changelog and remove duplicate Unreleased section ([#1579](https://github.com/rust-lang/cc-rs/pull/1579)) | ||
| - Prefer clang if linker-plugin-lto specified ([#1573](https://github.com/rust-lang/cc-rs/pull/1573)) | ||
| - Fix building for Mac Catalyst ([#1577](https://github.com/rust-lang/cc-rs/pull/1577)) | ||
| - Improve ESP microcontroller targets ([#1574](https://github.com/rust-lang/cc-rs/pull/1574)) | ||
| ## [1.2.39](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.38...cc-v1.2.39) - 2025-09-26 | ||
| ### Other | ||
| - Fix cross compilation to xtensa-esp32s3-espidf ([#1569](https://github.com/rust-lang/cc-rs/pull/1569)) | ||
| - Fix autodetect_wasi_compiler: support non utf-8 path ([#1568](https://github.com/rust-lang/cc-rs/pull/1568)) | ||
| - Regenerate target info ([#1567](https://github.com/rust-lang/cc-rs/pull/1567)) | ||
| - Fix rustcflags mapping: require -Clinker-plugin-lto for -flto ([#1564](https://github.com/rust-lang/cc-rs/pull/1564)) | ||
| - Use `$WASI_SDK_PATH` on WASI targets by default ([#1562](https://github.com/rust-lang/cc-rs/pull/1562)) | ||
| - Fix atomicity violations in concurrent cache operations ([#1559](https://github.com/rust-lang/cc-rs/pull/1559)) | ||
| ## [1.2.38](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.37...cc-v1.2.38) - 2025-09-19 | ||
| ### Other | ||
| - updated the following local packages: find-msvc-tools | ||
| ## [1.2.37](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.36...cc-v1.2.37) - 2025-09-12 | ||
| ### Other | ||
| - Fix errmsg in RustcCodegenFlags::set_rustc_flag ([#1551](https://github.com/rust-lang/cc-rs/pull/1551)) | ||
| - propagate stack protector to Linux C compilers ([#1550](https://github.com/rust-lang/cc-rs/pull/1550)) | ||
| - Extract new fn `run_commands_in_parallel` ([#1549](https://github.com/rust-lang/cc-rs/pull/1549)) | ||
| ## [1.2.36](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.35...cc-v1.2.36) - 2025-09-05 | ||
@@ -77,35 +111,3 @@ | ||
| - Add support for recognizing some architectures supported by GCC, but not LLVM. ([#1500](https://github.com/rust-lang/cc-rs/pull/1500)) | ||
| # Changelog | ||
| All notable changes to this project will be documented in this file. | ||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
| ## [Unreleased] | ||
| ## [1.2.39](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.38...cc-v1.2.39) - 2025-09-26 | ||
| ### Other | ||
| - Fix cross compilation to xtensa-esp32s3-espidf ([#1569](https://github.com/rust-lang/cc-rs/pull/1569)) | ||
| - Fix autodetect_wasi_compiler: support non utf-8 path ([#1568](https://github.com/rust-lang/cc-rs/pull/1568)) | ||
| - Regenerate target info ([#1567](https://github.com/rust-lang/cc-rs/pull/1567)) | ||
| - Fix rustcflags mapping: require -Clinker-plugin-lto for -flto ([#1564](https://github.com/rust-lang/cc-rs/pull/1564)) | ||
| - Use `$WASI_SDK_PATH` on WASI targets by default ([#1562](https://github.com/rust-lang/cc-rs/pull/1562)) | ||
| - Fix atomicity violations in concurrent cache operations ([#1559](https://github.com/rust-lang/cc-rs/pull/1559)) | ||
| ## [1.2.38](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.37...cc-v1.2.38) - 2025-09-19 | ||
| ### Other | ||
| - updated the following local packages: find-msvc-tools | ||
| ## [1.2.37](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.36...cc-v1.2.37) - 2025-09-12 | ||
| ### Other | ||
| - Fix errmsg in RustcCodegenFlags::set_rustc_flag ([#1551](https://github.com/rust-lang/cc-rs/pull/1551)) | ||
| - propagate stack protector to Linux C compilers ([#1550](https://github.com/rust-lang/cc-rs/pull/1550)) | ||
| - Extract new fn `run_commands_in_parallel` ([#1549](https://github.com/rust-lang/cc-rs/pull/1549)) | ||
| ## [1.2.30](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.29...cc-v1.2.30) - 2025-07-18 | ||
@@ -112,0 +114,0 @@ |
+0
-1
@@ -9,3 +9,2 @@ //! Parsing of `rustc` target names to match the values exposed to Cargo | ||
| pub(crate) use apple::*; | ||
| pub(crate) use parser::TargetInfoParser; | ||
@@ -12,0 +11,0 @@ |
+22
-37
| use super::TargetInfo; | ||
| #[derive(Copy, Clone, Debug, Eq, PartialEq)] | ||
| pub(crate) enum AppleEnv { | ||
| Simulator, | ||
| MacCatalyst, | ||
| } | ||
| pub(crate) use AppleEnv::*; | ||
| impl TargetInfo<'_> { | ||
| pub(crate) fn get_apple_env(&self) -> Option<AppleEnv> { | ||
| match (self.env, self.abi) { | ||
| ("sim", _) | (_, "sim") => Some(Simulator), | ||
| ("macabi", _) | (_, "macabi") => Some(MacCatalyst), | ||
| _ => None, | ||
| } | ||
| } | ||
| pub(crate) fn apple_sdk_name(&self) -> &'static str { | ||
| match (self.os, self.get_apple_env()) { | ||
| ("macos", None) => "macosx", | ||
| ("ios", None) => "iphoneos", | ||
| ("ios", Some(Simulator)) => "iphonesimulator", | ||
| ("ios", Some(MacCatalyst)) => "macosx", | ||
| ("tvos", None) => "appletvos", | ||
| ("tvos", Some(Simulator)) => "appletvsimulator", | ||
| ("watchos", None) => "watchos", | ||
| ("watchos", Some(Simulator)) => "watchsimulator", | ||
| ("visionos", None) => "xros", | ||
| ("visionos", Some(Simulator)) => "xrsimulator", | ||
| match (self.os, self.env) { | ||
| ("macos", "") => "macosx", | ||
| ("ios", "") => "iphoneos", | ||
| ("ios", "sim") => "iphonesimulator", | ||
| ("ios", "macabi") => "macosx", | ||
| ("tvos", "") => "appletvos", | ||
| ("tvos", "sim") => "appletvsimulator", | ||
| ("watchos", "") => "watchos", | ||
| ("watchos", "sim") => "watchsimulator", | ||
| ("visionos", "") => "xros", | ||
| ("visionos", "sim") => "xrsimulator", | ||
| (os, _) => panic!("invalid Apple target OS {}", os), | ||
@@ -48,15 +33,15 @@ } | ||
| // https://gcc.gnu.org/onlinedocs/gcc/Darwin-Options.html#index-mmacosx-version-min | ||
| match (self.os, self.get_apple_env()) { | ||
| ("macos", None) => format!("-mmacosx-version-min={min_version}"), | ||
| ("ios", None) => format!("-miphoneos-version-min={min_version}"), | ||
| ("ios", Some(Simulator)) => format!("-mios-simulator-version-min={min_version}"), | ||
| ("ios", Some(MacCatalyst)) => format!("-mtargetos=ios{min_version}-macabi"), | ||
| ("tvos", None) => format!("-mappletvos-version-min={min_version}"), | ||
| ("tvos", Some(Simulator)) => format!("-mappletvsimulator-version-min={min_version}"), | ||
| ("watchos", None) => format!("-mwatchos-version-min={min_version}"), | ||
| ("watchos", Some(Simulator)) => format!("-mwatchsimulator-version-min={min_version}"), | ||
| match (self.os, self.env) { | ||
| ("macos", "") => format!("-mmacosx-version-min={min_version}"), | ||
| ("ios", "") => format!("-miphoneos-version-min={min_version}"), | ||
| ("ios", "sim") => format!("-mios-simulator-version-min={min_version}"), | ||
| ("ios", "macabi") => format!("-mtargetos=ios{min_version}-macabi"), | ||
| ("tvos", "") => format!("-mappletvos-version-min={min_version}"), | ||
| ("tvos", "sim") => format!("-mappletvsimulator-version-min={min_version}"), | ||
| ("watchos", "") => format!("-mwatchos-version-min={min_version}"), | ||
| ("watchos", "sim") => format!("-mwatchsimulator-version-min={min_version}"), | ||
| // `-mxros-version-min` does not exist | ||
| // https://github.com/llvm/llvm-project/issues/88271 | ||
| ("visionos", None) => format!("-mtargetos=xros{min_version}"), | ||
| ("visionos", Some(Simulator)) => format!("-mtargetos=xros{min_version}-simulator"), | ||
| ("visionos", "") => format!("-mtargetos=xros{min_version}"), | ||
| ("visionos", "sim") => format!("-mtargetos=xros{min_version}-simulator"), | ||
| (os, _) => panic!("invalid Apple target OS {}", os), | ||
@@ -63,0 +48,0 @@ } |
@@ -98,9 +98,2 @@ use std::borrow::Cow; | ||
| let abi = match self.abi { | ||
| "sim" => { | ||
| if env != "simulator" { | ||
| "simulator" | ||
| } else { | ||
| "" | ||
| } | ||
| } | ||
| "llvm" | "softfloat" | "uwp" | "vec-extabi" => "", | ||
@@ -202,4 +195,4 @@ "ilp32" => "_ilp32", | ||
| os: "ios", | ||
| env: "", | ||
| abi: "sim", | ||
| env: "sim", | ||
| abi: "", | ||
| } | ||
@@ -206,0 +199,0 @@ .llvm_target("aarch64-apple-ios-sim", Some("14.0")), |
+41
-3
@@ -1,2 +0,2 @@ | ||
| use std::env; | ||
| use std::{env, mem}; | ||
@@ -70,9 +70,21 @@ use crate::{target::TargetInfo, utilities::OnceLock, Error, ErrorKind}; | ||
| let os = cargo_env("CARGO_CFG_TARGET_OS", ft.map(|t| t.os))?; | ||
| let env = cargo_env("CARGO_CFG_TARGET_ENV", ft.map(|t| t.env))?; | ||
| let mut 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 names. | ||
| let abi = cargo_env("CARGO_CFG_TARGET_ABI", ft.map(|t| t.abi)) | ||
| let mut abi = cargo_env("CARGO_CFG_TARGET_ABI", ft.map(|t| t.abi)) | ||
| .unwrap_or_else(|_| String::default().into_boxed_str()); | ||
| // Remove `macabi` and `sim` from `target_abi` (if present), it's been moved to `target_env`. | ||
| // TODO: Remove once MSRV is bumped to 1.91 and `rustc` removes these from `target_abi`. | ||
| if matches!(&*abi, "macabi" | "sim") { | ||
| debug_assert!( | ||
| matches!(&*env, "" | "macbi" | "sim"), | ||
| "env/abi mismatch: {:?}, {:?}", | ||
| env, | ||
| abi, | ||
| ); | ||
| env = mem::replace(&mut abi, String::default().into_boxed_str()); | ||
| } | ||
| Ok(Self { | ||
@@ -601,2 +613,28 @@ full_arch: full_arch.to_string().into_boxed_str(), | ||
| } | ||
| #[test] | ||
| fn parses_apple_envs_correctly() { | ||
| assert_eq!( | ||
| TargetInfo::from_rustc_target("aarch64-apple-ios-macabi").unwrap(), | ||
| TargetInfo { | ||
| full_arch: "aarch64", | ||
| arch: "aarch64", | ||
| vendor: "apple", | ||
| os: "ios", | ||
| env: "macabi", | ||
| abi: "", | ||
| } | ||
| ); | ||
| assert_eq!( | ||
| TargetInfo::from_rustc_target("aarch64-apple-ios-sim").unwrap(), | ||
| TargetInfo { | ||
| full_arch: "aarch64", | ||
| arch: "aarch64", | ||
| vendor: "apple", | ||
| os: "ios", | ||
| env: "sim", | ||
| abi: "", | ||
| } | ||
| ); | ||
| } | ||
| } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display