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

Peter Collingbourne peter at pcc.me.uk
Mon May 27 06:41:08 PDT 2013


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

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



More information about the llvm-commits mailing list