Hi Jakub,

>> On Mon, Dec 18, 2017 at 11:21:35AM +0100, Rainer Orth wrote:
>>> I've been using the following in my tree.  Still need to try and get
>>> this upstream.
>>
>> Please.  If that doesn't work, I think we need to do it in configure,
>> sanitizer_internal_defs.h seems to be included very early, so there
>> is no easy header to override say in include/system/ tree.
>
> done now as https://reviews.llvm.org/D41346.  Together with the revised
> version of https://reviews.llvm.org/D39888 this has restored Darwin 11
> build and sanitizer testing for me for quite some time.

both patches have now been approved upstream and the second one was
installed already.  Bootstrapped on x86_64-apple-darwin11.4.2.  Is this
ok now for mainline?

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2018-01-13  Rainer Orth  <r...@cebitec.uni-bielefeld.de>

        PR sanitizer/82824
        * lsan/lsan_common_mac.cc: Cherry-pick upstream r322437.

# HG changeset patch
# Parent  5a47a5ded615a8757277869e03afe2337e6de3d4
Fix Mac OS X 10.7 bootstrap

diff --git a/libsanitizer/lsan/lsan_common_mac.cc b/libsanitizer/lsan/lsan_common_mac.cc
--- a/libsanitizer/lsan/lsan_common_mac.cc
+++ b/libsanitizer/lsan/lsan_common_mac.cc
@@ -22,6 +22,13 @@
 
 #include <mach/mach.h>
 
+// Only introduced in Mac OS X 10.9.
+#ifdef VM_MEMORY_OS_ALLOC_ONCE
+static const int kSanitizerVmMemoryOsAllocOnce = VM_MEMORY_OS_ALLOC_ONCE;
+#else
+static const int kSanitizerVmMemoryOsAllocOnce = 73;
+#endif
+
 namespace __lsan {
 
 typedef struct {
@@ -155,7 +162,7 @@ void ProcessPlatformSpecificAllocations(
 
     // libxpc stashes some pointers in the Kernel Alloc Once page,
     // make sure not to report those as leaks.
-    if (info.user_tag == VM_MEMORY_OS_ALLOC_ONCE) {
+    if (info.user_tag == kSanitizerVmMemoryOsAllocOnce) {
       ScanRangeForPointers(address, end_address, frontier, "GLOBAL",
                            kReachable);
 

Reply via email to