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

Alexey Samsonov samsonov at google.com
Thu May 23 07:21:33 PDT 2013


Can we use existing SANITIZER_SUPPORTS_WEAK_HOOKS macro to fix this?


On Thu, May 23, 2013 at 5:32 PM, Peter Collingbourne <peter at pcc.me.uk>wrote:

> On Thu, May 23, 2013 at 04:54:56PM +0400, Timur Iskhodzhanov wrote:
> > 2013/5/21 Peter Collingbourne <peter at pcc.me.uk>:
> > > Modified:
> compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
> > > URL:
> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc?rev=182372&r1=182371&r2=182372&view=diff
> > >
> ==============================================================================
> > > --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc
> (original)
> > > +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_stacktrace.cc Tue
> May 21 07:08:37 2013
> > > @@ -85,7 +85,7 @@ void StackTrace::PrintStack(const uptr *
> > >          frame_num++;
> > >        }
> > >      }
> > > -    if (symbolize && addr_frames_num == 0) {
> > > +    if (symbolize && addr_frames_num == 0 && SymbolizeCode) {
> > >        // Use our own (online) symbolizer, if necessary.
> > >        addr_frames_num = SymbolizeCode(pc, addr_frames.data(),
> > >                                        addr_frames.size());
> >
> > Peter,
> >
> > Can you please clarify why you've changed this condition?
> > This gives a compiler warning when building on Windows (Visual Studio)
> > as SymbolizeCode is a function name (not function pointer), I believe.
>
> The patch turns SymbolizeCode into a weak symbol using the
> SANITIZER_WEAK_ATTRIBUTE macro, in order to make the symboliser
> optional.  This macro is defined to be empty on Windows, which
> is probably the cause of the problem.
>
> Thanks,
> --
> Peter
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130523/ac7f8089/attachment.html>


More information about the llvm-commits mailing list