[cfe-dev] i386 -faddress-sanitizer

Carsten Mattner carstenmattner at gmail.com
Thu Oct 18 06:12:54 PDT 2012


On Thu, Oct 18, 2012 at 12:27 AM, Eli Friedman wrote:
> 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".

Oh that makes a lot of sense and is kind of obvious in hindsight.
Yet it didn't work in a quick test. Any options I flags to pass for
verbose printfs to see what's happening you can suggest?
In the next test I'll also try to explicitly link the libasan archive
manually for ruling out issues with that archive.



More information about the cfe-dev mailing list