pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

compiler-rt-netbsd: Port part of msan structures for NetBSD



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Mon Jun 12 20:30:12 2017 +0200
Changeset:	d72149ec178470e6b4fcebf99a8bd20eea865240

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h

Log Message:
compiler-rt-netbsd: Port part of msan structures for NetBSD

This is work in progress.
FreeBSD code is incomplete and it makes porting harder.

Sponsored by <The NetBSD Foundation>

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d72149ec178470e6b4fcebf99a8bd20eea865240

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 compiler-rt-netbsd/distinfo                        |   2 +-
 ...er__common_sanitizer__platform__limits__posix.h | 149 +++++++++++++++++++++
 2 files changed, 150 insertions(+), 1 deletion(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 12d8f69ebb..9713ab15f6 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -17,7 +17,7 @@ SHA1 (patch-lib_asan_scripts_asan__symbolize.py) = d6c079e7092b22b5379293dbb8d1e
 SHA1 (patch-lib_builtins_gcc__personality__v0.c) = 0a48656e68614730ea05e8fb2588434e774b3c45
 SHA1 (patch-lib_sanitizer__common_CMakeLists.txt) = 45b18179c5d1d9f284ccfe4670a989ac30d05e92
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform.h) = 47360a8352cc34fddc71c8f71081d7d589a63dad
-SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = f3c35dda4baa3bf539ceb3c0cf652fb5073349b6
+SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 60101ed5d68fd8681d6f378ed1f204260f2214fa
 SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc) = 0b8d88529f7374a1159c65c0bccd946ccf6a65f3
 SHA1 (patch-test_asan_lit.cfg) = 259b0e262b5975b862a51f015ec6b646ce2af10a
 SHA1 (patch-test_sanitizer__common_CMakeLists.txt) = 6af4c5ca42f17bb09823c36bf32d5576fbc0b4c8
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h
index 68166f1efe..11f1110a29 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h
@@ -39,3 +39,152 @@ $NetBSD$
  #ifndef __GLIBC_PREREQ
  #define __GLIBC_PREREQ(x, y) 0
  #endif
+@@ -37,7 +50,7 @@
+ namespace __sanitizer {
+   extern unsigned struct_utsname_sz;
+   extern unsigned struct_stat_sz;
+-#if !SANITIZER_FREEBSD && !SANITIZER_IOS
++#if !SANITIZER_FREEBSD && !SANITIZER_IOS && !SANITIZER_NETBSD
+   extern unsigned struct_stat64_sz;
+ #endif
+   extern unsigned struct_rusage_sz;
+@@ -55,10 +68,16 @@ namespace __sanitizer {
+   extern unsigned struct_itimerspec_sz;
+   extern unsigned struct_sigevent_sz;
+   extern unsigned struct_sched_param_sz;
++#if !SANITIZER_NETBSD
+   extern unsigned struct_statfs64_sz;
++#endif
+ 
+ #if !SANITIZER_ANDROID
++#if SANITIZER_NETBSD
+   extern unsigned struct_statfs_sz;
++#else
++  extern unsigned struct_statvfs_sz;
++#endif
+   extern unsigned struct_sockaddr_sz;
+   extern unsigned ucontext_t_sz;
+ #endif // !SANITIZER_ANDROID
+@@ -121,18 +140,21 @@ namespace __sanitizer {
+ #endif  // SANITIZER_LINUX
+ 
+ #if SANITIZER_LINUX || SANITIZER_FREEBSD
+-
+ #if defined(__powerpc64__) || defined(__s390__)
+   const unsigned struct___old_kernel_stat_sz = 0;
+ #elif !defined(__sparc__)
+   const unsigned struct___old_kernel_stat_sz = 32;
+ #endif
++#endif // SANITIZER_LINUX || SANITIZER_FREEBSD
++
++#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
+ 
+   extern unsigned struct_rlimit_sz;
+   extern unsigned struct_utimbuf_sz;
+   extern unsigned struct_timespec_sz;
+ 
+   struct __sanitizer_iocb {
++#if SANITIZER_LINUX || SANITIZER_FREEBSD
+     u64   aio_data;
+     u32   aio_key_or_aio_reserved1; // Simply crazy.
+     u32   aio_reserved1_or_aio_key; // Luckily, we don't need these.
+@@ -144,21 +166,53 @@ namespace __sanitizer {
+     s64   aio_offset;
+     u64   aio_reserved2;
+     u64   aio_reserved3;
++#else SANITIZER_NETBSD
++#if defined(__x86_64__)
++    u64   aio_offset;
++    u64   aio_buf;
++    u64   aio_nbytes;
++    u32   aio_fildes;
++    u32   aio_lio_opcode;
++    u64   aio_reqprio;
++    u8    aio_sigevent[32];
++    u32   _state;
++    u32   _errno;
++    u64   _retval;
++#elif defined(__i386__)
++    u64   aio_offset;
++    u32   aio_buf;
++    u32   aio_nbytes;
++    u32   aio_fildes;
++    u32   aio_lio_opcode;
++    u32   aio_reqprio;
++    u8    aio_sigevent[20];
++    u32   _state;
++    u32   _errno;
++    u32   _retval;
++#else
++#error port this to your platform
++#endif
++#endif
+   };
+ 
++#if SANITIZER_LINUX || SANITIZER_FREEBSD
+   struct __sanitizer_io_event {
+     u64 data;
+     u64 obj;
+     u64 res;
+     u64 res2;
+   };
++#endif
+ 
++#if SANITIZER_LINUX || SANITIZER_FREEBSD
+   const unsigned iocb_cmd_pread = 0;
+   const unsigned iocb_cmd_pwrite = 1;
+   const unsigned iocb_cmd_preadv = 7;
+   const unsigned iocb_cmd_pwritev = 8;
++#endif
+ 
+   struct __sanitizer___sysctl_args {
++#if SANITIZER_LINUX || SANITIZER_FREEBSD
+     int *name;
+     int nlen;
+     void *oldval;
+@@ -166,10 +220,21 @@ namespace __sanitizer {
+     void *newval;
+     uptr newlen;
+     unsigned long ___unused[4];
++#else
++    int          *name;
++    unsigned int  namelen;
++    void         *oldp;
++    size_t       *oldlenp;
++    void         *newp;
++    size_t        newlen;
++#endif
+   };
+ 
++#if SANITIZER_LINUX || SANITIZER_FREEBSD
+   const unsigned old_sigset_t_sz = sizeof(unsigned long);
++#endif
+ 
++#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
+   struct __sanitizer_sem_t {
+ #if SANITIZER_ANDROID && defined(_LP64)
+     int data[4];
+@@ -179,6 +244,14 @@ namespace __sanitizer {
+     uptr data[4];
+ #elif SANITIZER_FREEBSD
+     u32 data[4];
++#elif SANITIZER_NETBSD
++#if defined(__x86_64__)
++    u8 data[40];
++#elif defined(__i386__)
++    u8 data[20];
++#else
++#error port this to your platform
++#endif
+ #endif
+   };
+ #endif // SANITIZER_LINUX || SANITIZER_FREEBSD
+@@ -303,7 +376,7 @@ namespace __sanitizer {
+   #endif
+ #endif
+   };
+-#elif SANITIZER_FREEBSD
++#elif SANITIZER_FREEBSD /// XXX MARK
+   struct __sanitizer_ipc_perm {
+     unsigned int cuid;
+     unsigned int cgid;


Home | Main Index | Thread Index | Old Index