-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Make SANITIZER_MIN_OSX_VERSION a cache variable #74394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@vitalybuka @ramosian-glider @kcc Kindly requesting a review on this patch. Thanks in advance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but please wait a few days for others feedback
@petrhosek For CMAKE expertise
8965bac
to
96afdbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me summarize my understanding: the intention here is to promote SANITIZER_MIN_OSX_VERSION
to a CMAKE cache variable. We don't change any behavior or default.
LGTM, thanks!
@rsundahl @thetruestblue
At some point we should think about bumping the minimal sanitizer target enabling some cleanups.
Your understanding is correct! No changes in behavior, just allowing people to tweak it easier.
One of the main reasons behind me putting up this review is I found a handful of things that would be cleaned up (allowing sanitizers to hook into calls introduced in newer MacOS versions). Once this is merged, I'm going to put up a few more in this series based on what I found! I'll make sure to add you to those reviews to get your thoughts @yln . Thanks for the review. |
Pinging either: @rsundahl for a review Or one of my previous reviewers with write access for a merge, if appropriate. Thanks! |
Pinging either: @rsundahl for a review Or one of my previous reviewers with write access for a merge, if appropriate. |
It is desirable to be able to configure the `-mmacosx-version-min` flag for the sanitizers, but this flag was never made a CACHE variable in cmake. By doing this, it will allow developers to select different minimum versions, which results in different interceptors being enabled or disabled on their platforms. This version can now persist between cmake runs, so it can be remembered by cmake, and edited in the cache file.
This does actually change behavior. If |
Agreed on your analysis @jfgoog . I see that on subsequent runs, I think this patch would fix the problem, while maintaining the flexibility of this PR? Essentially hoisting the regex match out of the if statement. WDYT?
|
That seems reasonable, but I am hardly an expert here. The underlying issue for me, though, which pre-dates your change, is that it seems like if the |
Pinging a couple experts to weigh in (as I am hardly an expert either) Pending on when they get back to us, if this is a blocking issue for rust you should file a bug report for this. I wouldn't want this "buried" in this PR with just us two talking about it |
It's not blocking. It only happens with newer versions of the cc crate, and the rustc bootstrap code has an old version pinned that doesn't have this problem. |
I put up a review to at least revert this to the previous way of doing things: I understand this doesn't fix your "bigger" issue, but I agree that something about that smells fishy. |
…s of CMake in compiler-rt (#87580) As discussed here: #74394 (comment) An unintentional change of behavior was introduced in #74394 This code introduced in #74394 : The first time through * SANITIZER_MIN_OSX_VERSION is not set * parse -mmacosx-version-min and set MACOSX_VERSION_MIN_FLAG * Set and cache SANITIZER_MIN_OSX_VERSION Subsequent times through: * SANITIZER_MIN_OSX_VERSION is cached * (BUG!!) you don't parse -mmacosx-version-min, and don't set MACOSX_VERSION_MIN_FLAG MACOSX_VERSION_MIN_FLAG is used later in the file on this line: https://github.com/llvm/llvm-project/blob/63c925ca808f216f805b76873743450456e350f2/compiler-rt/cmake/config-ix.cmake#L517 Hoisting this assignment outside the if block returns us to the previous behavior before this commit, while maintaining the flexibility introduced with the cache variable
It is desirable to be able to configure the
-mmacosx-version-min
flag for the sanitizers, but this flag was never made a CACHE variable in cmake.By doing this, it will allow developers to select different minimum versions, which results in different interceptors being enabled or disabled on their platforms. This version can now persist between cmake runs, so it can be remembered by cmake, and edited in the cache file.