fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1# only-macos 2# 3# Check that a set deployment target actually makes it to the linker. 4# This is important since its a compatibility hazard. The linker will 5# generate load commands differently based on what minimum OS it can assume. 6 7include ../tools.mk 8 9ifeq ($(strip $(shell uname -m)),arm64) 10 GREP_PATTERN = "minos 11.0" 11else 12 GREP_PATTERN = "version 10.13" 13endif 14 15OUT_FILE=$(TMPDIR)/with_deployment_target.dylib 16all: 17 env MACOSX_DEPLOYMENT_TARGET=10.13 $(RUSTC) with_deployment_target.rs -o $(OUT_FILE) 18# XXX: The check is for either the x86_64 minimum OR the aarch64 minimum (M1 starts at macOS 11). 19# They also use different load commands, so we let that change with each too. The aarch64 check 20# isn't as robust as the x86 one, but testing both seems unneeded. 21 vtool -show-build $(OUT_FILE) | $(CGREP) -e $(GREP_PATTERN)