[cfe-dev] Link error compiling with -faddress-sanitizer (___asan_init undefined)

Kostya Serebryany kcc at google.com
Tue Mar 13 12:03:09 PDT 2012


Sean,

Could you please run the same command line with "-v" to see what libraries
get linked in?

--kcc


On Tue, Mar 13, 2012 at 11:54 AM, Sean McBride <sean at rogue-research.com>wrote:

> Hi all,
>
> I'm trying to exactly follow the instructions here:
> <http://clang.llvm.org/docs/AddressSanitizer.html>
>
> Using the same test file and the same invocation:
>
> clang -O1 -g -faddress-sanitizer -fno-omit-frame-pointer
> example_UseAfterFree.cc
>
> But I get:
>
> Undefined symbols:
>  "___asan_report_load4", referenced from:
>      _main in test-w3FGxl.o
>  "___asan_init", referenced from:
>      _asan.module_ctor in test-w3FGxl.o
>
> This is on OS X 10.6.8 with clang r152633.  I also tried with -arch i386
> and -arch x86_64, no difference.  Is there some lib I'm supposed to link
> with... the docs don't seem to say so.
>
> Thanks,
>
> --
> ____________________________________________________________
> Sean McBride, B. Eng                 sean at rogue-research.com
> Rogue Research                        www.rogue-research.com
> Mac Software Developer              Montréal, Québec, Canada
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120313/56b15c7c/attachment.html>


More information about the cfe-dev mailing list