On Tue, May 6, 2014 at 5:36 AM, Peter Caspers <pcaspers1...@gmail.com> wrote:
> yes, I use clang with the sanitize option to link. I have the
> following libs installed
>
> peter@peter-ThinkPad-W520:/usr/local/lib/clang/3.5.0/lib/linux$ ls
> libclang_rt.asan-x86_64.a   libclang_rt.lsan-x86_64.a
> libclang_rt.san-x86_64.a        libclang_rt.ubsan-x86_64.a
> libclang_rt.dfsan-x86_64.a  libclang_rt.msan-x86_64.a
> libclang_rt.tsan-x86_64.a
> libclang_rt.full-x86_64.a   libclang_rt.profile-x86_64.a
> libclang_rt.ubsan_cxx-x86_64.a
>
> You think that should work then ?
How do you invoke Clang? Are the sanitizer flags part of CFLAGS and CXXFLAGS?

Is this an Autools project? Sometimes you have to be creative with
Autotools projects. For example, you might need to do:

    export CC="clang -fsanitize=undefined -fsanitize=address"
    export CXX="clang -fsanitize=undefined -fsanitize=address
-fno-sanitize=vptr"

That's because there will sometimes be a link line that *omits* CFLAGS
and CXXFLAGS. For example:

    # Link using the compiler...
    $(CC) -o $(program_name) $(OBJECTS) $(LDFLAGS) $(LDLIBS)

On Mac OS X, I also find I need to set DYLD_FALLBACK_LIBRARY_PATH
before executing:

    export DYLD_FALLBACK_LIBRARY_PATH=/usr/local/lib/clang/3.4/lib/darwin/
    ./my_program

I don't recall doing similar on Linux. (But I may have done it and
forgotten about it).

Jeff
_______________________________________________
cfe-users mailing list
cfe-users@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-users

Reply via email to