I'm trying to get address sanitizer working on FreeBSD 10.1 Release, but whenever I try to compile a program with -fsanitize=address
I get undefined references to _asan_stack_malloc_1
etc, etc. I found
https://forums.freebsd.org/threads/gcc-clang-address-sanitizer.47985/ on google but the suggestion of adding -L/usr/local/lib -I/usr/local/include
didn't resolve the linking issue. I tried the llvm binaries for FreeBSD but when I go to compile with that clang I get /usr/bin/../lib/clang/3.6.0/lib/freebsd/libclang_rt.asan-x86_64.a , no such file or directory.
. Either way I'm not sure what library I need to link or where it is.
Below is the program I tried compiling and here is the command I used,
clang -fsanitize=address san.c
#include <stdio.h>
int main(void)
{
return 0;
}
-L/usr/lib
or-L/lib
doesn't work either. – 2trill2spill/usr/bin/clang
` FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512` – 2trill2spill