File tree 3 files changed +29
-22
lines changed
tests/run-make/macos-deployment-target
3 files changed +29
-22
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ run-make/libtest-junit/Makefile
16
16
run-make/libtest-thread-limit/Makefile
17
17
run-make/long-linker-command-lines-cmd-exe/Makefile
18
18
run-make/long-linker-command-lines/Makefile
19
- run-make/macos-deployment-target/Makefile
20
19
run-make/min-global-align/Makefile
21
20
run-make/native-link-modifier-bundle/Makefile
22
21
run-make/no-alloc-shim/Makefile
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ // Check that a set deployment target actually makes it to the linker.
2
+ // This is important since its a compatibility hazard. The linker will
3
+ // generate load commands differently based on what minimum OS it can assume.
4
+ // See https://github.com/rust-lang/rust/pull/105123
5
+
6
+ //@ only-macos
7
+
8
+ use run_make_support:: { cmd, rustc} ;
9
+
10
+ fn main ( ) {
11
+ rustc ( )
12
+ . env ( "MACOSX_DEPLOYMENT_TARGET" , "10.13" )
13
+ . input ( "with_deployment_target.rs" )
14
+ . output ( "with_deployment_target.dylib" )
15
+ . run ( ) ;
16
+ let pattern = if cmd ( "uname" ) . arg ( "-m" ) . run ( ) . stdout_utf8 ( ) . contains ( "arm64" ) {
17
+ "minos 11.0"
18
+ } else {
19
+ "version 10.13"
20
+ } ;
21
+ // XXX: The check is for either the x86_64 minimum OR the aarch64 minimum
22
+ // (M1 starts at macOS 11). They also use different load commands, so we let that change with
23
+ // each too. The aarch64 check isn't as robust as the x86 one, but testing both seems unneeded.
24
+ cmd ( "vtool" )
25
+ . arg ( "-show-build" )
26
+ . arg ( "with_deployment_target.dylib" )
27
+ . run ( )
28
+ . assert_stdout_contains ( "pattern" ) ;
29
+ }
You can’t perform that action at this time.
0 commit comments