Hi Jakub,

>> --- a/libsanitizer/configure.ac
>> +++ b/libsanitizer/configure.ac
>> @@ -140,6 +140,24 @@ case "$host" in
>>  esac
>>  AM_CONDITIONAL(USING_MAC_INTERPOSE, $MAC_INTERPOSE)
>>  
>> +# lsan_common_mac.cc needs VM_MEMORY_OS_ALLOC_ONCE which was only
>> +# introduced in Mac OS X 10.9/Darwin 13.
>> +case "$host" in
>> +  *-*-darwin[[1-9]] | *-*-darwin[[1-9]].* | *-*-darwin1[[0-2]]*)
>> +    LSAN_COMMON=false ;;
>> +  *) LSAN_COMMON=true ;;
>> +esac
>> +AM_CONDITIONAL(LSAN_COMMON_SUPPORTED, $LSAN_COMMON)
>> +
>> +# Before Xcode 4.5, the Darwin linker doesn't properly support undefined
>> +# weak symbols.
>> +case "$host" in
>
> $host here and above?  Shouldn't that be $target instead?

AFAIU $host and $target are identical in target libraries, and the
majority of cases uses $host right now.

> That said, I think it would be better to move this stuff except for the
> AM_CONDITIONAL into configure.tgt similarly to how *_SUPPORTED is handled.

My reasoning was to have purely static based stuff like supported status
or additional compiler/linker flags in configure.tgt, while other tests
which might need configure checks go into configure.ac.

> 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.

> Note we already have similar thing in ubsan/ubsan_platform.h, where we
> want to override CAN_SANITIZE_UB from command line and need to patch that
> header for that, because upstream doesn't allow that :(.

I already mentioned that as a precedent for my lsan_common.h change.

        Rainer

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

Reply via email to