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

Kuba (Brecka) Mracek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 08:41:40 PST 2017


kubamracek 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. 
>  Kuba, any idea how to guard against old versions of darwin?


If the only problem here is that `VM_MEMORY_OS_ALLOC_ONCE` is not defined in older SDKs, then I suggest to simply copy the definition from the header and define something like `kSanitizerVmMemoryOsAllocOnce` ourselves (and add an explaining comment, of course). We certainly did that in other parts to avoid depending on the SDK.


https://reviews.llvm.org/D39888





More information about the llvm-commits mailing list