summaryrefslogtreecommitdiff
path: root/libsanitizer
diff options
context:
space:
mode:
authorchefmax <chefmax@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-21 12:19:54 +0000
committerchefmax <chefmax@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-21 12:19:54 +0000
commitfb96547d150781cadf9b2a928fc3d3aaca733d1c (patch)
tree86e2a618afcde29289c3bef8c0129d1db3a35681 /libsanitizer
parent06777d85203d3f06fe0794a32076b654e006a21b (diff)
downloadgcc-fb96547d150781cadf9b2a928fc3d3aaca733d1c.tar.gz
Cherry-pick r266868 from upstream.
PR sanitizer/70624 * asan/asan_mac.cc: Cherry pick upstream r266868. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235338 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libsanitizer')
-rw-r--r--libsanitizer/ChangeLog5
-rw-r--r--libsanitizer/asan/asan_mac.cc6
2 files changed, 10 insertions, 1 deletions
diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog
index c6cdc09badc..1268507b92b 100644
--- a/libsanitizer/ChangeLog
+++ b/libsanitizer/ChangeLog
@@ -1,3 +1,8 @@
+2016-04-21 Maxim Ostapenko <m.ostapenko@samsung.com>
+
+ PR sanitizer/70624
+ * asan/asan_mac.cc: Cherry pick upstream r266868.
+
2016-01-19 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/68824
diff --git a/libsanitizer/asan/asan_mac.cc b/libsanitizer/asan/asan_mac.cc
index 20e37ffe7ef..ab3c6560825 100644
--- a/libsanitizer/asan/asan_mac.cc
+++ b/libsanitizer/asan/asan_mac.cc
@@ -97,10 +97,14 @@ void DisableReexec() {
reexec_disabled = true;
}
-extern "C" double dyldVersionNumber;
+extern "C" SANITIZER_WEAK_ATTRIBUTE double dyldVersionNumber;
static const double kMinDyldVersionWithAutoInterposition = 360.0;
bool DyldNeedsEnvVariable() {
+ // Although sanitizer support was added to LLVM on OS X 10.7+, GCC users
+ // still may want use them on older systems. On older Darwin platforms, dyld
+ // doesn't export dyldVersionNumber symbol and we simply return true.
+ if (!&dyldVersionNumber) return true;
// If running on OS X 10.11+ or iOS 9.0+, dyld will interpose even if
// DYLD_INSERT_LIBRARIES is not set. However, checking OS version via
// GetMacosVersion() doesn't work for the simulator. Let's instead check