pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
compiler-rt-netbsd: Sync with local patches
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Tue Oct 2 19:59:50 2018 +0200
Changeset: db9300718712fcb35fa6f30a1154e7e90f86b081
Modified Files:
compiler-rt-netbsd/distinfo
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc
Added Files:
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__mac.cc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.cc
compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__posix.h
compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt
compiler-rt-netbsd/patches/patch-lib_xray_xray__x86__64.cc
Log Message:
compiler-rt-netbsd: Sync with local patches
Add new internal_sysctlbyname().
Fix build on newer NetBSD HEAD.
XRay build broke, add temporary kludges to get it to link.
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=db9300718712fcb35fa6f30a1154e7e90f86b081
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
compiler-rt-netbsd/distinfo | 10 ++++++--
...mmon_sanitizer__interceptors__ioctl__netbsd.inc | 23 +++++++++++++++++
...patch-lib_sanitizer__common_sanitizer__linux.cc | 30 ++++++++++++++++++++++
.../patch-lib_sanitizer__common_sanitizer__mac.cc | 17 ++++++++++++
...atch-lib_sanitizer__common_sanitizer__netbsd.cc | 19 ++++++++++++++
...__common_sanitizer__platform__limits__netbsd.cc | 23 +++++++++++++++++
.../patch-lib_sanitizer__common_sanitizer__posix.h | 13 ++++++++++
.../patches/patch-lib_xray_tests_CMakeLists.txt | 12 +++++++++
.../patches/patch-lib_xray_xray__x86__64.cc | 28 ++++++++++++++++++++
9 files changed, 173 insertions(+), 2 deletions(-)
diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 152c272e74..25f21fbf12 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -9,17 +9,23 @@ SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = c3d8a78f96566e5b8d2d8a5cbaba60990
SHA1 (patch-lib_msan_msan__interceptors.cc) = 7af07c88b0ddf650f3df5dea4f6664ff9393d963
SHA1 (patch-lib_msan_msan__linux.cc) = b5df0f4f5930d7c1681b1ad867c893d01d6e5cf7
SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = d48fd71509c2adfb5fc5aacfec1dc8fd07640414
-SHA1 (patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc) = 1c6e8c4a755af57d523d06b12f08a1946f1aef25
+SHA1 (patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc) = 8e31ef0974fd12505b2d61723181b852d66815ce
SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 9475c8018dadbc4d865b52a03e43f9eae2011c3e
+SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = 692b8abc40d8f932ee87e5f155d5b90e0ad4df9e
SHA1 (patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc) = 8d156e4b51961bab6bae3ee30df8e18aea632b5d
+SHA1 (patch-lib_sanitizer__common_sanitizer__mac.cc) = 6d80bd2de5c92a4ec2984b2f490cf4e1d5ce3d99
+SHA1 (patch-lib_sanitizer__common_sanitizer__netbsd.cc) = 093b6f4d8138b56ef2d252a8ac6f133ad09a77e4
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__interceptors.h) = 87684ad05a8e3a5ab2f1c9cf00cbecab4823eeb3
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = b52e02792201d54d1f9e9336a8cf74ff8c9eca68
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.cc) = b8125c783a773497436536b7f4deead8c36633c5
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__netbsd.h) = e8a0d9389f3ddd41f911e00f8ff62e214441296d
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc) = 7c16ba866352f3a695a544094ca46f0f561c43c5
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 9f535e84c3e1ab5704b11e388ac240439a9900d6
+SHA1 (patch-lib_sanitizer__common_sanitizer__posix.h) = 2d6c684ba47d591ecdbef19306d50cbaa989be09
SHA1 (patch-lib_sanitizer__common_sanitizer__unwind__linux__libcdep.cc) = 86d53010debaf2cc5c9793d83186db2db76b280f
SHA1 (patch-lib_scudo_scudo__platform.h) = 68f33b18d913984c3a459597ef62f63d36184ca9
SHA1 (patch-lib_tsan_CMakeLists.txt) = 4d8f8081ff2a3249565df26e67a35b5b3509e0b0
+SHA1 (patch-lib_xray_tests_CMakeLists.txt) = bb52916184d8e829395dd40d6d1b8b7eac40da92
+SHA1 (patch-lib_xray_xray__x86__64.cc) = 635983973b4fd03227dd99ccb2808faad6e1bb59
SHA1 (patch-test_asan_TestCases_Posix_stack-use-after-return.cc) = 474bfca0e8891bb777a81ae926c89c3d56f7cdb9
SHA1 (patch-test_asan_TestCases_heavy__uar__test.cc) = fce8bfec44d93bb606920dba9ddd7165f127d23a
SHA1 (patch-test_asan_TestCases_interception__failure__test.cc) = 0a359141e3c30b672842904b32d1542170b03ab1
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc
index d2a0759502..4bd866466f 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__interceptors__ioctl__netbsd.inc
@@ -2,6 +2,29 @@ $NetBSD$
--- lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc.orig 2018-08-21 21:25:40.000000000 +0000
+++ lib/sanitizer_common/sanitizer_interceptors_ioctl_netbsd.inc
+@@ -713,14 +713,14 @@ static void ioctl_table_fill() {
+ _(SIOCGPPPSTATS, READWRITE, struct_ifpppstatsreq_sz);
+ _(SIOCGPPPCSTATS, READWRITE, struct_ifpppcstatsreq_sz);
+ /* Entries from file: net/npf.h */
+- _(IOC_NPF_VERSION, WRITE, sizeof(int));
+- _(IOC_NPF_SWITCH, READ, sizeof(int));
+- _(IOC_NPF_LOAD, READWRITE, struct_plistref_sz);
+- _(IOC_NPF_TABLE, READ, struct_npf_ioctl_table_sz);
+- _(IOC_NPF_STATS, READ, sizeof(uptr));
+- _(IOC_NPF_SAVE, WRITE, struct_plistref_sz);
+- _(IOC_NPF_RULE, READWRITE, struct_plistref_sz);
+- _(IOC_NPF_CONN_LOOKUP, READWRITE, struct_plistref_sz);
++// _(IOC_NPF_VERSION, WRITE, sizeof(int));
++// _(IOC_NPF_SWITCH, READ, sizeof(int));
++// _(IOC_NPF_LOAD, READWRITE, struct_plistref_sz);
++// _(IOC_NPF_TABLE, READ, struct_npf_ioctl_table_sz);
++// _(IOC_NPF_STATS, READ, sizeof(uptr));
++// _(IOC_NPF_SAVE, WRITE, struct_plistref_sz);
++// _(IOC_NPF_RULE, READWRITE, struct_plistref_sz);
++// _(IOC_NPF_CONN_LOOKUP, READWRITE, struct_plistref_sz);
+ /* Entries from file: net/if_pppoe.h */
+ _(PPPOESETPARMS, READ, struct_pppoediscparms_sz);
+ _(PPPOEGETPARMS, READWRITE, struct_pppoediscparms_sz);
@@ -1095,7 +1095,6 @@ static void ioctl_table_fill() {
/* Entries from file: sys/power.h */
_(POWER_EVENT_RECVDICT, READWRITE, struct_plistref_sz);
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
new file mode 100644
index 0000000000..89cd712f2c
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux.cc
@@ -0,0 +1,30 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_linux.cc.orig 2018-10-01 21:40:24.000000000 +0000
++++ lib/sanitizer_common/sanitizer_linux.cc
+@@ -591,7 +591,7 @@ static void GetArgsAndEnv(char ***argv,
+ // this information. See also <sys/exec.h>.
+ ps_strings *pss;
+ size_t sz = sizeof(pss);
+- if (sysctlbyname("kern.ps_strings", &pss, &sz, NULL, 0) == -1) {
++ if (internal_sysctlbyname("kern.ps_strings", &pss, &sz, NULL, 0) == -1) {
+ Printf("sysctl kern.ps_strings failed\n");
+ Die();
+ }
+@@ -796,6 +796,16 @@ int internal_sysctl(const int *name, uns
+ return sysctl(name, namelen, oldp, (size_t *)oldlenp, newp, (size_t)newlen);
+ #endif
+ }
++
++int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,
++ const void *newp, uptr newlen) {
++#if SANITIZER_OPENBSD
++ return sysctlbyname(sname, oldp, (size_t *)oldlenp, (void *)newp,
++ (size_t)newlen);
++#else
++ return sysctlbyname(sname, oldp, (size_t *)oldlenp, newp, (size_t)newlen);
++#endif
++}
+ #endif
+
+ #if SANITIZER_LINUX
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__mac.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__mac.cc
new file mode 100644
index 0000000000..8c9397d242
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__mac.cc
@@ -0,0 +1,17 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_mac.cc.orig 2018-10-01 21:40:24.000000000 +0000
++++ lib/sanitizer_common/sanitizer_mac.cc
+@@ -219,6 +219,12 @@ int internal_sysctl(const int *name, uns
+ const_cast<void *>(newp), (size_t)newlen);
+ }
+
++int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,
++ const void *newp, uptr newlen) {
++ return sysctlbyname(sname, oldp, (size_t *)oldlenp, const_cast<void *>(newp),
++ (size_t)newlen);
++}
++
+ int internal_forkpty(int *amaster) {
+ int master, slave;
+ if (openpty(&master, &slave, nullptr, nullptr, nullptr) == -1) return -1;
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.cc
new file mode 100644
index 0000000000..68f6aaf6f9
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.cc
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_netbsd.cc.orig 2018-10-01 21:40:24.000000000 +0000
++++ lib/sanitizer_common/sanitizer_netbsd.cc
+@@ -297,6 +297,14 @@ DEFINE_INTERNAL(int, sysctl, const int *
+ return __sysctl(name, namelen, oldp, (size_t *)oldlenp, newp, (size_t)newlen);
+ }
+
++DEFINE_INTERNAL(int, sysctlbyname, const char *sname, void *oldp,
++ uptr *oldlenp, const void *newp, uptr newlen) {
++ DEFINE__REAL(int, sysctlbyname, const char *a, void *b, size_t *c,
++ const void *d, size_t e);
++ return _REAL(sysctlbyname, sname, oldp, (size_t *)oldlenp, newp,
++ (size_t)newlen);
++}
++
+ DEFINE_INTERNAL(uptr, sigprocmask, int how, __sanitizer_sigset_t *set,
+ __sanitizer_sigset_t *oldset) {
+ CHECK(&_sys___sigprocmask14);
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 a3663358f5..7d8fa9d90e 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,6 +91,29 @@ $NetBSD$
unsigned struct_utimbuf_sz = sizeof(struct utimbuf);
unsigned struct_itimerspec_sz = sizeof(struct itimerspec);
unsigned struct_timex_sz = sizeof(struct timex);
+@@ -1451,14 +1473,14 @@ unsigned IOCTL_PPPIOCGMTU = PPPIOCGMTU;
+ unsigned IOCTL_PPPIOCSMTU = PPPIOCSMTU;
+ unsigned IOCTL_SIOCGPPPSTATS = SIOCGPPPSTATS;
+ unsigned IOCTL_SIOCGPPPCSTATS = SIOCGPPPCSTATS;
+-unsigned IOCTL_IOC_NPF_VERSION = IOC_NPF_VERSION;
+-unsigned IOCTL_IOC_NPF_SWITCH = IOC_NPF_SWITCH;
+-unsigned IOCTL_IOC_NPF_LOAD = IOC_NPF_LOAD;
+-unsigned IOCTL_IOC_NPF_TABLE = IOC_NPF_TABLE;
+-unsigned IOCTL_IOC_NPF_STATS = IOC_NPF_STATS;
+-unsigned IOCTL_IOC_NPF_SAVE = IOC_NPF_SAVE;
+-unsigned IOCTL_IOC_NPF_RULE = IOC_NPF_RULE;
+-unsigned IOCTL_IOC_NPF_CONN_LOOKUP = IOC_NPF_CONN_LOOKUP;
++//unsigned IOCTL_IOC_NPF_VERSION = IOC_NPF_VERSION;
++//unsigned IOCTL_IOC_NPF_SWITCH = IOC_NPF_SWITCH;
++//unsigned IOCTL_IOC_NPF_LOAD = IOC_NPF_LOAD;
++//unsigned IOCTL_IOC_NPF_TABLE = IOC_NPF_TABLE;
++//unsigned IOCTL_IOC_NPF_STATS = IOC_NPF_STATS;
++//unsigned IOCTL_IOC_NPF_SAVE = IOC_NPF_SAVE;
++//unsigned IOCTL_IOC_NPF_RULE = IOC_NPF_RULE;
++//unsigned IOCTL_IOC_NPF_CONN_LOOKUP = IOC_NPF_CONN_LOOKUP;
+ unsigned IOCTL_PPPOESETPARMS = PPPOESETPARMS;
+ unsigned IOCTL_PPPOEGETPARMS = PPPOEGETPARMS;
+ unsigned IOCTL_PPPOEGETSESSION = PPPOEGETSESSION;
@@ -1804,8 +1826,6 @@ unsigned IOCTL_MTIOCSLOCATE = MTIOCSLOCA
unsigned IOCTL_MTIOCHLOCATE = MTIOCHLOCATE;
unsigned IOCTL_POWER_EVENT_RECVDICT = POWER_EVENT_RECVDICT;
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__posix.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__posix.h
new file mode 100644
index 0000000000..f835a47527
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__posix.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_posix.h.orig 2018-08-31 08:13:43.000000000 +0000
++++ lib/sanitizer_common/sanitizer_posix.h
+@@ -62,6 +62,8 @@ int internal_forkpty(int *amaster);
+
+ int internal_sysctl(const int *name, unsigned int namelen, void *oldp,
+ uptr *oldlenp, const void *newp, uptr newlen);
++int internal_sysctlbyname(const char *sname, void *oldp, uptr *oldlenp,
++ const void *newp, uptr newlen);
+
+ // These functions call appropriate pthread_ functions directly, bypassing
+ // the interceptor. They are weak and may not be present in some tools.
diff --git a/compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt b/compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt
new file mode 100644
index 0000000000..236cad85e4
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_xray_tests_CMakeLists.txt
@@ -0,0 +1,12 @@
+$NetBSD$
+
+--- lib/xray/tests/CMakeLists.txt.orig 2018-10-01 21:40:24.000000000 +0000
++++ lib/xray/tests/CMakeLists.txt
+@@ -70,6 +70,7 @@ if (NOT APPLE)
+ list(APPEND XRAY_UNITTEST_LINK_FLAGS -lLLVMXRay -lLLVMSupport -lLLVMTestingSupport)
+ endif()
+
++ list(APPEND XRAY_UNITTEST_LINK_FLAGS -lterminfo -lexecinfo -lLLVMDemangle)
+ append_list_if(COMPILER_RT_HAS_LIBM -lm XRAY_UNITTEST_LINK_FLAGS)
+ append_list_if(COMPILER_RT_HAS_LIBRT -lrt XRAY_UNITTEST_LINK_FLAGS)
+ append_list_if(COMPILER_RT_HAS_LIBDL -ldl XRAY_UNITTEST_LINK_FLAGS)
diff --git a/compiler-rt-netbsd/patches/patch-lib_xray_xray__x86__64.cc b/compiler-rt-netbsd/patches/patch-lib_xray_xray__x86__64.cc
new file mode 100644
index 0000000000..4126dfc030
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_xray_xray__x86__64.cc
@@ -0,0 +1,28 @@
+$NetBSD$
+
+--- lib/xray/xray_x86_64.cc.orig 2018-08-31 08:13:42.000000000 +0000
++++ lib/xray/xray_x86_64.cc
+@@ -1,5 +1,6 @@
+ #include "cpuid.h"
+ #include "sanitizer_common/sanitizer_common.h"
++#include "sanitizer_common/sanitizer_posix.h"
+ #include "xray_defs.h"
+ #include "xray_interface_internal.h"
+
+@@ -87,13 +88,13 @@ uint64_t getTSCFrequency() XRAY_NEVER_IN
+ size_t tscfreqsz = sizeof(TSCFrequency);
+ #if SANITIZER_OPENBSD
+ int Mib[2] = { CTL_MACHDEP, CPU_TSCFREQ };
+- if (sysctl(Mib, 2, &TSCFrequency, &tscfreqsz, NULL, 0) != -1) {
++ if (internal_sysctl(Mib, 2, &TSCFrequency, &tscfreqsz, NULL, 0) != -1) {
+ #elif SANITIZER_MAC
+- if (sysctlbyname("machdep.tsc.frequency", &TSCFrequency, &tscfreqsz,
++ if (internal_sysctlbyname("machdep.tsc.frequency", &TSCFrequency, &tscfreqsz,
+ NULL, 0) != -1 ) {
+
+ #else
+- if (sysctlbyname("machdep.tsc_freq", &TSCFrequency, &tscfreqsz,
++ if (internal_sysctlbyname("machdep.tsc_freq", &TSCFrequency, &tscfreqsz,
+ NULL, 0) != -1) {
+ #endif
+ return static_cast<uint64_t>(TSCFrequency);
Home |
Main Index |
Thread Index |
Old Index