[cfe-dev] i386 -faddress-sanitizer

Eli Friedman eli.friedman at gmail.com
Wed Oct 17 15:27:19 PDT 2012


On Wed, Oct 17, 2012 at 1:43 PM, Carsten Mattner
<carstenmattner at gmail.com> wrote:
> Is it expected that -faddress-sanitizer  does not work on i386 and fails
> to properly link resulting in errors like 'undefined symbol: __asan_init'
> at runtime?
>
> I have ./lib/clang/3.2/lib/linux/libclang_rt.asan-i386.a in llvm's installation,
> but it doesn't look like it's linked automatically into the executable.
>
> CFLAGS:
> -faddress-sanitizer -O1 -fno-omit-frame-pointer -g $PROJECT_FLAGS

You need to pass in -faddress-sanitizer both when compiling and when
linking an application.  Try something like
"LDFLAGS=-faddress-sanitizer".

-Eli



More information about the cfe-dev mailing list