aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-10-18 08:48:58 +0100
committerIain Sandoe <iain@sandoe.co.uk>2020-10-18 20:55:58 +0100
commit476036b35c5e9203735b19b9967ff0e9932c8c31 (patch)
treed450743e6ed3f9f6ee3a81b9eb2cd0bfc75cbcb3
parentcd6cd6aed195b4ec7d652e8b41d60b60e174304e (diff)
downloadgcc-476036b35c5e9203735b19b9967ff0e9932c8c31.zip
gcc-476036b35c5e9203735b19b9967ff0e9932c8c31.tar.gz
gcc-476036b35c5e9203735b19b9967ff0e9932c8c31.tar.bz2
libsanitizer, Darwin, Bootstrap : Fix bootstrap on Darwin <= 15.
The latest upstream merge for libsanitizer introduces code that makes use of some macro values that are not available in SDKs for versions of Darwin <= 15 (macOS 10.11). Add definitions for these where they are not present. libsanitizer/ChangeLog: * sanitizer_common/sanitizer_mac.h: Ensure that TARGET_OS_ macros are defined where the macOS SDK does not contain them. (TARGET_OS_OSX, TARGET_OS_IOS, TARGET_OS_TV, TARGET_OS_WATCH): Define where needed.
-rw-r--r--libsanitizer/sanitizer_common/sanitizer_mac.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libsanitizer/sanitizer_common/sanitizer_mac.h b/libsanitizer/sanitizer_common/sanitizer_mac.h
index 023071e..a2c42b3 100644
--- a/libsanitizer/sanitizer_common/sanitizer_mac.h
+++ b/libsanitizer/sanitizer_common/sanitizer_mac.h
@@ -14,6 +14,26 @@
#include "sanitizer_common.h"
#include "sanitizer_platform.h"
+
+/* TARGET_OS_OSX is not present in SDKs before Darwin16 (macOS 10.12) use
+ TARGET_OS_MAC (we have no support for iOS in any form for these versions,
+ so there's no ambiguity). */
+#if !defined(TARGET_OS_OSX) && TARGET_OS_MAC
+# define TARGET_OS_OSX 1
+#endif
+
+/* Other TARGET_OS_xxx are not present on earlier versions, define them to
+ 0 (we have no support for them; they are not valid targets anyway). */
+#ifndef TARGET_OS_IOS
+#define TARGET_OS_IOS 0
+#endif
+#ifndef TARGET_OS_TV
+#define TARGET_OS_TV 0
+#endif
+#ifndef TARGET_OS_WATCH
+#define TARGET_OS_WATCH 0
+#endif
+
#if SANITIZER_MAC
#include "sanitizer_posix.h"