The OS version is specified in -target should be used instead of the one in an environment variable / SDK name.
rdar://35813850
Paths
| Differential D40998
[driver][darwin] Take the OS version specified in "-target" as the target OS instead of inferring it from SDK / environment ClosedPublic Authored by arphaman on Dec 7 2017, 6:58 PM.
Details
Summary The OS version is specified in -target should be used instead of the one in an environment variable / SDK name. rdar://35813850
Diff Detail
Event Timelinedexonsmith added inline comments.
This revision now requires changes to proceed.Dec 7 2017, 7:31 PM arphaman added a parent revision: D41035: [driver][darwin] Refactor the target selection code, NFC.Dec 8 2017, 2:49 PM Comment ActionsPreparation refactoring patch: https://reviews.llvm.org/D41035 arphaman edited edge metadata. Comment ActionsI rewrote the patch on top of https://reviews.llvm.org/D41035 as suggested by Duncan. I also changed some of the semantics:
bob.wilson added inline comments.
This revision now requires changes to proceed.Dec 9 2017, 9:26 PM arphaman edited edge metadata. arphaman marked an inline comment as done. Comment ActionsDon't warn about the redundant environment variable This revision was not accepted when it landed; it landed in state Needs Review.Dec 19 2017, 11:05 AM Closed by commit rC321099: [driver][darwin] Take the OS version specified in "-target" as the target (authored by arphaman). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 126388 lib/Driver/ToolChains/Darwin.cpp
test/Driver/darwin-version.c
test/Driver/objc-weak.m
test/Driver/pic.c
test/Driver/unavailable_aligned_allocation.cpp
|
This logic seems to be duplicated from the -target handling below. Perhaps this would be simpler if -target were processed first.
I suggest the following refactoring in an NFC prep patch:
In a follow-up patch, change -isysroot/SDKROOT not to override a -target-specified environment (the semantic change from this patch). After the refactoring, I suspect this will be trivial.
We should also warn/error when -arch disagrees with -target, and likely the same for -m*-version-min. I suspect these follow-ups will also be trivial.