This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [libsanitizer] Fix Mac OS X 10.7 bootstrap (PR sanitizer/82824)


Hi Jakub,

> On Tue, Nov 14, 2017 at 01:57:21PM +0100, Rainer Orth wrote:
>> > And the preexisting:
>> > case "$host" in
>> >   *-*-darwin*) MAC_INTERPOSE=true ; enable_static=no ;;
>> >   *) MAC_INTERPOSE=false ;;
>> > esac
>> > AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
>> > looks wrong too.
>> 
>> Wrong in which way?  Just the location?
>> 
>> >> --- a/libsanitizer/lsan/lsan_common.h
>> >> +++ b/libsanitizer/lsan/lsan_common.h
>> >> @@ -20,6 +20,7 @@
>> >>  #include "sanitizer_common/sanitizer_stoptheworld.h"
>> >>  #include "sanitizer_common/sanitizer_symbolizer.h"
>> >>  
>> >> +#ifndef CAN_SANITIZE_LEAKS
>> >
>> > Obviously better would be to move the Darwin version checks here, but if
>> > upstream refuses to do that, we can do it this way too.
>> 
>> Kostya suggested the same.  I see now that
>> sanitizer_common/sanitizer_platform_interceptors.h already uses
>> __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__, so I'll give it a try.
>
> Any progress with this?

I've been using the following in my tree.  Still need to try and get
this upstream.

Speaking of which, would it be acceptable to do another full
libsanitizer merge at this point?  My initial Solaris port has landed
now, and the necessary changes outside of libsanitizer are almost
exclusively in Solaris-specific files.  I've already gave it a quick try
and found no regressions on Linux/x86_64.

	Rainer

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


diff --git a/libsanitizer/sanitizer_common/sanitizer_internal_defs.h b/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
--- a/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
+++ b/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
@@ -63,7 +63,13 @@
 // SANITIZER_SUPPORTS_WEAK_HOOKS means that we support real weak functions that
 // will evaluate to a null pointer when not defined.
 #ifndef SANITIZER_SUPPORTS_WEAK_HOOKS
-#if (SANITIZER_LINUX || SANITIZER_MAC) && !SANITIZER_GO
+#if SANITIZER_LINUX && !SANITIZER_GO
+# define SANITIZER_SUPPORTS_WEAK_HOOKS 1
+// Before Xcode 4.5, the Darwin linker doesn't reliably support undefined
+// weak symbols.  Mac OS X 10.9/Darwin 13 is the first release only supported
+// by Xcode >= 4.5.
+#elif SANITIZER_MAC && \
+    __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1090 && !SANITIZER_GO
 # define SANITIZER_SUPPORTS_WEAK_HOOKS 1
 #else
 # define SANITIZER_SUPPORTS_WEAK_HOOKS 0

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]