Skip to content

Commit

Permalink
Auto merge of #129369 - madsmtm:apple-cc-linker-pass-target, r=jieyouxu
Browse files Browse the repository at this point in the history
Pass deployment target when linking with CC on Apple targets

This PR effectively implements what's also being considered in the `cc` crate [here](rust-lang/cc-rs#1030 (comment)), that is:
- When linking macOS targets with CC, pass the `-mmacosx-version-min=.` option to specify the desired deployment target. Also, no longer pass `-m32`/`-m64`, these are redundant since we already pass `-arch`.
- When linking with CC on iOS, tvOS, watchOS and visionOS, only pass `-target` (we assume for these targets that CC forwards to Clang).

This is required to get the linker to emit the correct `LC_BUILD_VERSION` of the final binary. See rust-lang/rust#129432 for more motivation behind this change.

r? compiler

CC `@BlackHoleFox`
  • Loading branch information
bors committed Sep 12, 2024
2 parents 599b3bd + 3cb436f commit efd4265
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit efd4265

Please sign in to comment.