diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-11-02 08:33:10 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-02 08:33:10 +0100 |
| commit | bb544f863f94c9842cbee5b0b86cc07184ef71ad (patch) | |
| tree | 6d025cb26f1c0782206018d29dcf134a40de8834 /compiler/rustc_target/src/spec/mod.rs | |
| parent | ef972a346668ed4234d1a43ed4ad7ca4e9c58d51 (diff) | |
| parent | 1ef1af1c607fe268b5622041ff586ca603b8ec8d (diff) | |
| download | rust-bb544f863f94c9842cbee5b0b86cc07184ef71ad.tar.gz rust-bb544f863f94c9842cbee5b0b86cc07184ef71ad.zip | |
Rollup merge of #131037 - madsmtm:move-llvm-target-versioning, r=petrochenkov
Move versioned Apple LLVM targets from `rustc_target` to `rustc_codegen_ssa` Fully specified LLVM targets contain the OS version on macOS/iOS/tvOS/watchOS/visionOS, and this version depends on the deployment target environment variables like `MACOSX_DEPLOYMENT_TARGET`, `IPHONEOS_DEPLOYMENT_TARGET` etc. We would like to move this to later in the compilation pipeline, both because it feels impure to access environment variables when fetching target information, but mostly because we need access to more information from https://github.com/rust-lang/rust/pull/130883 to do https://github.com/rust-lang/rust/issues/118204. See also https://github.com/rust-lang/rust/pull/129342#issuecomment-2335156119 for some discussion. The first and second commit does the actual refactor, it should be a non-functional change, the third commit adds diagnostics for invalid deployment targets, which are now possible to do because we have access to the session. Tested with the same commands as in https://github.com/rust-lang/rust/pull/130435. r? ``````@petrochenkov``````
Diffstat (limited to 'compiler/rustc_target/src/spec/mod.rs')
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 3e7b42d3d1c..d518ed60469 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -65,10 +65,6 @@ pub mod abi { } mod base; -pub use base::apple::{ - deployment_target_for_target as current_apple_deployment_target, - platform as current_apple_platform, -}; pub use base::avr_gnu::ef_avr_arch; /// Linker is called through a C/C++ compiler. @@ -2009,7 +2005,12 @@ impl TargetWarnings { /// Every field here must be specified, and has no default value. #[derive(PartialEq, Clone, Debug)] pub struct Target { - /// Target triple to pass to LLVM. + /// Unversioned target triple to pass to LLVM. + /// + /// Target triples can optionally contain an OS version (notably Apple targets), which rustc + /// cannot know without querying the environment. + /// + /// Use `rustc_codegen_ssa::back::versioned_llvm_target` if you need the full LLVM target. pub llvm_target: StaticCow<str>, /// Metadata about a target, for example the description or tier. /// Used for generating target documentation. |
