pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
compiler-rt-netbsd: Import code from Yang Zheng's branch
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Thu Jun 14 16:22:50 2018 +0200
Changeset: a38674344871fc4d19434aa0ee181ed1f5107654
Modified Files:
compiler-rt-netbsd/distinfo
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
Log Message:
compiler-rt-netbsd: Import code from Yang Zheng's branch
Add more interceptors.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=a38674344871fc4d19434aa0ee181ed1f5107654
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
compiler-rt-netbsd/distinfo | 8 +-
...zer__common_sanitizer__common__interceptors.inc | 98 +++++++++++++++++++++-
...zer__common_sanitizer__platform__interceptors.h | 5 +-
...__common_sanitizer__platform__limits__netbsd.cc | 5 +-
...r__common_sanitizer__platform__limits__netbsd.h | 4 +-
5 files changed, 110 insertions(+), 10 deletions(-)
diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 16286a83e1..a85901e4db 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -10,13 +10,13 @@ SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = e2e0e397eaf148df329f2c25ca9185f57
SHA1 (patch-lib_interception_interception.h) = a7f97b191769c846be27e17430bbe39435976642
SHA1 (patch-lib_msan_msan__interceptors.cc) = bfb0d6ba97382a26d54141c3e4cc0c0f584178a1
SHA1 (patch-lib_msan_msan__linux.cc) = dc3431b7606f3e1c106ffd2568ab4a6c77321731
-SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = 80ef7549ac8d2f7a6f5b9a8103360f0eaafc75bb
+SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = bc838ca74110f9d343794c4538b40e99c67efc7e
SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 9ffcb3ae5ccfcb99d842efe55f6d698cd2e02846
SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 83636321cef6a17281a27e2ed3dd1b71e5429a6a
SHA1 (patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc) = ac04d9b155c7281dde98741b7f79714e98c2bbc3
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 04469f703caeebc1c643ff7a46cdfada1792d5bf
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = 9a605e4fef4177c125eb7e010ef18b196e74242e
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = 4ca25c16e8c586c6333976632c145ce30e71690a
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = cdf1461c641ca6f9e13f3d3319170e4aad76e367
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = b15685e72af975a7e6ca300034193475fc02fa88
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = a97a6f9405c5c69510a7562d875ee892bea4f4a8
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc) = 95fef4690641063603db1b1dcb00c610948142f1
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = b2c0149501713bc16b657344b8b9a3a0ce48b107
SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps__bsd.cc) = 8b629840ff7f56c670d322a9dbbdf7e33ce90cb5
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
index e8c3a9e4a4..352466e279 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__common__interceptors.inc
@@ -49,7 +49,7 @@ $NetBSD$
void *ctx;
COMMON_INTERCEPTOR_ENTER(ctx, statvfs, path, buf);
if (path) COMMON_INTERCEPTOR_READ_RANGE(ctx, path, REAL(strlen)(path) + 1);
-@@ -7234,6 +7241,1514 @@ INTERCEPTOR(struct __sanitizer_netent *,
+@@ -7234,6 +7241,1605 @@ INTERCEPTOR(struct __sanitizer_netent *,
#define INIT_NETENT
#endif
@@ -1560,11 +1560,102 @@ $NetBSD$
+#else
+#define INIT_SHA2
+#endif
++
++#if SANITIZER_INTERCEPT_GETCHAR
++INTERCEPTOR(int, fgetc, __sanitizer_FILE *stream) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, fgetc, stream);
++ return REAL(fgetc)(stream);
++}
++INTERCEPTOR(int, getc, __sanitizer_FILE *stream) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, getc, stream);
++ return REAL(getc)(stream);
++}
++
++INTERCEPTOR(int, getchar) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, getchar);
++ return REAL(getchar)();
++}
++
++INTERCEPTOR(int, getc_unlocked, __sanitizer_FILE *stream) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, getc_unlocked, stream);
++ return REAL(getc_unlocked)(stream);
++}
++
++INTERCEPTOR(int, getchar_unlocked) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, getchar_unlocked);
++ return REAL(getchar_unlocked)();
++}
++
++#define INIT_GETCHAR \
++ COMMON_INTERCEPT_FUNCTION(fgetc); \
++ COMMON_INTERCEPT_FUNCTION(getc); \
++ COMMON_INTERCEPT_FUNCTION(getchar); \
++ COMMON_INTERCEPT_FUNCTION(getc_unlocked); \
++ COMMON_INTERCEPT_FUNCTION(getchar_unlocked)
++#else
++#define INIT_GETCHAR
++#endif
++
++#if SANITIZER_INTERCEPT_SETVBUF
++
++INTERCEPTOR(void, setbuf, __sanitizer_FILE *stream, char *buf) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, setbuf, stream, buf);
++ REAL(setbuf)(stream, buf);
++ if (buf)
++ COMMON_INTERCEPTOR_READ_RANGE(ctx, buf, setvbuf_bufsiz);
++}
++
++INTERCEPTOR(int, setvbuf, __sanitizer_FILE *stream, char *buf, int mode, SIZE_T size) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, setvbuf, stream, buf, mode, size);
++ int ret = REAL(setvbuf)(stream, buf, mode, size);
++ if (buf)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, size);
++ return ret;
++}
++
++INTERCEPTOR(void, setbuffer, __sanitizer_FILE *stream, char *buf, SIZE_T size) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, setbuffer, stream, buf, size);
++ REAL(setbuffer)(stream, buf, size);
++ if (buf)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, size);
++}
++
++#define INIT_SETVBUF \
++ COMMON_INTERCEPT_FUNCTION(setbuf); \
++ COMMON_INTERCEPT_FUNCTION(setbuffer); \
++ COMMON_INTERCEPT_FUNCTION(setvbuf)
++#else
++#define INIT_SETVBUF
++#endif
++
++#if SANITIZER_INTERCEPT_MI_VECTOR_HASH
++INTERCEPTOR(void, mi_vector_hash, const void *key, SIZE_T len, u32 seed,
++ u32 hashes[3]) {
++ void *ctx;
++ COMMON_INTERCEPTOR_ENTER(ctx, mi_vector_hash, key, len, seed, hashes);
++ if (key)
++ COMMON_INTERCEPTOR_READ_RANGE(ctx, key, len);
++ REAL(mi_vector_hash)(key, len, seed, hashes);
++ if (hashes)
++ COMMON_INTERCEPTOR_WRITE_RANGE(ctx, hashes, sizeof(hashes[0]) * 3);
++}
++#define INIT_MI_VECTOR_HASH COMMON_INTERCEPT_FUNCTION(mi_vector_hash)
++#else
++#define INIT_MI_VECTOR_HASH
++#endif
+
static void InitializeCommonInterceptors() {
static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
interceptor_metadata_map = new((void *)&metadata_mem) MetadataHashMap();
-@@ -7483,6 +8998,27 @@ static void InitializeCommonInterceptors
+@@ -7483,6 +9089,30 @@ static void InitializeCommonInterceptors
INIT_TTYENT;
INIT_PROTOENT;
INIT_NETENT;
@@ -1589,6 +1680,9 @@ $NetBSD$
+ INIT_CDBR;
+ INIT_RMD160;
+ INIT_SHA2;
++ INIT_GETCHAR;
++ INIT_SETVBUF;
++ INIT_MI_VECTOR_HASH;
INIT___PRINTF_CHK;
}
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
index cf1f5df778..70bf9e3387 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__interceptors.h
@@ -2,7 +2,7 @@ $NetBSD$
--- lib/sanitizer_common/sanitizer_platform_interceptors.h.orig 2018-06-14 12:14:40.000000000 +0000
+++ lib/sanitizer_common/sanitizer_platform_interceptors.h
-@@ -510,4 +510,26 @@
+@@ -510,4 +510,29 @@
#define SANITIZER_INTERCEPT_PROTOENT SI_NETBSD
#define SANITIZER_INTERCEPT_NETENT SI_NETBSD
@@ -27,5 +27,8 @@ $NetBSD$
+#define SANITIZER_INTERCEPT_CDBR SI_NETBSD
+#define SANITIZER_INTERCEPT_RMD160 SI_NETBSD
+#define SANITIZER_INTERCEPT_SHA2 SI_NETBSD
++#define SANITIZER_INTERCEPT_GETCHAR SI_POSIX
++#define SANITIZER_INTERCEPT_SETVBUF SI_POSIX
++#define SANITIZER_INTERCEPT_MI_VECTOR_HASH SI_NETBSD
+
#endif // #ifndef SANITIZER_PLATFORM_INTERCEPTORS_H
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
index cf9c112abb..3438d3d990 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
@@ -91,7 +91,7 @@ $NetBSD$
unsigned struct_utimbuf_sz = sizeof(struct utimbuf);
unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
unsigned struct_timex_sz = sizeof(struct timex);
-@@ -2063,6 +2085,38 @@ unsigned IOCTL_SNDCTL_DSP_SILENCE = SNDC
+@@ -2063,6 +2085,39 @@ unsigned IOCTL_SNDCTL_DSP_SILENCE = SNDC
const int si_SEGV_MAPERR = SEGV_MAPERR;
const int si_SEGV_ACCERR = SEGV_ACCERR;
@@ -127,10 +127,11 @@ $NetBSD$
+const int modctl_stat = MODCTL_STAT;
+const int modctl_exists = MODCTL_EXISTS;
+const unsigned fpos_t_sz = sizeof(fpos_t);
++const int setvbuf_bufsiz = BUFSIZ;
} // namespace __sanitizer
using namespace __sanitizer;
-@@ -2224,4 +2278,10 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
+@@ -2224,4 +2279,10 @@ CHECK_SIZE_AND_OFFSET(group, gr_passwd);
CHECK_SIZE_AND_OFFSET(group, gr_gid);
CHECK_SIZE_AND_OFFSET(group, gr_mem);
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
index a624ff1e39..a398ac8f69 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h
@@ -26,7 +26,7 @@ $NetBSD$
struct __sanitizer_ptrace_io_desc {
int piod_op;
void *piod_offs;
-@@ -2194,6 +2204,69 @@ extern unsigned IOCTL_SNDCTL_DSP_SILENCE
+@@ -2194,6 +2204,71 @@ extern unsigned IOCTL_SNDCTL_DSP_SILENCE
extern const int si_SEGV_MAPERR;
extern const int si_SEGV_ACCERR;
@@ -93,6 +93,8 @@ $NetBSD$
+ u8 entries_s1, entries_s2;
+ u8 entries_index_s1, entries_index_s2;
+};
++
++extern const int setvbuf_bufsiz;
} // namespace __sanitizer
#define CHECK_TYPE_SIZE(TYPE) \
Home |
Main Index |
Thread Index |
Old Index