[PATCH] [Msan] Fix the ifaddrs.cc test to build and pass on FreeBSD

Phabricator reviews at reviews.llvm.org
Wed May 6 02:27:37 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9457

Files:
  compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
  compiler-rt/trunk/test/msan/ifaddrs.cc

Index: compiler-rt/trunk/test/msan/ifaddrs.cc
===================================================================
--- compiler-rt/trunk/test/msan/ifaddrs.cc
+++ compiler-rt/trunk/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)                                \
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
@@ -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__)

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9457.25021.patch
Type: text/x-patch
Size: 1271 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150506/80759e42/attachment.bin>


More information about the llvm-commits mailing list