Hi,
I have not built with asan with clang on the mac. I have built for RHEL 6 and
7. I had to configure with these options.
CXXFLAGS -fno-omit-frame-pointer -fsanitize=address -static-libasan\
CFLAGS="-fno-omit-frame-pointer -fsanitize=address
-static-libasan"\--disable-freelist\LUA_LDFLAGS="-fno-omit-frame-pointer
-fsanitize=address -pthread -static-libasan"
This seemed to work for me. On newer systems i was having issues with Lua
breaking the build as the tools has memory leaks in it. You can work around it
by disabling Lua or just trying to add flags to CXXFLAGS at risk that something
might not be reported correctly in the lua and or c code.
On linux at least if i was getting link errors it was because the libasan
library was not installed.
The mac from my experience is different from linux so this might not translate
to the mac 100%
Hope this helpsĀ JasonĀ
From: Masakazu Kitajo <[email protected]>
To: [email protected]
Sent: Tuesday, January 12, 2016 2:40 AM
Subject: Build with ASAN
Hi there,
I can enable ASAN with -fsanitize=address flag but I also needed to remove
-no-undefined flag manually from some modules' Makefiles.
Without the modification, I get link errors such like below:
https://paste.apache.org/5sR6
According to the wiki, it seems we can't use ASAN with -no-undefined.
https://github.com/google/sanitizers/wiki/AddressSanitizer
So my questions are:
- How do you enable ASAN? (How/Where do you specify the flag?)
- How can I avoid the link error without manual modifications?
My build environment is OS X (Yosemite) with Apple LLVM version 7.0.2
(clang-700.1.81)
Thanks,
Masakazu