From d04e0d72925c28e82528018718b507d32e65f66f Mon Sep 17 00:00:00 2001 From: Viktor Kutuzov Date: Wed, 6 May 2015 09:24:02 +0000 Subject: [Msan] Fix the ifaddrs.cc test to build and pass on FreeBSD Differential Revision: http://reviews.llvm.org/D9457 llvm-svn: 236579 --- compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h | 3 ++- compiler-rt/test/msan/ifaddrs.cc | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'compiler-rt') 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 +#if defined(__FreeBSD__) +#include // To define 'struct sockaddr'. +#endif + #include #define CHECK_AND_PUSH(addr, size) \ -- cgit v1.2.3