pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: Rebase patches, apply changes from review



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Fri Aug 4 15:05:02 2017 +0200
Changeset:	d42c73adda0a3606fa8c715f1c501d458e55f125

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h
Added Files:
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__freebsd.cc

Log Message:
compiler-rt-netbsd: Rebase patches, apply changes from review

internal__defs.h: Improve comment.
freebsd.cc: Reuse FreeBSD specific code for NetBSD, as suggested upstream.

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=d42c73adda0a3606fa8c715f1c501d458e55f125

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

diffstat:
 compiler-rt-netbsd/distinfo                        |  3 +-
 ...b_sanitizer__common_sanitizer__internal__defs.h |  6 +-
 ...nitizer__common_sanitizer__procmaps__freebsd.cc | 71 ++++++++++++++++++++++
 3 files changed, 77 insertions(+), 3 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 727c78bbcd..24bc3fb1b6 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -16,11 +16,12 @@ SHA1 (patch-cmake_config-ix.cmake) = 497da73e6ce4abe19f048a94b4d80b92c0ce7e82
 SHA1 (patch-lib_interception_interception.h) = 9e0c8964c5f099c2a1b8cde2bc22fbb60594b659
 SHA1 (patch-lib_interception_interception__linux.cc) = 41e29e48d879a7c1a8e8c5c466439310783d5e9f
 SHA1 (patch-lib_interception_interception__linux.h) = ebbdd314aeff8be22107a78872a71b9606748b36
-SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = 041c1036c925dad11040c6724c90ab2b4851f1cd
+SHA1 (patch-lib_sanitizer__common_sanitizer__internal__defs.h) = f84e3442e72b6d07ad7c8e8fcf44718c547e2a93
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux.cc) = f2a8938cf1162a4c820f17f5b28879cdbc01cba0
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux.h) = b3177dc169208b1b3e0c951fe3fd9c07e82fff49
 SHA1 (patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc) = 1a937daa428db0a9b41293794e491599ac1e8699
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc) = 36a89517584891a1a50536a681a5d42e99ef904d
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 5a5d7bf3dc0bb74fecc7f94d7cd84e0c54ea4343
+SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps__freebsd.cc) = eebf1f54a6f06c7eb2d3dbcc23d143d5cfb485f3
 SHA1 (patch-lib_sanitizer__common_sanitizer__syscall__generic.inc) = 0ec7db864f385794972a79d85d04f72fb8894a9d
 SHA1 (patch-lib_sanitizer__common_sanitizer__unwind__linux__libcdep.cc) = 446f72ab0d740dd441c208b08360175e0f0b992c
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h
index 464261b02c..0cd984030f 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__internal__defs.h
@@ -2,12 +2,14 @@ $NetBSD$
 
 --- lib/sanitizer_common/sanitizer_internal_defs.h.orig	2017-07-04 05:53:22.000000000 +0000
 +++ lib/sanitizer_common/sanitizer_internal_defs.h
-@@ -133,8 +133,8 @@ typedef int pid_t;
+@@ -132,9 +132,9 @@ typedef int pid_t;
+ // WARNING: OFF_T may be different from OS type off_t, depending on the value of
  // _FILE_OFFSET_BITS. This definition of OFF_T matches the ABI of system calls
  // like pread and mmap, as opposed to pread64 and mmap64.
- // FreeBSD, Mac and Linux/x86-64 are special.
+-// FreeBSD, Mac and Linux/x86-64 are special.
 -#if SANITIZER_FREEBSD || SANITIZER_MAC || \
 -  (SANITIZER_LINUX && defined(__x86_64__))
++// FreeBSD, NetBSD, Mac and Linux/x86-64 are special.
 +#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_MAC || \
 +    (SANITIZER_LINUX && defined(__x86_64__))
  typedef u64 OFF_T;
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__freebsd.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__freebsd.cc
new file mode 100644
index 0000000000..41e0dd543f
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__freebsd.cc
@@ -0,0 +1,71 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_procmaps_freebsd.cc.orig	2017-07-16 22:40:10.000000000 +0000
++++ lib/sanitizer_common/sanitizer_procmaps_freebsd.cc
+@@ -11,14 +11,18 @@
+ //===----------------------------------------------------------------------===//
+ 
+ #include "sanitizer_platform.h"
+-#if SANITIZER_FREEBSD
++#if SANITIZER_FREEBSD || SANITIZER_NETBSD
+ #include "sanitizer_common.h"
++#if SANITIZER_FREEBSD
+ #include "sanitizer_freebsd.h"
++#endif
+ #include "sanitizer_procmaps.h"
+ 
+ #include <unistd.h>
+ #include <sys/sysctl.h>
++#if SANITIZER_FREEBSD
+ #include <sys/user.h>
++#endif
+ 
+ // Fix 'kinfo_vmentry' definition on FreeBSD prior v9.2 in 32-bit mode.
+ #if SANITIZER_FREEBSD && (SANITIZER_WORDSIZE == 32)
+@@ -28,19 +32,31 @@
+ # endif
+ #endif
+ 
++#ifndef __arraycount
++#define __arraycount(__x) (sizeof(__x) / sizeof(__x[0]))
++#endif
++
+ namespace __sanitizer {
+ 
+ void ReadProcMaps(ProcSelfMapsBuff *proc_maps) {
+-  const int Mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid() };
++
++  const int Mib[] = {
++#if SANITIZER_FREEBSD
++  CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid()
++#else
++  CTL_VM, VM_PROC, VM_PROC_MAP, getpid(), sizeof(struct kinfo_vmentry)
++#endif
++  };
++
+   size_t Size = 0;
+-  int Err = sysctl(Mib, 4, NULL, &Size, NULL, 0);
++  int Err = sysctl(Mib, __arraycount(Mib), NULL, &Size, NULL, 0);
+   CHECK_EQ(Err, 0);
+   CHECK_GT(Size, 0);
+ 
+   size_t MmapedSize = Size * 4 / 3;
+   void *VmMap = MmapOrDie(MmapedSize, "ReadProcMaps()");
+   Size = MmapedSize;
+-  Err = sysctl(Mib, 4, VmMap, &Size, NULL, 0);
++  Err = sysctl(Mib, __arraycount(Mib), VmMap, &Size, NULL, 0);
+   CHECK_EQ(Err, 0);
+ 
+   proc_maps->data = (char*)VmMap;
+@@ -71,7 +87,11 @@ bool MemoryMappingLayout::Next(MemoryMap
+                       VmEntry->kve_path);
+   }
+ 
++#if SANITIZER_FREEBSD
+   current_ += VmEntry->kve_structsize;
++#else
++  current_ += sizeof(*VmEntry);
++#endif
+ 
+   return true;
+ }


Home | Main Index | Thread Index | Old Index