summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Kutuzov <vkutuzov@accesssoftek.com>2015-05-06 09:24:02 +0000
committerViktor Kutuzov <vkutuzov@accesssoftek.com>2015-05-06 09:24:02 +0000
commitd04e0d72925c28e82528018718b507d32e65f66f (patch)
tree53223fd890fa6a8b956cd9e48951daa1d92c8a04
parent62c78f547471aaccf639f6ec32bf3e633bc4effd (diff)
downloadbcm5719-llvm-d04e0d72925c28e82528018718b507d32e65f66f.tar.gz
bcm5719-llvm-d04e0d72925c28e82528018718b507d32e65f66f.zip
[Msan] Fix the ifaddrs.cc test to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9457 llvm-svn: 236579
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h3
-rw-r--r--compiler-rt/test/msan/ifaddrs.cc4
2 files changed, 6 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
index 157fa59b371..59bb67e66c1 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -222,7 +222,8 @@
#define SANITIZER_INTERCEPT_LISTXATTR SI_LINUX
#define SANITIZER_INTERCEPT_GETXATTR SI_LINUX
#define SANITIZER_INTERCEPT_GETRESID SI_LINUX
-#define SANITIZER_INTERCEPT_GETIFADDRS SI_LINUX_NOT_ANDROID || SI_MAC
+#define SANITIZER_INTERCEPT_GETIFADDRS \
+ SI_FREEBSD || SI_LINUX_NOT_ANDROID || SI_MAC
#define SANITIZER_INTERCEPT_IF_INDEXTONAME SI_LINUX_NOT_ANDROID || SI_MAC
#define SANITIZER_INTERCEPT_CAPGET SI_LINUX_NOT_ANDROID
#define SANITIZER_INTERCEPT_AEABI_MEM SI_LINUX && defined(__arm__)
diff --git a/compiler-rt/test/msan/ifaddrs.cc b/compiler-rt/test/msan/ifaddrs.cc
index 568e6615bde..6f5eb935ab5 100644
--- a/compiler-rt/test/msan/ifaddrs.cc
+++ b/compiler-rt/test/msan/ifaddrs.cc
@@ -10,6 +10,10 @@
#include <vector>
+#if defined(__FreeBSD__)
+#include <sys/socket.h> // To define 'struct sockaddr'.
+#endif
+
#include <sanitizer/msan_interface.h>
#define CHECK_AND_PUSH(addr, size) \
OpenPOWER on IntegriCloud