-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Pass deployment target to cc linker with -m*-version-min=
#136333
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: master
Are you sure you want to change the base?
Conversation
Clang supports many ways of passing the deployment target, and prefers that you use the `-target` flag for doing so. This works poorly work with configuration files and Zig CC though, so we use the older `-mmacosx-version-min=`, `-miphoneos-version-min=`, `-mtargetos=` etc. flags to pass the deployment target instead.
r? compiler |
See rust-lang/cc-rs#1339 (comment); the cc-rs change may need to be improved. |
Yeah, the |
The related @rustbot author |
@madsmtm Any update on this PR? Thanks for your contribution. |
☔ The latest upstream changes (presumably #139037) made this pull request unmergeable. Please resolve the merge conflicts. |
No update, I'll try to get back to it, but I need to think a bit to ensure that this is the right approach. |
Clang supports many ways of passing the deployment target, and prefers that you use the
-target
flag for doing so. This, however, works poorly work with Clang configuration files (at least before llvm/llvm-project#111387) and Zig CC.To support GCC, we already passed the deployment target using the older, more widely supported
-arch
+-mmacosx-version-min=
flag combination when compiling for macOS; let's do a similar thing for the other Apple targets too using-miphoneos-version-min=
,-mtargetos=
etc.Note that when passing the target triple to the LLVM backend, we still have to merge the deployment target into that.
See also the similar fix in
cc-rs
where the problem is more prominent, exactly because we did not already do it for macOS.@rustbot label O-apple
r? compiler
CC @thomcc @BlackHoleFox