[PATCH] D39888: [lsan] Only use VM_MEMORY_OS_ALLOC_ONCE on Darwin versions that support it

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 07:00:48 PST 2017


ro added a comment.

In https://reviews.llvm.org/D39888#924658, @kcc wrote:

> In https://reviews.llvm.org/D39888#924537, @dberris wrote:
>
> > If I understand correctly, the check should happen at CMake configuration time, so that lsan doesn't even build for versions of OS X that aren't even supported.
>
>
> I highly prefer conditionals in the code (*platform.h header) as opposed to cmake.


What's the advantage of doing that?  Checks (in cmake) like SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9" should work
just fine.

> Kuba, any idea how to guard against old versions of darwin?

In C, one can check  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__.  I've just successfully done so (again, in the gcc
tree).  Will upload the patch doing so here shortly...


https://reviews.llvm.org/D39888





More information about the llvm-commits mailing list