about summary refs log tree commit diff
path: root/compiler/rustc_driver_impl/src
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2023-07-26 20:18:03 -0700
committerKeith Smiley <keithbsmiley@gmail.com>2023-08-21 13:31:57 -0700
commitd37fdc95d4558460f09e40e12ec83a0fc1779702 (patch)
tree661722eda9516a5a5ca2ed4ab0e5bb22c92cb53c /compiler/rustc_driver_impl/src
parentfe5f5912579d02c4e6088c89574493dfa988531a (diff)
downloadrust-d37fdc95d4558460f09e40e12ec83a0fc1779702.tar.gz
rust-d37fdc95d4558460f09e40e12ec83a0fc1779702.zip
Always add LC_BUILD_VERSION for metadata object files
As of Xcode 15 Apple's linker has become a bit more strict about the
warnings it produces. One of those new warnings requires all valid
Mach-O object files in an archive to have a LC_BUILD_VERSION load
command:

```
ld: warning: no platform load command found in 'ARCHIVE[arm64][2106](lib.rmeta)', assuming: iOS-simulator
```

This was already being done for Mac Catalyst so this change expands this
logic to include it for all Apple platforms. I filed this behavior
change as FB12546320 and was told it was the new intentional behavior.
Diffstat (limited to 'compiler/rustc_driver_impl/src')
-rw-r--r--compiler/rustc_driver_impl/src/lib.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/rustc_driver_impl/src/lib.rs b/compiler/rustc_driver_impl/src/lib.rs
index 7bbed0877f0..4df4cc7a71c 100644
--- a/compiler/rustc_driver_impl/src/lib.rs
+++ b/compiler/rustc_driver_impl/src/lib.rs
@@ -858,11 +858,9 @@ fn print_crate_info(
                 use rustc_target::spec::current_apple_deployment_target;
 
                 if sess.target.is_like_osx {
-                    println_info!(
-                        "deployment_target={}",
-                        current_apple_deployment_target(&sess.target)
-                            .expect("unknown Apple target OS")
-                    )
+                    let (major, minor) = current_apple_deployment_target(&sess.target)
+                        .expect("unknown Apple target OS");
+                    println_info!("deployment_target={}", format!("{major}.{minor}"))
                 } else {
                     handler
                         .early_error("only Apple targets currently support deployment version info")