[Msan] Fix the backtrace.cc tests to build and pass on FreeBSD

Differential Revision: http://reviews.llvm.org/D9221

llvm-svn: 235703
This commit is contained in:
Viktor Kutuzov 2015-04-24 07:52:47 +00:00
parent de0d1f3c26
commit 0e15144ba1
3 changed files with 5 additions and 2 deletions

View File

@ -161,7 +161,7 @@
SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_SIGPENDING SI_NOT_WINDOWS
#define SANITIZER_INTERCEPT_SIGPROCMASK SI_NOT_WINDOWS
#define SANITIZER_INTERCEPT_BACKTRACE SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_BACKTRACE SI_FREEBSD || SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_GETMNTENT SI_LINUX
#define SANITIZER_INTERCEPT_GETMNTENT_R SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_STATFS SI_FREEBSD || SI_MAC || SI_LINUX_NOT_ANDROID

View File

@ -17,7 +17,7 @@ void f() {
char **s = backtrace_symbols(buf, sz);
assert(s > 0);
for (int i = 0; i < sz; ++i)
printf("%d\n", strlen(s[i]));
printf("%d\n", (int)strlen(s[i]));
}
int main(void) {

View File

@ -14,6 +14,9 @@ clang_msan_cflags = ["-fsanitize=memory",
"-fno-omit-frame-pointer",
"-fno-optimize-sibling-calls",
"-m64"] + config.debug_info_flags
# Some Msan tests leverage backtrace() which requires libexecinfo on FreeBSD.
if config.host_os == 'FreeBSD':
clang_msan_cflags += ["-lexecinfo"]
clang_msan_cxxflags = config.cxx_mode_flags + clang_msan_cflags
def build_invocation(compile_flags):