https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70624

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iains at gcc dot gnu.org

--- Comment #9 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Dominique d'Humieres from comment #8)
> This is fixed on x86_64-apple-darwin10 without regression on
> x86_64-apple-darwin15 by the following patch
> 
> --- ../_clean/libsanitizer/asan/asan_mac.cc   2015-11-23 10:17:05.000000000
> +0100
> +++ libsanitizer/asan/asan_mac.cc     2016-04-15 13:22:01.000000000 +0200
> @@ -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 Darwin 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 can 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

This looks good to (and works for) me; 
please can we ask for this to be committed "upstream" and then imported?

BTW, there _are_ folks using both GCC and LLVM on Darwin10 for "day job" stuff,
so it is still very much of interest.

Reply via email to