pkgsrc-WIP-changes archive

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

compiler-rt-netbsd: More asan sugar



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Wed Jun 14 15:59:35 2017 +0200
Changeset:	b3d07b6dd48a124c3bdc2a2c61f9c108d74f6826

Modified Files:
	compiler-rt-netbsd/distinfo
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc
Added Files:
	compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.h
	compiler-rt-netbsd/patches/patch-lib_asan_asan__linux.cc
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc
	compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.h

Log Message:
compiler-rt-netbsd: More asan sugar

As of now netbsd.h is empty, temporarily keep it around in case it will be
needed later.

Sponsoered 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=b3d07b6dd48a124c3bdc2a2c61f9c108d74f6826

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

diffstat:
 compiler-rt-netbsd/distinfo                        |  6 +-
 .../patches/patch-lib_asan_asan__interceptors.h    | 13 ++++
 .../patches/patch-lib_asan_asan__linux.cc          | 26 ++++++++
 ..._sanitizer__common_sanitizer__linux__libcdep.cc | 69 ++++++++++++++++++++++
 ...patch-lib_sanitizer__common_sanitizer__netbsd.h | 25 ++++++++
 ...anitizer__common_sanitizer__procmaps__netbsd.cc |  2 +-
 6 files changed, 139 insertions(+), 2 deletions(-)

diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 034ee84bce..7b8dac73f8 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -13,16 +13,20 @@ SHA1 (llvm-3.6.2.src.tar.xz) = 7a00257eb2bc9431e4c77c3a36b033072c54bc7e
 RMD160 (llvm-3.6.2.src.tar.xz) = 521cbc5fe2925ea3c6e90c7a31f752a04045c972
 Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
 SHA1 (patch-cmake_config-ix.cmake) = 6b0644c422eaf3e2721398c2575e31e07b535984
+SHA1 (patch-lib_asan_asan__interceptors.h) = cca1e74041e37d366c512d23547063d6a4dee008
+SHA1 (patch-lib_asan_asan__linux.cc) = 5783b032e283f1d4220bf47609f8b0f8c88a758d
 SHA1 (patch-lib_asan_scripts_asan__symbolize.py) = d6c079e7092b22b5379293dbb8d1e2445e077932
 SHA1 (patch-lib_builtins_gcc__personality__v0.c) = 66c36733afc7043f662328303de2573fd9005bf3
 SHA1 (patch-lib_interception_interception.h) = f18c140feec3c88fec57ac7ba1fbedb03db2bac6
 SHA1 (patch-lib_interception_interception__linux.h) = 2f37344082e935a99fc04203453d387fe78bd6d3
 SHA1 (patch-lib_sanitizer__common_CMakeLists.txt) = 45b18179c5d1d9f284ccfe4670a989ac30d05e92
 SHA1 (patch-lib_sanitizer__common_sanitizer__common__interceptors.inc) = da22dbf5942941b0f8be6e1075ea6d71f14a9069
+SHA1 (patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc) = 2ed1876f3895fce658270a566f975b61ac06494e
+SHA1 (patch-lib_sanitizer__common_sanitizer__netbsd.h) = c61cb87170cbe35c9e9ed6d26fb0589b1f7b72a7
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform.h) = 47360a8352cc34fddc71c8f71081d7d589a63dad
 SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = bd02af170d2ead22c646a0eb18f518895a2e71cf
 SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps.h) = ec0b5c576463639a3ee66c33ff7e9d94076f40df
-SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc) = 965b6d98cd4499649df98d77dbe327c0003c5aab
+SHA1 (patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc) = b74e609af6aa87bc1efb395935eea6a41b3b19d5
 SHA1 (patch-lib_ubsan_ubsan__platform.h) = 8b9419ed6d3f40357eb73e71680d070bd64bd5cc
 SHA1 (patch-test_asan_lit.cfg) = 259b0e262b5975b862a51f015ec6b646ce2af10a
 SHA1 (patch-test_sanitizer__common_CMakeLists.txt) = 6af4c5ca42f17bb09823c36bf32d5576fbc0b4c8
