[PATCH] [Msan] Fix the backtrace.cc tests to build and pass on FreeBSD
Phabricator
reviews at reviews.llvm.org
Fri Apr 24 00:56:12 PDT 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D9221
Files:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
compiler-rt/trunk/test/msan/backtrace.cc
compiler-rt/trunk/test/msan/lit.cfg
Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
===================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -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
Index: compiler-rt/trunk/test/msan/lit.cfg
===================================================================
--- compiler-rt/trunk/test/msan/lit.cfg
+++ compiler-rt/trunk/test/msan/lit.cfg
@@ -14,6 +14,9 @@
"-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):
Index: compiler-rt/trunk/test/msan/backtrace.cc
===================================================================
--- compiler-rt/trunk/test/msan/backtrace.cc
+++ compiler-rt/trunk/test/msan/backtrace.cc
@@ -17,7 +17,7 @@
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) {
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9221.24360.patch
Type: text/x-patch
Size: 1843 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150424/ff980229/attachment.bin>
More information about the llvm-commits
mailing list