[compiler-rt] r193244 - [sanitizer] Fix OSX build.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Wed Oct 23 08:21:10 PDT 2013


Author: eugenis
Date: Wed Oct 23 10:21:10 2013
New Revision: 193244

URL: http://llvm.org/viewvc/llvm-project?rev=193244&view=rev
Log:
[sanitizer] Fix OSX build.

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc?rev=193244&r1=193243&r2=193244&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors.inc Wed Oct 23 10:21:10 2013
@@ -2430,14 +2430,6 @@ INTERCEPTOR(char *, ether_ntoa, __saniti
   if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(ctx, res, REAL(strlen)(res) + 1);
   return res;
 }
-INTERCEPTOR(char *, ether_ntoa_r, __sanitizer_ether_addr *addr, char *buf) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, ether_ntoa_r, addr, buf);
-  if (addr) COMMON_INTERCEPTOR_READ_RANGE(ctx, addr, sizeof(*addr));
-  char *res = REAL(ether_ntoa_r)(addr, buf);
-  if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
-  return res;
-}
 INTERCEPTOR(__sanitizer_ether_addr *, ether_aton, char *buf) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, ether_aton, buf);
@@ -2446,15 +2438,6 @@ INTERCEPTOR(__sanitizer_ether_addr *, et
   if (res) COMMON_INTERCEPTOR_INITIALIZE_RANGE(ctx, res, sizeof(*res));
   return res;
 }
-INTERCEPTOR(__sanitizer_ether_addr *, ether_aton_r, char *buf,
-            __sanitizer_ether_addr *addr) {
-  void *ctx;
-  COMMON_INTERCEPTOR_ENTER(ctx, ether_aton_r, buf, addr);
-  if (buf) COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, REAL(strlen)(buf) + 1);
-  __sanitizer_ether_addr *res = REAL(ether_aton_r)(buf, addr);
-  if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, sizeof(*res));
-  return res;
-}
 INTERCEPTOR(int, ether_ntohost, char *hostname, __sanitizer_ether_addr *addr) {
   void *ctx;
   COMMON_INTERCEPTOR_ENTER(ctx, ether_ntohost, hostname, addr);
@@ -2487,8 +2470,6 @@ INTERCEPTOR(int, ether_line, char *line,
   return res;
 }
 #define INIT_ETHER                   \
-  INTERCEPT_FUNCTION(ether_ntoa_r);  \
-  INTERCEPT_FUNCTION(ether_aton_r);  \
   INTERCEPT_FUNCTION(ether_ntoa);    \
   INTERCEPT_FUNCTION(ether_aton);    \
   INTERCEPT_FUNCTION(ether_ntohost); \
@@ -2498,6 +2479,31 @@ INTERCEPTOR(int, ether_line, char *line,
 #define INIT_ETHER
 #endif
 
+#if SANITIZER_INTERCEPT_ETHER_R
+INTERCEPTOR(char *, ether_ntoa_r, __sanitizer_ether_addr *addr, char *buf) {
+  void *ctx;
+  COMMON_INTERCEPTOR_ENTER(ctx, ether_ntoa_r, addr, buf);
+  if (addr) COMMON_INTERCEPTOR_READ_RANGE(ctx, addr, sizeof(*addr));
+  char *res = REAL(ether_ntoa_r)(addr, buf);
+  if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, REAL(strlen)(res) + 1);
+  return res;
+}
+INTERCEPTOR(__sanitizer_ether_addr *, ether_aton_r, char *buf,
+            __sanitizer_ether_addr *addr) {
+  void *ctx;
+  COMMON_INTERCEPTOR_ENTER(ctx, ether_aton_r, buf, addr);
+  if (buf) COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, REAL(strlen)(buf) + 1);
+  __sanitizer_ether_addr *res = REAL(ether_aton_r)(buf, addr);
+  if (res) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, res, sizeof(*res));
+  return res;
+}
+#define INIT_ETHER_R                 \
+  INTERCEPT_FUNCTION(ether_ntoa_r);  \
+  INTERCEPT_FUNCTION(ether_aton_r);
+#else
+#define INIT_ETHER_R
+#endif
+
 #define SANITIZER_COMMON_INTERCEPTORS_INIT \
   INIT_STRCMP;                             \
   INIT_STRNCMP;                            \
@@ -2590,4 +2596,5 @@ INTERCEPTOR(int, ether_line, char *line,
   INIT_STATVFS64;                          \
   INIT_INITGROUPS;                         \
   INIT_ETHER;                              \
+  INIT_ETHER_R;                            \
 /**/

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h?rev=193244&r1=193243&r2=193244&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_platform_interceptors.h Wed Oct 23 10:21:10 2013
@@ -134,6 +134,7 @@
 # define SANITIZER_INTERCEPT_STATVFS64 SI_LINUX_NOT_ANDROID
 # define SANITIZER_INTERCEPT_INITGROUPS SI_NOT_WINDOWS
 # define SANITIZER_INTERCEPT_ETHER SI_NOT_WINDOWS
+# define SANITIZER_INTERCEPT_ETHER_R SI_LINUX_NOT_ANDROID
 
 # define SANITIZER_INTERCEPT__EXIT SI_LINUX
 





More information about the llvm-commits mailing list