diff --git a/compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.h b/compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.h
new file mode 100644
index 0000000000..19e2db7d80
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_asan_asan__interceptors.h
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- lib/asan/asan_interceptors.h.orig	2017-06-03 23:53:58.000000000 +0000
++++ lib/asan/asan_interceptors.h
+@@ -34,7 +34,7 @@
+ # define ASAN_INTERCEPT_FORK 0
+ #endif
+ 
+-#if SANITIZER_FREEBSD || SANITIZER_LINUX
++#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
+ # define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 1
+ #else
+ # define ASAN_USE_ALIAS_ATTRIBUTE_FOR_INDEX 0
diff --git a/compiler-rt-netbsd/patches/patch-lib_asan_asan__linux.cc b/compiler-rt-netbsd/patches/patch-lib_asan_asan__linux.cc
new file mode 100644
index 0000000000..1275e3b215
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_asan_asan__linux.cc
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- lib/asan/asan_linux.cc.orig	2017-06-03 23:53:58.000000000 +0000
++++ lib/asan/asan_linux.cc
+@@ -13,13 +13,14 @@
+ //===----------------------------------------------------------------------===//
+ 
+ #include "sanitizer_common/sanitizer_platform.h"
+-#if SANITIZER_FREEBSD || SANITIZER_LINUX
++#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
+ 
+ #include "asan_interceptors.h"
+ #include "asan_internal.h"
+ #include "asan_thread.h"
+ #include "sanitizer_common/sanitizer_flags.h"
+ #include "sanitizer_common/sanitizer_freebsd.h"
++#include "sanitizer_common/sanitizer_netbsd.h"
+ #include "sanitizer_common/sanitizer_libc.h"
+ #include "sanitizer_common/sanitizer_procmaps.h"
+ 
+@@ -174,4 +175,4 @@ void *AsanDlSymNext(const char *sym) {
+ 
+ } // namespace __asan
+ 
+-#endif // SANITIZER_FREEBSD || SANITIZER_LINUX
++#endif // SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc
new file mode 100644
index 0000000000..d71d6cb346
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__linux__libcdep.cc
@@ -0,0 +1,69 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_linux_libcdep.cc.orig	2017-06-03 23:53:58.000000000 +0000
++++ lib/sanitizer_common/sanitizer_linux_libcdep.cc
+@@ -14,13 +14,14 @@
+ 
+ #include "sanitizer_platform.h"
+ 
+-#if SANITIZER_FREEBSD || SANITIZER_LINUX
++#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
+ 
+ #include "sanitizer_allocator_internal.h"
+ #include "sanitizer_atomic.h"
+ #include "sanitizer_common.h"
+ #include "sanitizer_flags.h"
+ #include "sanitizer_freebsd.h"
++#include "sanitizer_netbsd.h"
+ #include "sanitizer_linux.h"
+ #include "sanitizer_placement_new.h"
+ #include "sanitizer_procmaps.h"
+@@ -152,7 +153,7 @@ bool SanitizerGetThreadName(char *name, 
+ #endif
+ }
+ 
+-#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
++#if !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NETBSD
+ static uptr g_tls_size;
+ 
+ #ifdef __i386__
+@@ -180,7 +181,7 @@ void InitTlsSize() {
+ }
+ #else
+ void InitTlsSize() { }
+-#endif  // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO
++#endif  // !SANITIZER_FREEBSD && !SANITIZER_ANDROID && !SANITIZER_GO && !SANITIZER_NETBSD
+ 
+ #if (defined(__x86_64__) || defined(__i386__) || defined(__mips__) \
+     || defined(__aarch64__) || defined(__powerpc64__) || defined(__s390__) \
+@@ -337,6 +338,12 @@ uptr ThreadSelf() {
+ }
+ #endif  // SANITIZER_FREEBSD
+ 
++#if SANITIZER_NETBSD                                                                                                                                                                          
++uptr ThreadSelf() {
++  return (uptr)pthread_self();
++}
++#endif // SANITIZER_NETBSD
++
+ #if !SANITIZER_GO
+ static void GetTls(uptr *addr, uptr *size) {
+ #if SANITIZER_LINUX && !SANITIZER_ANDROID
+@@ -366,7 +373,7 @@ static void GetTls(uptr *addr, uptr *siz
+     *addr = (uptr) dtv[2];
+     *size = (*addr == 0) ? 0 : ((uptr) segbase[0] - (uptr) dtv[2]);
+   }
+-#elif SANITIZER_ANDROID
++#elif SANITIZER_ANDROID || SANITIZER_NETBSD
+   *addr = 0;
+   *size = 0;
+ #else
+@@ -377,7 +384,7 @@ static void GetTls(uptr *addr, uptr *siz
+ 
+ #if !SANITIZER_GO
+ uptr GetTlsSize() {
+-#if SANITIZER_FREEBSD || SANITIZER_ANDROID
++#if SANITIZER_FREEBSD || SANITIZER_ANDROID || SANITIZER_NETBSD
+   uptr addr, size;
+   GetTls(&addr, &size);
+   return size;
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.h b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.h
new file mode 100644
index 0000000000..a84607a548
--- /dev/null
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__netbsd.h
@@ -0,0 +1,25 @@
+$NetBSD$
+
+--- lib/sanitizer_common/sanitizer_netbsd.h.orig	2017-06-14 13:03:28.915352766 +0000
++++ lib/sanitizer_common/sanitizer_netbsd.h
+@@ -0,0 +1,20 @@
++//===-- sanitizer_freebsd.h -------------------------------------*- C++ -*-===//
++//
++//                     The LLVM Compiler Infrastructure
++//
++// This file is distributed under the University of Illinois Open Source
++// License. See LICENSE.TXT for details.
++//
++//===----------------------------------------------------------------------===//
++//
++// This file is a part of Sanitizer runtime. It contains NetBSD-specific
++// definitions.
++//
++//===----------------------------------------------------------------------===//
++
++#ifndef SANITIZER_NETBSD_H
++#define SANITIZER_NETBSD_H
++
++#include "sanitizer_internal_defs.h"
++
++#endif  // SANITIZER_NETBSD_H
diff --git a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc
index 79dc97a0a2..f9923f35f7 100644
--- a/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc
+++ b/compiler-rt-netbsd/patches/patch-lib_sanitizer__common_sanitizer__procmaps__netbsd.cc
@@ -1,6 +1,6 @@
 $NetBSD$
 
---- lib/sanitizer_common/sanitizer_procmaps_netbsd.cc.orig	2017-06-13 19:04:08.673975123 +0000
+--- lib/sanitizer_common/sanitizer_procmaps_netbsd.cc.orig	2017-06-14 11:43:17.716788351 +0000
 +++ lib/sanitizer_common/sanitizer_procmaps_netbsd.cc
 @@ -0,0 +1,79 @@
 +//===-- sanitizer_procmaps_freebsd.cc -------------------------------------===//


Home | Main Index | Thread Index | Old Index