summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-23 15:21:10 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2013-10-23 15:21:10 +0000
commit220d1f7c727eab61d1846a7d30b2b551a0378c0b (patch)
tree1a40ca891f33ead2decc0596d25f5a50723dbc4a
parent369a9a6d4297af031227db1c6fedd21ee7033dc1 (diff)
downloadcompiler-rt-220d1f7c727eab61d1846a7d30b2b551a0378c0b.tar.gz
compiler-rt-220d1f7c727eab61d1846a7d30b2b551a0378c0b.tar.bz2
compiler-rt-220d1f7c727eab61d1846a7d30b2b551a0378c0b.tar.xz
[sanitizer] Fix OSX build.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193244 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/sanitizer_common/sanitizer_common_interceptors.inc45
-rw-r--r--lib/sanitizer_common/sanitizer_platform_interceptors.h1
2 files changed, 27 insertions, 19 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_interceptors.inc b/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 4c2fc912..9cef9380 100644
--- a/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -2430,14 +2430,6 @@ INTERCEPTOR(char *, ether_ntoa, __sanitizer_ether_addr *addr) {
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 *, ether_aton, char *buf) {
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, __sanitizer_ether_addr *addr,
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, __sanitizer_ether_addr *addr,
#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, __sanitizer_ether_addr *addr,
INIT_STATVFS64; \
INIT_INITGROUPS; \
INIT_ETHER; \
+ INIT_ETHER_R; \
/**/
diff --git a/lib/sanitizer_common/sanitizer_platform_interceptors.h b/lib/sanitizer_common/sanitizer_platform_interceptors.h
index 6af320c6..a20b9268 100644
--- a/lib/sanitizer_common/sanitizer_platform_interceptors.h
+++ b/lib/sanitizer_common/sanitizer_platform_interceptors.h
@@ -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