[compiler-rt] r182372 - [nolibc] Move symbolizer to RTSanitizerCommonLibc, and make it optional using a weak symbol.

Timur Iskhodzhanov timurrrr at google.com
Mon May 27 07:05:10 PDT 2013


2013/5/27 Alexey Samsonov <samsonov at google.com>:
>
> On Mon, May 27, 2013 at 5:41 PM, Peter Collingbourne <peter at pcc.me.uk>
> wrote:
>>
>> On Thu, May 23, 2013 at 06:21:33PM +0400, Alexey Samsonov wrote:
>> > Can we use existing SANITIZER_SUPPORTS_WEAK_HOOKS macro to fix this?
>>
>> We could enclose the "&& SymbolizeCode" part in an ifdef, but I think this
>> would be kind of ugly.
>>
>> One idea I had was to define a macro like this:
>>
>> #if SANITIZER_WINDOWS
>> # define SANITIZER_HAS_WEAK_SYMBOL(s) 1
>> #else
>> # define SANITIZER_HAS_WEAK_SYMBOL(s) (&(s))
>> #endif
>
>
> I like this idea.
+1

>>
>>
>> Then we can just write:
>>
>> if (symbolize && addr_frames_num == 0 &&
>>     SANITIZER_HAS_WEAK_SYMBOL(SymbolizeCode)) {
>>
>> which would probably be more readable.  There are a few more places
>> where we'd be able to use this macro, I believe.
>>
>> Thanks,
>> --
>> Peter
>
>
>
>
> --
> Alexey Samsonov, MSK



More information about the llvm-commits mailing list