The attached patch fixes PR sanitizer/78267 by conditionalizing the
include of <os/trace.h> on the compiler defining __BLOCKS__ as a
supported extension. Passes bootstrap on x86_64-apple-darwin15. Okay
for gcc trunk?
2016-11-14  Jack Howarth  <howarth.at....@gmail.com>

libsanitizer/

        PR sanitizer/78267
        * sanitizer_common/sanitizer_mac.cc: Include <os/trace.h> only if
        compiler supports blocks extension.


Index: libsanitizer/sanitizer_common/sanitizer_mac.cc
===================================================================
--- libsanitizer/sanitizer_common/sanitizer_mac.cc      (revision 242387)
+++ libsanitizer/sanitizer_common/sanitizer_mac.cc      (working copy)
@@ -34,7 +34,7 @@
 extern char **environ;
 #endif
 
-#if defined(__has_include) && __has_include(<os/trace.h>)
+#if defined(__has_include) && __has_include(<os/trace.h>) && 
defined(__BLOCKS__)
 #define SANITIZER_OS_TRACE 1
 #include <os/trace.h>
 #else

Reply via email to