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

Sean McBride sean at rogue-research.com
Tue Mar 13 11:54:25 PDT 2012


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






More information about the cfe-dev mailing list