forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#105123 - BlackHoleFox:fixing-the-macos-depl…
…oyment, r=oli-obk Fix passing MACOSX_DEPLOYMENT_TARGET to the linker I messed up in rust-lang#103929 when merging the two base files together and as a result, started ignoring `MACOSX_DEPLOYMENT_TARGET` at the linker level. This ended up being the cause of nighty builds not running on older macOS versions. My original hope with the previous PR was that CI would have caught something like that but there were only tests checking the compiler target definitions in codegen tests. Because of how badly this sucks to break, I put together a new test via `run-make` that actually confirms the deployment target set makes it to the linker instead of just LLVM. Closes rust-lang#104570 (for real this time)
- Loading branch information
Showing
7 changed files
with
76 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# only-macos | ||
# | ||
# Check that a set deployment target actually makes it to the linker. | ||
# This is important since its a compatibility hazard. The linker will | ||
# generate load commands differently based on what minimum OS it can assume. | ||
|
||
include ../../run-make-fulldeps/tools.mk | ||
|
||
ifeq ($(strip $(shell uname -m)),arm64) | ||
GREP_PATTERN = "minos 11.0" | ||
else | ||
GREP_PATTERN = "version 10.9" | ||
endif | ||
|
||
OUT_FILE=$(TMPDIR)/with_deployment_target.dylib | ||
all: | ||
env MACOSX_DEPLOYMENT_TARGET=10.9 $(RUSTC) with_deployment_target.rs -o $(OUT_FILE) | ||
# XXX: The check is for either the x86_64 minimum OR the aarch64 minimum (M1 starts at macOS 11). | ||
# They also use different load commands, so we let that change with each too. The aarch64 check | ||
# isn't as robust as the x86 one, but testing both seems unneeded. | ||
vtool -show-build $(OUT_FILE) | $(CGREP) -e $(GREP_PATTERN) |
4 changes: 4 additions & 0 deletions
4
src/test/run-make/macos-deployment-target/with_deployment_target.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#![crate_type = "cdylib"] | ||
|
||
#[allow(dead_code)] | ||
fn something_and_nothing() {} |