CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-10-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 22 00:08:50 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_asm.h

Log Message:
enable NO_EXEC_STACK_DIRECTIVE on netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-10-21 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Oct 22 00:08:50 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_asm.h

Log Message:
enable NO_EXEC_STACK_DIRECTIVE on netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h:1.3	Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_asm.h	Sun Oct 22 00:08:50 2023
@@ -59,7 +59,8 @@
 #endif
 
 #if defined(__ELF__) && (defined(__GNU__) || defined(__FreeBSD__) || \
- defined(__Fuchsia__) || defined(__linux__))
+ defined(__Fuchsia__) || defined(__linux__) || \
+			 defined(__NetBSD__))
 // clang-format off
 #define NO_EXEC_STACK_DIRECTIVE .section .note.GNU-stack,"",%progbits
 // clang-format on



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-04-06 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Apr  6 09:49:12 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_mutex.h

Log Message:
Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h:1.2	Sun Apr 11 23:54:27 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h	Thu Apr  6 09:49:12 2023
@@ -39,7 +39,7 @@ class StaticSpinMutex {
   }
 
   void CheckLocked() {
-CHECK_EQ(atomic_load(_, memory_order_relaxed), 1);
+CHECK_NE(atomic_load(_, memory_order_relaxed), 0);
   }
 
  private:



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2023-04-06 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Apr  6 09:49:12 UTC 2023

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_mutex.h

Log Message:
Fix StaticSpinMutex::CheckLocked() on sparc32.

The lock gets set with atomic_exchange() -> __sync_lock_test_and_set()
which sets the value to 255 instead of 1.  Check for a taken lock
with "!= 0" instead of "== 1".  This should work on all architectures.

Ok: Matthew Green


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_mutex.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-11-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 15 12:38:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Remove extra _, thanks RVP


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.43 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.44
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.43	Sat Nov 13 10:34:39 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Nov 15 07:38:41 2021
@@ -830,10 +830,10 @@ int internal_fork() {
 
 #if SANITIZER_NETBSD
 #include 
-extern "C" int __sigaction__siginfo(int, const struct sigaction *, struct sigaction *);
+extern "C" int __sigaction_siginfo(int, const struct sigaction *, struct sigaction *);
 int internal_sigaction_norestorer(int signum, const void *act, void *oldact) {
 
-return __sigaction__siginfo(signum,
+return __sigaction_siginfo(signum,
 	reinterpret_cast(act),
 	reinterpret_cast(oldact));
 }



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-11-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Nov 15 12:38:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Remove extra _, thanks RVP


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 14:31:20 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
more underscore


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.41 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.42
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.41	Thu Oct 28 07:22:41 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Thu Oct 28 10:31:20 2021
@@ -2041,8 +2041,8 @@ static void GetPcSpBp(void *context, upt
   *pc = ucontext->uc_mcontext.gregs[REG_PC];
   *sp = ucontext->uc_mcontext.gregs[REG_O6] + STACK_BIAS;
 # elif SANITIZER_NETBSD
-  *pc = ucontext->uc_mcontext.__gregs[REG_PC];
-  *sp = ucontext->uc_mcontext.__gregs[REG_O6] + STACK_BIAS;
+  *pc = ucontext->uc_mcontext.__gregs[_REG_PC];
+  *sp = ucontext->uc_mcontext.__gregs[_REG_O6] + STACK_BIAS;
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)context;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 14:31:20 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
more underscore


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 11:22:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix sparc: use mcontext to fetch pc and sp


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.40 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.41
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.40	Sun Apr 11 19:54:27 2021
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Thu Oct 28 07:22:41 2021
@@ -1930,12 +1930,12 @@ SignalContext::WriteFlag SignalContext::
   // From OpenSolaris $SRC/uts/sun4/os/trap.c (get_accesstype).
 # if SANITIZER_SOLARIS
   uptr pc = ucontext->uc_mcontext.gregs[REG_PC];
+# elif SANITIZER_NETBSD
+  uptr pc = ucontext->uc_mcontext.__gregs[_REG_PC];
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)ucontext;
-#  if SANITIZER_NETBSD
-  uptr pc = scontext->sc_pc;
-#  elif defined(__arch64__)
+#  if defined(__arch64__)
   uptr pc = scontext->sigc_regs.tpc;
 #  else
   uptr pc = scontext->si_regs.pc;
@@ -2040,6 +2040,9 @@ static void GetPcSpBp(void *context, upt
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.gregs[REG_PC];
   *sp = ucontext->uc_mcontext.gregs[REG_O6] + STACK_BIAS;
+# elif SANITIZER_NETBSD
+  *pc = ucontext->uc_mcontext.__gregs[REG_PC];
+  *sp = ucontext->uc_mcontext.__gregs[REG_O6] + STACK_BIAS;
 # else
   // Historical BSDism here.
   struct sigcontext *scontext = (struct sigcontext *)context;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2021-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Oct 28 11:22:41 UTC 2021

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix sparc: use mcontext to fetch pc and sp


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-10-02 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Oct  2 14:36:54 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
Do not assume that _lwp_getprivate() returns unbiased private pointer

Cherry-pick and adapt:

>From 2a9ce60de98e53198047daaeeec3cf09ece4e693 Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski 
Date: Fri, 2 Oct 2020 16:13:09 +0200
Subject: [PATCH] [compiler-rt] [netbsd] Improve the portability of
 ThreadSelfTlsTcb

Use __lwp_gettcb_fast() and __lwp_getprivate_fast(), as _lwp_getprivate()
can be a biased pointer and invalid for use in this function on all CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.16 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.17
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.16	Thu Sep 10 12:53:05 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Fri Oct  2 14:36:54 2020
@@ -25,6 +25,10 @@
 #include "sanitizer_placement_new.h"
 #include "sanitizer_procmaps.h"
 
+#if SANITIZER_NETBSD
+#define _RTLD_SOURCE  // for __lwp_gettcb_fast() / __lwp_getprivate_fast()
+#endif
+
 #include   // for dlsym()
 #include 
 #include 
@@ -418,7 +422,13 @@ uptr ThreadSelf() {
 
 #if SANITIZER_NETBSD
 static struct tls_tcb * ThreadSelfTlsTcb() {
-  return (struct tls_tcb *)_lwp_getprivate();
+  struct tls_tcb *tcb = nullptr;
+#ifdef __HAVE___LWP_GETTCB_FAST
+  tcb = (struct tls_tcb *)__lwp_gettcb_fast();
+#elif defined(__HAVE___LWP_GETPRIVATE_FAST)
+  tcb = (struct tls_tcb *)__lwp_getprivate_fast();
+#endif
+  return tcb;
 }
 
 uptr ThreadSelf() {



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-10-02 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Oct  2 14:36:54 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
Do not assume that _lwp_getprivate() returns unbiased private pointer

Cherry-pick and adapt:

>From 2a9ce60de98e53198047daaeeec3cf09ece4e693 Mon Sep 17 00:00:00 2001
From: Kamil Rytarowski 
Date: Fri, 2 Oct 2020 16:13:09 +0200
Subject: [PATCH] [compiler-rt] [netbsd] Improve the portability of
 ThreadSelfTlsTcb

Use __lwp_gettcb_fast() and __lwp_getprivate_fast(), as _lwp_getprivate()
can be a biased pointer and invalid for use in this function on all CPUs.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep 17 15:43:24 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Use internal_ptrace() instead of ptrace()

Cherry-pick:

commit 0008fb343704bafc3469703be930b8a65d7c47fa
Author: Kamil Rytarowski 
Date:   Mon Sep 14 10:10:49 2020 +0200

[compiler-rt] [netbsd] Use internal_ptrace() instead of ptrace()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.5
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4	Thu Sep 17 15:42:17 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Thu Sep 17 15:43:24 2020
@@ -131,7 +131,7 @@ bool ThreadSuspender::SuspendAllThreads(
   pl.pl_lwpid = 0;
 
   int val;
-  while ((val = ptrace(op, pid_, (void *), sizeof(pl))) != -1 &&
+  while ((val = internal_ptrace(op, pid_, (void *), sizeof(pl))) != -1 &&
  pl.pl_lwpid != 0) {
 suspended_threads_list_.Append(pl.pl_lwpid);
 VReport(2, "Appended thread %d in process %d.\n", pl.pl_lwpid, pid_);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep 17 15:43:24 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Use internal_ptrace() instead of ptrace()

Cherry-pick:

commit 0008fb343704bafc3469703be930b8a65d7c47fa
Author: Kamil Rytarowski 
Date:   Mon Sep 14 10:10:49 2020 +0200

[compiler-rt] [netbsd] Use internal_ptrace() instead of ptrace()


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep 17 15:42:17 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Undo setting _KERNTYPES

The sparc ptrace(2) headers were fixed to work without defined _KERNTYPES.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3	Sun Sep 13 08:51:58 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Thu Sep 17 15:42:17 2020
@@ -18,7 +18,6 @@
 
 #if SANITIZER_NETBSD
 
-#define _KERNTYPES	/* we want register_t for some ptrace functions */
 #include "sanitizer_stoptheworld.h"
 
 #include "sanitizer_atomic.h"



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-17 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Thu Sep 17 15:42:17 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Undo setting _KERNTYPES

The sparc ptrace(2) headers were fixed to work without defined _KERNTYPES.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 13 08:51:59 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.cc
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Add missing dkbad.h include and define _KERNTYPES so we get all internal
types (like register_t) that we need for ptrace.
Fixes the build on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.5	Sat Sep 12 15:01:38 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sun Sep 13 08:51:58 2020
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2	Fri Sep 11 01:07:00 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Sun Sep 13 08:51:58 2020
@@ -18,6 +18,7 @@
 
 #if SANITIZER_NETBSD
 
+#define _KERNTYPES	/* we want register_t for some ptrace functions */
 #include "sanitizer_stoptheworld.h"
 
 #include "sanitizer_atomic.h"



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-13 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Sep 13 08:51:59 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.cc
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Add missing dkbad.h include and define _KERNTYPES so we get all internal
types (like register_t) that we need for ptrace.
Fixes the build on sparc64.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 12 22:52:24 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_posix_libcdep.cc

Log Message:
Disable GetNamedMappingFd for NetBSD

Analogous logic is in LLVM rev. 74760bb00fb9b78a2fe122.

Removes undefined symbol linkage to shm_unlink and shm_open.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-12 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Sep 12 22:52:24 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_posix_libcdep.cc

Log Message:
Disable GetNamedMappingFd for NetBSD

Analogous logic is in LLVM rev. 74760bb00fb9b78a2fe122.

Removes undefined symbol linkage to shm_unlink and shm_open.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.7 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.1.1.7 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc:1.1.1.7	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_posix_libcdep.cc	Sat Sep 12 22:52:24 2020
@@ -304,7 +304,7 @@ void PlatformPrepareForSandboxing(__sani
   MemoryMappingLayout::CacheMemoryMappings();
 }
 
-#if SANITIZER_ANDROID || SANITIZER_GO
+#if SANITIZER_ANDROID || SANITIZER_GO || SANITIZER_NETBSD
 int GetNamedMappingFd(const char *name, uptr size) {
   return -1;
 }



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:45:53 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.h

Log Message:
Add prototypes of internal_sigdelset() and internal_clone()

Cherry-pick the missing change from:

commit 983d7ddd0b278b45d815cbac9197205b39c4860a
Author: Kamil Rytarowski 
Date:   Thu Jul 11 06:22:35 2019 +

Add NetBSD LSan support

Summary:
Combine few relatively small changes into one:

 - implement internal_ptrace() and internal_clone() for NetBSD
 - add support for stoptheworld based on the ptrace(2) API
 - define COMPILER_RT_HAS_LSAN for NetBSD
 - enable tests for NetBSD/amd64

Inspired by the original implementation by Christos Zoulas in netbsd/src 
for GCC.

The implementation is in theory CPU independent through well defined macros
across all NetBSD ports, however only the x86_64 version was tested.

Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb

Reviewed By: vitalybuka

Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64057

llvm-svn: 365735


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.11
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h	Fri Sep 11 01:45:53 2020
@@ -74,12 +74,8 @@ uptr internal_prctl(int option, uptr arg
 #endif  // SANITIZER_LINUX
 
 #ifdef SANITIZER_NETBSD
-int internal_sigaction_norestorer(int signum, const void *act, void *oldact);
-#define internal_sigdelset(set, signum) \
-__sigdelset(set, signum)
-#define internal_clone(fn, child_stack, flags, arg, \
-parent_tidptr, newtls, child_tidptr) \
-__clone(fn, child_stack, flags, arg)
+void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
+uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg);
 #endif
 
 // This class reads thread IDs from /proc//task using only syscalls.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:45:53 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.h

Log Message:
Add prototypes of internal_sigdelset() and internal_clone()

Cherry-pick the missing change from:

commit 983d7ddd0b278b45d815cbac9197205b39c4860a
Author: Kamil Rytarowski 
Date:   Thu Jul 11 06:22:35 2019 +

Add NetBSD LSan support

Summary:
Combine few relatively small changes into one:

 - implement internal_ptrace() and internal_clone() for NetBSD
 - add support for stoptheworld based on the ptrace(2) API
 - define COMPILER_RT_HAS_LSAN for NetBSD
 - enable tests for NetBSD/amd64

Inspired by the original implementation by Christos Zoulas in netbsd/src 
for GCC.

The implementation is in theory CPU independent through well defined macros
across all NetBSD ports, however only the x86_64 version was tested.

Reviewers: mgorny, dvyukov, vitalybuka, joerg, jfb

Reviewed By: vitalybuka

Subscribers: dexonsmith, jfb, srhines, kubamracek, llvm-commits, christos

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D64057

llvm-svn: 365735


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:08:36 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_getauxval.h

Log Message:
Add getauxval() compat for NetBSD

Cherry-pick and adapt:

commit 02519fc7a6f8c528f67975a9f78ce64dabf402b4
Author: Kamil Rytarowski 
Date:   Thu Sep 12 18:57:58 2019 +

Add getauxval() compat for NetBSD

Summary:
getauxval() is not available on NetBSD and there is no a direct equivalent.

Add a function that implements the same semantics with NetBSD internals.

Reorder the GetPageSize() functions to prefer the sysctl approach for 
NetBSD.
It no longer makes a difference which approach is better. Avoid changing
conditional code path.

Reviewers: vitalybuka, dvyukov, mgorny, joerg

Reviewed By: vitalybuka

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D67329

llvm-svn: 371758


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h:1.1.1.1	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h	Fri Sep 11 01:08:36 2020
@@ -8,6 +8,7 @@
 // Common getauxval() guards and definitions.
 // getauxval() is not defined until glibc version 2.16, or until API level 21
 // for Android.
+// Implement the getauxval() compat function for NetBSD.
 //
 //===--===//
 
@@ -41,6 +42,23 @@ extern "C" SANITIZER_WEAK_ATTRIBUTE
 unsigned long getauxval(unsigned long type);  // NOLINT
 # endif
 
-#endif // SANITIZER_LINUX || SANITIZER_FUCHSIA
+#elif SANITIZER_NETBSD
+
+#define SANITIZER_USE_GETAUXVAL 1
+
+#include 
+#include 
+
+static inline decltype(AuxInfo::a_v) getauxval(decltype(AuxInfo::a_type) type) {
+  for (const AuxInfo *aux = (const AuxInfo *)_dlauxinfo();
+   aux->a_type != AT_NULL; ++aux) {
+if (type == aux->a_type)
+  return aux->a_v;
+  }
+
+  return 0;
+}
+
+#endif
 
 #endif // SANITIZER_GETAUXVAL_H



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:08:36 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_getauxval.h

Log Message:
Add getauxval() compat for NetBSD

Cherry-pick and adapt:

commit 02519fc7a6f8c528f67975a9f78ce64dabf402b4
Author: Kamil Rytarowski 
Date:   Thu Sep 12 18:57:58 2019 +

Add getauxval() compat for NetBSD

Summary:
getauxval() is not available on NetBSD and there is no a direct equivalent.

Add a function that implements the same semantics with NetBSD internals.

Reorder the GetPageSize() functions to prefer the sysctl approach for 
NetBSD.
It no longer makes a difference which approach is better. Avoid changing
conditional code path.

Reviewers: vitalybuka, dvyukov, mgorny, joerg

Reviewed By: vitalybuka

Subscribers: llvm-commits, #sanitizers

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D67329

llvm-svn: 371758


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_getauxval.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:53 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Use sysctl to implement GetPageSize()

Cherry-pick code chunk from newer LLVM compiler-rt.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.37
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36	Mon Sep  7 00:22:51 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Fri Sep 11 01:07:53 2020
@@ -1139,6 +1139,14 @@ uptr GetPageSize() {
 // Android post-M sysconf(_SC_PAGESIZE) crashes if called from .preinit_array.
 #if SANITIZER_ANDROID
   return 4096;
+#elif SANITIZER_FREEBSD || SANITIZER_NETBSD
+// Use sysctl as sysconf can trigger interceptors internally.
+  int pz = 0;
+  uptr pzl = sizeof(pz);
+  int mib[2] = {CTL_HW, HW_PAGESIZE};
+  int rv = internal_sysctl(mib, 2, , , nullptr, 0);
+  CHECK_EQ(rv, 0);
+  return (uptr)pz;
 #elif SANITIZER_LINUX && (defined(__x86_64__) || defined(__i386__))
   return EXEC_PAGESIZE;
 #elif SANITIZER_USE_GETAUXVAL



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:53 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Use sysctl to implement GetPageSize()

Cherry-pick code chunk from newer LLVM compiler-rt.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:27 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_internal_defs.h

Log Message:
Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD

Cherry-pick:

commit 3a189bac9bb111c9a59339015ab0d4e2fed735f4
Author: Kamil Rytarowski 
Date:   Thu Dec 19 03:21:46 2019 +0100

[compiler-rt] Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD

.preinit_array is supported since 9.0.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.12 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.13
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:1.12	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h	Fri Sep 11 01:07:27 2020
@@ -104,7 +104,7 @@
 // FIXME: do we have anything like this on Mac?
 #ifndef SANITIZER_CAN_USE_PREINIT_ARRAY
 #if ((SANITIZER_LINUX && !SANITIZER_ANDROID) || SANITIZER_OPENBSD || \
- SANITIZER_FUCHSIA) && !defined(PIC)
+ SANITIZER_FUCHSIA || SANITIZER_NETBSD) && !defined(PIC)
 #define SANITIZER_CAN_USE_PREINIT_ARRAY 1
 // Before Solaris 11.4, .preinit_array is fully supported only with GNU ld.
 // FIXME: Check for those conditions.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:27 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_internal_defs.h

Log Message:
Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD

Cherry-pick:

commit 3a189bac9bb111c9a59339015ab0d4e2fed735f4
Author: Kamil Rytarowski 
Date:   Thu Dec 19 03:21:46 2019 +0100

[compiler-rt] Enable SANITIZER_CAN_USE_PREINIT_ARRAY on NetBSD

.preinit_array is supported since 9.0.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_internal_defs.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:00 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Adapt stop-the-world for ptrace changes in NetBSD-9.99.30

Cherry-pick and adapt:

commit fc356dcc11c10003ff22acff667b0a9f5e6c1e0f
Author: Kamil Rytarowski 
Date:   Tue Dec 24 20:33:54 2019 +0100

[compiler-rt] Adapt stop-the-world for ptrace changes in NetBSD-9.99.30

Handle PT_LWPNEXT for newer kernels and keep PT_LWPINFO for older ones.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:07:00 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_netbsd_libcdep.cc

Log Message:
Adapt stop-the-world for ptrace changes in NetBSD-9.99.30

Cherry-pick and adapt:

commit fc356dcc11c10003ff22acff667b0a9f5e6c1e0f
Author: Kamil Rytarowski 
Date:   Tue Dec 24 20:33:54 2019 +0100

[compiler-rt] Adapt stop-the-world for ptrace changes in NetBSD-9.99.30

Handle PT_LWPNEXT for newer kernels and keep PT_LWPINFO for older ones.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc:1.1	Fri Sep 11 01:05:28 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_netbsd_libcdep.cc	Fri Sep 11 01:07:00 2020
@@ -120,10 +120,18 @@ bool ThreadSuspender::SuspendAllThreads(
 
   VReport(2, "Attached to process %d.\n", pid_);
 
+#ifdef PT_LWPNEXT
+  struct ptrace_lwpstatus pl;
+  int op = PT_LWPNEXT;
+#else
   struct ptrace_lwpinfo pl;
-  int val;
+  int op = PT_LWPINFO;
+#endif
+
   pl.pl_lwpid = 0;
-  while ((val = ptrace(PT_LWPINFO, pid_, (void *), sizeof(pl))) != -1 &&
+
+  int val;
+  while ((val = ptrace(op, pid_, (void *), sizeof(pl))) != -1 &&
  pl.pl_lwpid != 0) {
 suspended_threads_list_.Append(pl.pl_lwpid);
 VReport(2, "Appended thread %d in process %d.\n", pl.pl_lwpid, pid_);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:01:14 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_linux_libcdep.cc

Log Message:
Disable sanitizer_stoptheworld_linux_libcdep.cc for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-10 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Fri Sep 11 01:01:14 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_stoptheworld_linux_libcdep.cc

Log Message:
Disable sanitizer_stoptheworld_linux_libcdep.cc for NetBSD


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.11 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.12
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.11	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc	Fri Sep 11 01:01:14 2020
@@ -12,7 +12,7 @@
 
 #include "sanitizer_platform.h"
 
-#if (SANITIZER_LINUX || SANITIZER_NETBSD) && \
+#if SANITIZER_LINUX && \
 		   (defined(__x86_64__) || defined(__mips__) || \
 defined(__aarch64__) || defined(__powerpc64__) || \
 defined(__s390__) || defined(__i386__) || \



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 07:10:43 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
avoid returning stack garbage on platforms that don't have either
__lwp_gettcb_fast() or __lwp_getprivate_fast().


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-07 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 07:10:43 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
avoid returning stack garbage on platforms that don't have either
__lwp_gettcb_fast() or __lwp_getprivate_fast().


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.15
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14	Sun Sep  6 05:30:17 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Mon Sep  7 07:10:43 2020
@@ -417,7 +417,7 @@ uptr ThreadSelf() {
 
 #if SANITIZER_NETBSD
 static struct tls_tcb * ThreadSelfTlsTcb() {
-  struct tls_tcb * tcb;
+  struct tls_tcb * tcb = NULL;
 # ifdef __HAVE___LWP_GETTCB_FAST
   tcb = (struct tls_tcb *)__lwp_gettcb_fast();
 # elif defined(__HAVE___LWP_GETPRIVATE_FAST)



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 00:22:51 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix for netbsd/mips.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Sep  7 00:22:51 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix for netbsd/mips.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.36
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35	Sun Sep  6 10:55:16 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Sep  7 00:22:51 2020
@@ -33,6 +33,7 @@
 // format. Struct kernel_stat is defined as 'struct stat' in asm/stat.h. To
 // access stat from asm/stat.h, without conflicting with definition in
 // sys/stat.h, we use this trick.
+#if SANITIZER_LINUX
 #if defined(__mips64)
 #include 
 #include 
@@ -40,6 +41,7 @@
 #include 
 #undef stat
 #endif
+#endif
 
 #if SANITIZER_NETBSD
 #include 
@@ -1848,7 +1850,12 @@ SignalContext::WriteFlag SignalContext::
   uint32_t faulty_instruction;
   uint32_t op_code;
 
+#if SANITIZER_NETBSD
+  ucontext_t *nucontext = (ucontext_t *)ucontext;
+  exception_source = (uint32_t *)_UC_MACHINE_PC(nucontext);
+#else
   exception_source = (uint32_t *)ucontext->uc_mcontext.pc;
+#endif
   faulty_instruction = (uint32_t)(*exception_source);
 
   op_code = (faulty_instruction >> 26) & 0x3f;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep  6 17:15:09 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.cc

Log Message:
comment out ioctl that is only defined for the kernel


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3	Sun Sep  6 06:55:16 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sun Sep  6 13:15:09 2020
@@ -1774,8 +1774,10 @@ unsigned IOCTL_MTIOCSLOCATE = MTIOCSLOCA
 unsigned IOCTL_MTIOCHLOCATE = MTIOCHLOCATE;
 unsigned IOCTL_POWER_EVENT_RECVDICT = POWER_EVENT_RECVDICT;
 unsigned IOCTL_POWER_IOC_GET_TYPE = POWER_IOC_GET_TYPE;
+#if 0
 unsigned IOCTL_POWER_IOC_GET_TYPE_WITH_LOSSAGE =
 POWER_IOC_GET_TYPE_WITH_LOSSAGE;
+#endif
 unsigned IOCTL_RIOCGINFO = RIOCGINFO;
 unsigned IOCTL_RIOCSINFO = RIOCSINFO;
 unsigned IOCTL_RIOCSSRCH = RIOCSSRCH;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Sep  6 17:15:09 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_netbsd.cc

Log Message:
comment out ioctl that is only defined for the kernel


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep  6 10:55:16 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_platform_limits_netbsd.cc

Log Message:
re-port to netbsd/sparc*
fix build on non-constant pagesize platforms and for dkbad.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-06 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep  6 10:55:16 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_platform_limits_netbsd.cc

Log Message:
re-port to netbsd/sparc*
fix build on non-constant pagesize platforms and for dkbad.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.35
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sun Sep  6 10:55:16 2020
@@ -1908,8 +1908,10 @@ SignalContext::WriteFlag SignalContext::
   uptr pc = ucontext->uc_mcontext.gregs[REG_PC];
 # else
   // Historical BSDism here.
-  struct sigcontext *scontext = (struct sigcontext *)context;
-#  if defined(__arch64__)
+  struct sigcontext *scontext = (struct sigcontext *)ucontext;
+#  if SANITIZER_NETBSD
+  uptr pc = scontext->sc_pc;
+#  elif defined(__arch64__)
   uptr pc = scontext->sigc_regs.tpc;
 #  else
   uptr pc = scontext->si_regs.pc;

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sun Sep  6 10:55:16 2020
@@ -83,6 +83,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #define RAY_DO_SIGLEV
 #include 
@@ -103,7 +104,10 @@
 #include 
 #include 
 #include 
+/* XXX relies upon NBPG which is not always constant, or provided. */
+#ifdef NBPG
 #include 
+#endif
 #include 
 #include 
 #include 
@@ -620,7 +624,9 @@ unsigned struct_sppplcpcfg_sz = sizeof(s
 unsigned struct_spppstatus_sz = sizeof(spppstatus);
 unsigned struct_spppstatusncp_sz = sizeof(spppstatusncp);
 unsigned struct_srt_rt_sz = sizeof(srt_rt);
+#ifdef NBPG
 unsigned struct_stic_xinfo_sz = sizeof(stic_xinfo);
+#endif
 unsigned struct_sun_dkctlr_sz = sizeof(sun_dkctlr);
 unsigned struct_sun_dkgeom_sz = sizeof(sun_dkgeom);
 unsigned struct_sun_dkpart_sz = sizeof(sun_dkpart);
@@ -1183,10 +1189,12 @@ unsigned IOCTL_KIOCGLED = KIOCGLED;
 unsigned IOCTL_KIOCLAYOUT = KIOCLAYOUT;
 unsigned IOCTL_VUIDSFORMAT = VUIDSFORMAT;
 unsigned IOCTL_VUIDGFORMAT = VUIDGFORMAT;
+#ifdef NBPG
 unsigned IOCTL_STICIO_GXINFO = STICIO_GXINFO;
 unsigned IOCTL_STICIO_RESET = STICIO_RESET;
 unsigned IOCTL_STICIO_STARTQ = STICIO_STARTQ;
 unsigned IOCTL_STICIO_STOPQ = STICIO_STOPQ;
+#endif
 unsigned IOCTL_UKYOPON_IDENTIFY = UKYOPON_IDENTIFY;
 unsigned IOCTL_USB_REQUEST = USB_REQUEST;
 unsigned IOCTL_USB_SETDEBUG = USB_SETDEBUG;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep  6 05:30:17 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
fix merge botch: netbsd doesn't want any of this.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.14
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13	Sat Sep  5 13:35:55 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Sun Sep  6 05:30:17 2020
@@ -543,13 +543,15 @@ void GetThreadStackAndTls(bool main, upt
 #endif
 }
 
-#if !SANITIZER_FREEBSD && !SANITIZER_NETBSD
+#if !SANITIZER_NETBSD
+#if !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
 typedef ElfW(Phdr) Elf_Phdr;
 #elif SANITIZER_WORDSIZE == 32 && __FreeBSD_version <= 902001 // v9.2
 #define Elf_Phdr XElf32_Phdr
 #define dl_phdr_info xdl_phdr_info
 #define dl_iterate_phdr(c, b) xdl_iterate_phdr((c), (b))
 #endif // !SANITIZER_FREEBSD && !SANITIZER_OPENBSD
+#endif // !SANITIZER_NETBSD
 
 struct DlIteratePhdrData {
   InternalMmapVectorNoCtor *modules;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Sep  6 05:30:17 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux_libcdep.cc

Log Message:
fix merge botch: netbsd doesn't want any of this.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc

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



Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread Kamil Rytarowski
On 05.09.2020 15:35, matthew green wrote:
> Module Name:  src
> Committed By: mrg
> Date: Sat Sep  5 13:35:55 UTC 2020
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_linux.cc sanitizer_linux.h sanitizer_linux_libcdep.cc
>   sanitizer_platform_limits_netbsd.cc sanitizer_syscall_generic.inc
> 
> Log Message:
> fix various merge botches; we may need to re-port the ThreadLister code.
> 


LSan was ported and upstreamed post GCC-9:

https://github.com/llvm/llvm-project/commit/1b58389428ed07a7322ba9c2bcaeec99807f9457

https://github.com/llvm/llvm-project/commit/5fe1e55d35413b1904cfcf16ec15495398921fe5

https://github.com/llvm/llvm-project/commit/8827047551570b7ed7088765c3de2a8cce6823b8

https://github.com/llvm/llvm-project/commit/983d7ddd0b278b45d815cbac9197205b39c4860a

https://github.com/llvm/llvm-project/commit/fc356dcc11c10003ff22acff667b0a9f5e6c1e0f

https://github.com/llvm/llvm-project/commit/3a189bac9bb111c9a59339015ab0d4e2fed735f4

https://github.com/llvm/llvm-project/commit/02519fc7a6f8c528f67975a9f78ce64dabf402b4

And possibly something else:

https://github.com/llvm/llvm-project/commits?author=krytarowski

> 
> To generate a diff of this commit:
> cvs rdiff -u -r1.33 -r1.34 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
> cvs rdiff -u -r1.9 -r1.10 \
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
> cvs rdiff -u -r1.12 -r1.13 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
> cvs rdiff -u -r1.1.1.2 -r1.2 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
> cvs rdiff -u -r1.8 -r1.9 \
> 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc
> 
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
> 
> 
> Modified files:
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33
>  
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34
> --- 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33
>   Sat Sep  5 09:12:32 2020
> +++ 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc   
> Sat Sep  5 13:35:55 2020
> @@ -41,8 +41,6 @@
>  #undef stat
>  #endif
>  
> -#endif // SANITIZER_LINUX
> -
>  #if SANITIZER_NETBSD
>  #include 
>  #endif
> @@ -980,7 +978,6 @@ ThreadLister::ThreadLister(pid_t pid) : 
>if (internal_iserror(descriptor_)) {
>  Report("Can't open /proc/%d/task for reading.\n", pid);
>}
> -#endif
>  }
>  
>  ThreadLister::Result ThreadLister::ListThreads(
> @@ -1055,10 +1052,8 @@ bool ThreadLister::IsAlive(int tid) {
>  }
>  
>  ThreadLister::~ThreadLister() {
> -#ifndef SANITIZER_NETBSD
>if (!internal_iserror(descriptor_))
>  internal_close(descriptor_);
> -#endif
>  }
>  #endif
>  
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9
>  
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10
> --- 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9
> Sat Sep  5 09:12:32 2020
> +++ 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
> Sat Sep  5 13:35:55 2020
> @@ -69,6 +69,8 @@ uptr internal_clone(int (*fn)(void *), v
>  #endif
>  #elif SANITIZER_FREEBSD
>  void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
> +#elif SANITIZER_NETBSD
> +uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
>  #endif  // SANITIZER_LINUX
>  
>  #ifdef SANITIZER_NETBSD
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12
>  
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13
> --- 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12
>   Sat Sep  5 09:12:32 2020
> +++ 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
>Sat Sep  5 13:35:55 2020
> @@ -72,6 +72,10 @@ struct __sanitizer::linux_dirent {
>  #include 
>  #endif
>  
> +#if SANITIZER_NETBSD
> +#include 
> +#endif
> +
>  namespace __sanitizer {
>  
>  SANITIZER_WEAK_ATTRIBUTE int
> 
> Index: 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
> diff -u 
> src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2
>  
> 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep  5 13:35:55 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_linux.h sanitizer_linux_libcdep.cc
sanitizer_platform_limits_netbsd.cc sanitizer_syscall_generic.inc

Log Message:
fix various merge botches; we may need to re-port the ThreadLister code.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
cvs rdiff -u -r1.12 -r1.13 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
cvs rdiff -u -r1.1.1.2 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.34
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.33	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Sep  5 13:35:55 2020
@@ -41,8 +41,6 @@
 #undef stat
 #endif
 
-#endif // SANITIZER_LINUX
-
 #if SANITIZER_NETBSD
 #include 
 #endif
@@ -980,7 +978,6 @@ ThreadLister::ThreadLister(pid_t pid) : 
   if (internal_iserror(descriptor_)) {
 Report("Can't open /proc/%d/task for reading.\n", pid);
   }
-#endif
 }
 
 ThreadLister::Result ThreadLister::ListThreads(
@@ -1055,10 +1052,8 @@ bool ThreadLister::IsAlive(int tid) {
 }
 
 ThreadLister::~ThreadLister() {
-#ifndef SANITIZER_NETBSD
   if (!internal_iserror(descriptor_))
 internal_close(descriptor_);
-#endif
 }
 #endif
 

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.10
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h:1.9	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h	Sat Sep  5 13:35:55 2020
@@ -69,6 +69,8 @@ uptr internal_clone(int (*fn)(void *), v
 #endif
 #elif SANITIZER_FREEBSD
 void internal_sigdelset(__sanitizer_sigset_t *set, int signum);
+#elif SANITIZER_NETBSD
+uptr internal_prctl(int option, uptr arg2, uptr arg3, uptr arg4, uptr arg5);
 #endif  // SANITIZER_LINUX
 
 #ifdef SANITIZER_NETBSD

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.13
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc:1.12	Sat Sep  5 09:12:32 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc	Sat Sep  5 13:35:55 2020
@@ -72,6 +72,10 @@ struct __sanitizer::linux_dirent {
 #include 
 #endif
 
+#if SANITIZER_NETBSD
+#include 
+#endif
+
 namespace __sanitizer {
 
 SANITIZER_WEAK_ATTRIBUTE int

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc:1.1.1.2	Sat Sep  5 07:52:57 2020
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc	Sat Sep  5 13:35:55 2020
@@ -35,7 +35,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -48,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -73,6 +71,7 @@
 #include 
 #include 
 #include 
+#undef INLINE
 #include 
 #include 
 #include 
@@ -106,7 +105,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -114,7 +112,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -122,6 +119,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -130,8 +128,6 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
@@ -347,8 +343,6 @@ unsigned struct_apm_power_info_sz = size
 unsigned struct_atabusiodetach_args_sz = 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2020-09-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Sep  5 13:35:55 UTC 2020

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_linux.h sanitizer_linux_libcdep.cc
sanitizer_platform_limits_netbsd.cc sanitizer_syscall_generic.inc

Log Message:
fix various merge botches; we may need to re-port the ThreadLister code.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.9 -r1.10 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.h
cvs rdiff -u -r1.12 -r1.13 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux_libcdep.cc
cvs rdiff -u -r1.1.1.2 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_netbsd.cc
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:24:20 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Don't require procfs to be mounted with linux so that /task is available
and explain why.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-06-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun  1 17:24:20 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Don't require procfs to be mounted with linux so that /task is available
and explain why.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.31
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30	Fri Apr 26 20:23:17 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Jun  1 13:24:20 2019
@@ -854,6 +854,18 @@ ThreadLister::ThreadLister(int pid)
 error_(true),
 entry_((struct linux_dirent *)buffer_.data()),
 bytes_read_(0) {
+#if SANITIZER_NETBSD
+  /*
+   * netbsd does not have "tasks". Our lwp's are not like processes, 
+   * and this is used to suspend each task by attaching to them and stopping
+   * them. We do this at the process level, so we hijack the descriptor to
+   * permanently store our pid (the pid to trace and stop), and bytes_read_
+   * to store a copy of it, that we set to -1 once we read it.
+   */
+  descriptor_ = pid;
+  bytes_read_ = pid;
+  error_ = false;
+#else
   char task_directory_path[80];
   internal_snprintf(task_directory_path, sizeof(task_directory_path),
 "/proc/%d/task/", pid);
@@ -865,9 +877,15 @@ ThreadLister::ThreadLister(int pid)
 error_ = false;
 descriptor_ = openrv;
   }
+#endif
 }
 
 int ThreadLister::GetNextTID() {
+#if SANITIZER_NETBSD
+  int tid = bytes_read_;
+  bytes_read_ = -1;
+  return tid;
+#else
   int tid = -1;
   do {
 if (error_)
@@ -882,17 +900,25 @@ int ThreadLister::GetNextTID() {
 entry_ = (struct linux_dirent *)(((char *)entry_) + entry_->d_reclen);
   } while (tid < 0);
   return tid;
+#endif
 }
 
 void ThreadLister::Reset() {
+#if SANITIZER_NETBSD
+  bytes_read_ = descriptor_;
+  error_ = false;
+#else
   if (error_ || descriptor_ < 0)
 return;
   internal_lseek(descriptor_, 0, SEEK_SET);
+#endif
 }
 
 ThreadLister::~ThreadLister() {
+#ifndef SANITIZER_NETBSD
   if (descriptor_ >= 0)
 internal_close(descriptor_);
+#endif
 }
 
 bool ThreadLister::error() { return error_; }



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr 27 00:23:18 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Backport improvements into GCC's sanitizer_linux.cc from more recent LLVM

Backport fixups for syscall()/__syscall() routines from LLVM compiler-rt
dated October 1st 2018. The commit beffore switching LLVM compiler-rt
sycall calls to libc calls for NetBSD.

GCC8 will get part of these changes from upstream and GCC9 will operate on
libc calls directly for the NetBSD port.

This is intended to correct misuse of parameters of syscall()/__syscall()
that could break !x86 ports in UBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.30
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29	Tue Apr 16 07:34:54 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Apr 27 00:23:17 2019
@@ -42,6 +42,10 @@
 
 #endif // !SANITIZER_FREEBSD && !SANITIZER_NETBSD
 
+#if SANITIZER_NETBSD
+#include 
+#endif
+
 #include 
 #include 
 #include 
@@ -74,6 +78,8 @@ extern char **environ;  // provided by c
 #if SANITIZER_NETBSD
 #include 	// For NAME_MAX
 #include 
+#include 
+extern struct ps_strings *__ps_strings;
 extern char **environ;  // provided by crt1
 #endif  // SANITIZER_NETBSD
 
@@ -147,11 +153,11 @@ uptr internal_mmap(void *addr, uptr leng
 #endif // !SANITIZER_S390
 
 uptr internal_munmap(void *addr, uptr length) {
-  return internal_syscall(SYSCALL(munmap), (uptr)addr, length);
+  return internal_syscall_ptr(SYSCALL(munmap), (uptr)addr, length);
 }
 
 int internal_mprotect(void *addr, uptr length, int prot) {
-  return internal_syscall(SYSCALL(mprotect), (uptr)addr, length, prot);
+  return internal_syscall_ptr(SYSCALL(mprotect), (uptr)addr, length, prot);
 }
 
 uptr internal_close(fd_t fd) {
@@ -162,7 +168,7 @@ uptr internal_open(const char *filename,
 #if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags);
 #else
-  return internal_syscall(SYSCALL(open), (uptr)filename, flags);
+  return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags);
 #endif
 }
 
@@ -171,7 +177,7 @@ uptr internal_open(const char *filename,
   return internal_syscall(SYSCALL(openat), AT_FDCWD, (uptr)filename, flags,
   mode);
 #else
-  return internal_syscall(SYSCALL(open), (uptr)filename, flags, mode);
+  return internal_syscall_ptr(SYSCALL(open), (uptr)filename, flags, mode);
 #endif
 }
 
@@ -200,7 +206,7 @@ uptr internal_write(fd_t fd, const void 
 uptr internal_ftruncate(fd_t fd, uptr size) {
   sptr res;
 #ifdef SANITIZER_NETBSD
-  HANDLE_EINTR(res, internal_syscall(SYSCALL(ftruncate), fd, 0, (s64)size));
+  HANDLE_EINTR(res, internal_syscall64(SYSCALL(ftruncate), fd, 0, (s64)size));
 #else
   HANDLE_EINTR(res, (sptr)internal_syscall(SYSCALL(ftruncate), fd,
(OFF_T)size));
@@ -250,7 +256,7 @@ static void kernel_stat_to_stat(struct k
 
 uptr internal_stat(const char *path, void *buf) {
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
-  return internal_syscall(SYSCALL(stat), path, buf);
+  return internal_syscall_ptr(SYSCALL(fstatat), AT_FDCWD, (uptr)path, (uptr)buf, 0);
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
   (uptr)buf, 0);
@@ -274,7 +280,7 @@ uptr internal_stat(const char *path, voi
 
 uptr internal_lstat(const char *path, void *buf) {
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
-  return internal_syscall(SYSCALL(lstat), path, buf);
+  return internal_syscall_ptr(SYSCALL(lstat), path, buf);
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(newfstatat), AT_FDCWD, (uptr)path,
  (uptr)buf, AT_SYMLINK_NOFOLLOW);
@@ -298,7 +304,7 @@ uptr internal_lstat(const char *path, vo
 
 uptr internal_fstat(fd_t fd, void *buf) {
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
-  return internal_syscall(SYSCALL(fstat), fd, (uptr)buf);
+  return internal_syscall_ptr(SYSCALL(fstat), fd, (uptr)buf);
 #elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return = internal_syscall(SYSCALL(fstat), fd, );
 #elif SANITIZER_LINUX_USES_64BIT_SYSCALLS
@@ -336,7 +342,7 @@ uptr internal_dup2(int oldfd, int newfd)
 
 uptr internal_readlink(const char *path, char *buf, uptr bufsize) {
 #if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(readlink), path, buf, 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-26 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Sat Apr 27 00:23:18 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Backport improvements into GCC's sanitizer_linux.cc from more recent LLVM

Backport fixups for syscall()/__syscall() routines from LLVM compiler-rt
dated October 1st 2018. The commit beffore switching LLVM compiler-rt
sycall calls to libc calls for NetBSD.

GCC8 will get part of these changes from upstream and GCC9 will operate on
libc calls directly for the NetBSD port.

This is intended to correct misuse of parameters of syscall()/__syscall()
that could break !x86 ports in UBSan.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 07:34:54 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
no clone() on netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.29
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28	Tue Apr 16 01:40:16 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Tue Apr 16 07:34:54 2019
@@ -1182,7 +1182,7 @@ uptr internal_clone(int (*fn)(void *), v
: "x30", "memory");
   return res;
 }
-#elif defined(__powerpc64__)
+#elif defined(__powerpc64__) && SANITIZER_LINUX
 uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
int *parent_tidptr, void *newtls, int *child_tidptr) {
   long long res;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-16 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Apr 16 07:34:54 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
no clone() on netbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 16 01:40:16 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Sync GetPcSpBp() with GCC9 (and recent LLVM)

Unify all NetBSD ports in a single ifdef.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.28
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27	Mon Apr 15 15:58:23 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Tue Apr 16 01:40:16 2019
@@ -1402,51 +1402,39 @@ SignalContext::WriteFlag SignalContext::
 }
 
 void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
-#if defined(__arm__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
+#if SANITIZER_NETBSD
+  // This covers all NetBSD architectures
+  ucontext_t *ucontext = (ucontext_t *)context;
   *pc = _UC_MACHINE_PC(ucontext);
+  *bp = _UC_MACHINE_FP(ucontext);
   *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[_REG_R11];
-# else
+#elif defined(__arm__)
+  ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.arm_pc;
   *bp = ucontext->uc_mcontext.arm_fp;
   *sp = ucontext->uc_mcontext.arm_sp;
-# endif
 #elif defined(__aarch64__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[29]; /* XXX */
-# else
   *pc = ucontext->uc_mcontext.pc;
   *bp = ucontext->uc_mcontext.regs[29];
   *sp = ucontext->uc_mcontext.sp;
-# endif
 #elif defined(__hppa__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[3]; /* XXX */
-#else
   *pc = ucontext->uc_mcontext.sc_iaoq[0];
   /* GCC uses %r3 whenever a frame pointer is needed.  */
   *bp = ucontext->uc_mcontext.sc_gr[3];
   *sp = ucontext->uc_mcontext.sc_gr[30];
-# endif
 #elif defined(__x86_64__)
 # if SANITIZER_FREEBSD
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.mc_rip;
   *bp = ucontext->uc_mcontext.mc_rbp;
   *sp = ucontext->uc_mcontext.mc_rsp;
-# elif SANITIZER_NETBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.__gregs[_REG_RIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_RBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_RSP];
+#elif SANITIZER_OPENBSD
+  sigcontext *ucontext = (sigcontext *)context;
+  *pc = ucontext->sc_rip;
+  *bp = ucontext->sc_rbp;
+  *sp = ucontext->sc_rsp;
 # else
   ucontext_t *ucontext = (ucontext_t*)context;
   *pc = ucontext->uc_mcontext.gregs[REG_RIP];
@@ -1459,94 +1447,64 @@ void GetPcSpBp(void *context, uptr *pc, 
   *pc = ucontext->uc_mcontext.mc_eip;
   *bp = ucontext->uc_mcontext.mc_ebp;
   *sp = ucontext->uc_mcontext.mc_esp;
-# elif SANITIZER_NETBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.__gregs[_REG_EIP];
-  *bp = ucontext->uc_mcontext.__gregs[_REG_EBP];
-  *sp = ucontext->uc_mcontext.__gregs[_REG_ESP];
-# else
-  ucontext_t *ucontext = (ucontext_t*)context;
+#elif SANITIZER_OPENBSD
+  sigcontext *ucontext = (sigcontext *)context;
+  *pc = ucontext->sc_eip;
+  *bp = ucontext->sc_ebp;
+  *sp = ucontext->sc_esp;
+# else
+  ucontext_t *ucontext = (ucontext_t*)context;
+# if SANITIZER_SOLARIS
+  /* Use the numeric values: the symbolic ones are undefined by llvm
+ include/llvm/Support/Solaris.h.  */
+# ifndef REG_EIP
+#  define REG_EIP 14 // REG_PC
+# endif
+# ifndef REG_EBP
+#  define REG_EBP  6 // REG_FP
+# endif
+# ifndef REG_ESP
+#  define REG_ESP 17 // REG_SP
+# endif
+# endif
   *pc = ucontext->uc_mcontext.gregs[REG_EIP];
   *bp = ucontext->uc_mcontext.gregs[REG_EBP];
   *sp = ucontext->uc_mcontext.gregs[REG_ESP];
 # endif
 #elif defined(__powerpc__) || defined(__powerpc64__)
   ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_NETBSD
-  *pc = _UC_MACHINE_PC(ucontext);
-  *sp = _UC_MACHINE_SP(ucontext);
-  *bp = ucontext->uc_mcontext.__gregs[_REG_R31];
-#  else
   *pc = ucontext->uc_mcontext.regs->nip;
   *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
   // The powerpc{,64}-linux ABIs do not specify r31 as the frame
   // pointer, but GCC always uses r31 when we need a frame pointer.
   *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
-# endif
 #elif defined(__sparc__)
+# if defined(__arch64__) || defined(__sparcv9)
+#  define STACK_BIAS 

CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Tue Apr 16 01:40:16 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Sync GetPcSpBp() with GCC9 (and recent LLVM)

Unify all NetBSD ports in a single ifdef.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 15 15:58:23 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Provide riscv implementation.

XXX this is MI, why not use it for everyone?


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-04-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Mon Apr 15 15:58:23 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Provide riscv implementation.

XXX this is MI, why not use it for everyone?


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.26 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.27
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.26	Tue Feb  5 12:56:43 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Apr 15 15:58:23 2019
@@ -1542,6 +1542,11 @@ void GetPcSpBp(void *context, uptr *pc, 
   *pc = _UC_MACHINE_PC(ucontext);
   *sp = _UC_MACHINE_SP(ucontext);
   *bp = ucontext->uc_mcontext.__gregs[1];	/* XXX */
+#elif defined(__riscv) && SANITIZER_NETBSD
+  ucontext_t *ucontext = (ucontext_t*)context;
+  *pc = _UC_MACHINE_PC(ucontext);
+  *sp = _UC_MACHINE_SP(ucontext);
+  *bp = _UC_MACHINE_FP(ucontext);
 #elif defined(__s390__)
   ucontext_t *ucontext = (ucontext_t*)context;
 # if defined(__s390x__)



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 03:59:09 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: Makefile.am
Makefile.in

Log Message:
add sanitizer_procmaps_netbsd.cc


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.1.1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am:1.1.1.4	Sat Jan 19 10:14:03 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am	Wed Feb  6 03:59:09 2019
@@ -42,6 +42,7 @@ sanitizer_common_files = \
 	sanitizer_printf.cc \
 	sanitizer_procmaps_common.cc \
 	sanitizer_procmaps_freebsd.cc \
+	sanitizer_procmaps_netbsd.cc \
 	sanitizer_procmaps_linux.cc \
 	sanitizer_procmaps_mac.cc \
 	sanitizer_stackdepot.cc \
Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.1.1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in:1.1.1.4	Sat Jan 19 10:14:03 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in	Wed Feb  6 03:59:09 2019
@@ -93,6 +93,7 @@ am__objects_1 = sanitizer_allocator.lo s
 	sanitizer_platform_limits_posix.lo sanitizer_posix.lo \
 	sanitizer_posix_libcdep.lo sanitizer_printf.lo \
 	sanitizer_procmaps_common.lo sanitizer_procmaps_freebsd.lo \
+	sanitizer_procmaps_netbsd.lo \
 	sanitizer_procmaps_linux.lo sanitizer_procmaps_mac.lo \
 	sanitizer_stackdepot.lo sanitizer_stacktrace.lo \
 	sanitizer_stacktrace_libcdep.lo sanitizer_symbolizer_mac.lo \
@@ -323,6 +324,7 @@ sanitizer_common_files = \
 	sanitizer_printf.cc \
 	sanitizer_procmaps_common.cc \
 	sanitizer_procmaps_freebsd.cc \
+	sanitizer_procmaps_netbsd.cc \
 	sanitizer_procmaps_linux.cc \
 	sanitizer_procmaps_mac.cc \
 	sanitizer_stackdepot.cc \
@@ -464,6 +466,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_printf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_common.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_freebsd.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_netbsd.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_linux.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_procmaps_mac.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sanitizer_stackdepot.Plo@am__quote@



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 03:59:09 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common: Makefile.am
Makefile.in

Log Message:
add sanitizer_procmaps_netbsd.cc


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.4 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.am \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/Makefile.in

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb  5 12:56:43 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
provide empty version of Aarch64GetESR() for non-linux arm64.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.25 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.26
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.25	Mon Feb  4 03:00:11 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Tue Feb  5 12:56:43 2019
@@ -1346,6 +1346,7 @@ void internal_join_thread(void *th) {}
 #endif
 
 #if defined(__aarch64__)
+#if SANITIZER_LINUX
 // Android headers in the older NDK releases miss this definition.
 struct __sanitizer_esr_context {
   struct _aarch64_ctx head;
@@ -1366,6 +1367,11 @@ static bool Aarch64GetESR(ucontext_t *uc
   }
   return false;
 }
+#else
+static bool Aarch64GetESR(ucontext_t *ucontext, u64 *esr) {
+  return false;
+}
+#endif
 #endif
 
 SignalContext::WriteFlag SignalContext::GetWriteFlag(void *context) {



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb  5 12:56:43 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
provide empty version of Aarch64GetESR() for non-linux arm64.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb  4 03:00:11 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
make the internal_fstat() for netbsd be like the others.
fixes powerpc (at least) builds.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.24 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.25
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.24	Sun Feb  3 11:12:01 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Feb  4 03:00:11 2019
@@ -297,7 +297,11 @@ uptr internal_lstat(const char *path, vo
 }
 
 uptr internal_fstat(fd_t fd, void *buf) {
-#if SANITIZER_FREEBSD || SANITIZER_NETBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
+#if SANITIZER_FREEBSD || SANITIZER_NETBSD
+  return internal_syscall(SYSCALL(fstat), fd, (uptr)buf);
+#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
+  return = internal_syscall(SYSCALL(fstat), fd, );
+#elif SANITIZER_LINUX_USES_64BIT_SYSCALLS
 # if SANITIZER_MIPS64
   // For mips64, fstat syscall fills buffer in the format of kernel_stat
   struct kernel_stat kbuf;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Mon Feb  4 03:00:11 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
make the internal_fstat() for netbsd be like the others.
fixes powerpc (at least) builds.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb  3 11:12:01 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
disable SignalContext::GetWriteFlag() for netbsd/arm (for now).


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.23 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.24
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.23	Thu Jan 31 08:44:14 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sun Feb  3 11:12:01 2019
@@ -1376,7 +1376,7 @@ SignalContext::WriteFlag SignalContext::
   uptr err = ucontext->uc_mcontext.gregs[REG_ERR];
 #endif
   return err & PF_WRITE ? WRITE : READ;
-#elif defined(__arm__)
+#elif defined(__arm__) && !SANITIZER_NETBSD
   static const uptr FSR_WRITE = 1U << 11;
   uptr fsr = ucontext->uc_mcontext.error_code;
   return fsr & FSR_WRITE ? WRITE : READ;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb  3 11:12:01 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
disable SignalContext::GetWriteFlag() for netbsd/arm (for now).


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb  3 11:10:59 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_allocator_primary64.h

Log Message:
make structure that demands alignment be that alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h:1.2	Sat Jan 19 12:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h	Sun Feb  3 11:10:58 2019
@@ -325,7 +325,7 @@ class SizeClassAllocator64 {
 uptr num_releases;
   };
 
-  struct RegionInfo {
+  struct ALIGNED(kCacheLineSize) RegionInfo {
 BlockingMutex mutex;
 uptr num_freed_chunks;  // Number of elements in the freearray.
 uptr mapped_free_array;  // Bytes mapped for freearray.



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2019-02-03 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb  3 11:10:59 UTC 2019

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_allocator_primary64.h

Log Message:
make structure that demands alignment be that alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator_primary64.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 00:32:40 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_stoptheworld_linux_libcdep.cc

Log Message:
aarch64 sanitizer bits


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.19 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.20
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.19	Tue Jun 26 16:55:38 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Jul 14 20:32:40 2018
@@ -1018,7 +1018,7 @@ uptr internal_clone(int (*fn)(void *), v
: "memory", "$29" );
   return res;
 }
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) && SANITIZER_LINUX
 uptr internal_clone(int (*fn)(void *), void *child_stack, int flags, void *arg,
 int *parent_tidptr, void *newtls, int *child_tidptr) {
   long long res;
@@ -1171,9 +1171,15 @@ void GetPcSpBp(void *context, uptr *pc, 
 # endif
 #elif defined(__aarch64__)
   ucontext_t *ucontext = (ucontext_t*)context;
+# if SANITIZER_NETBSD
+  *pc = _UC_MACHINE_PC(ucontext);
+  *sp = _UC_MACHINE_SP(ucontext);
+  *bp = ucontext->uc_mcontext.__gregs[29]; /* XXX */
+# else
   *pc = ucontext->uc_mcontext.pc;
   *bp = ucontext->uc_mcontext.regs[29];
   *sp = ucontext->uc_mcontext.sp;
+# endif
 #elif defined(__hppa__)
   ucontext_t *ucontext = (ucontext_t*)context;
 # if SANITIZER_NETBSD

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc:1.2	Tue Jun 26 16:55:38 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc	Sat Jul 14 20:32:40 2018
@@ -34,7 +34,7 @@
 #if SANITIZER_ANDROID && defined(__arm__)
 # include   // for pt_regs
 #else
-# ifdef __aarch64__
+# if SANITIZER_LINUX && defined( __aarch64__)
 // GLIBC 2.20+ sys/user does not include asm/ptrace.h
 #  include 
 # endif



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-07-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul 15 00:32:40 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_stoptheworld_linux_libcdep.cc

Log Message:
aarch64 sanitizer bits


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul  1 14:20:23 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_allocator.h

Log Message:
disable one more size check for _LP32 to make pcc build.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h:1.2	Wed Jun 27 11:57:20 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h	Sun Jul  1 10:20:23 2018
@@ -497,7 +497,9 @@ class SizeClassAllocator64 {
 uptr mapped_meta;  // Bytes mapped for metadata.
 uptr n_allocated, n_freed;  // Just stats.
   };
+#if _LP64
   COMPILER_CHECK(sizeof(RegionInfo) >= kCacheLineSize);
+#endif
 
   RegionInfo *GetRegionInfo(uptr class_id) {
 CHECK_LT(class_id, kNumClasses);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-07-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jul  1 14:20:23 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_allocator.h

Log Message:
disable one more size check for _LP32 to make pcc build.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_allocator.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-06-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jun  4 13:12:54 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Quick hack to fix 32bit big endian platforms: the return value from
__syscall() needs to be shifted into the lower 32bits to form a proper
pointer. Temporarily steal __SYSCALL_TO_UINTPTR_T from the syscall/__syscall
test program, Kamil is working on a proper solution.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-06-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jun  4 13:12:54 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Quick hack to fix 32bit big endian platforms: the return value from
__syscall() needs to be shifted into the lower 32bits to form a proper
pointer. Temporarily steal __SYSCALL_TO_UINTPTR_T from the syscall/__syscall
test program, Kamil is working on a proper solution.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.17 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.18
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.17	Wed May 23 11:14:49 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Mon Jun  4 13:12:54 2018
@@ -113,8 +113,16 @@ namespace __sanitizer {
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
OFF_T offset) {
 #if SANITIZER_NETBSD
-  return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd,
-			  (long)0, offset);
+
+#if !defined(_LP64) && BYTE_ORDER == _BIG_ENDIAN
+#define __SYSCALL_TO_UINTPTR_T(V)   ((uintptr_t)((V)>>32))
+#else
+#define __SYSCALL_TO_UINTPTR_T(V)   ((uintptr_t)(V))
+#endif
+
+  return __SYSCALL_TO_UINTPTR_T(
+	internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd,
+			  (long)0, offset));
 #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
   return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,
   offset, 0);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:14:49 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.16 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.17
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.16	Fri Feb 16 07:59:05 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Wed May 23 11:14:49 2018
@@ -113,7 +113,7 @@ namespace __sanitizer {
 uptr internal_mmap(void *addr, uptr length, int prot, int flags, int fd,
OFF_T offset) {
 #if SANITIZER_NETBSD
-  return internal_syscall_ptr(SYSCALL(mmap), addr, length, prot, flags, fd,
+  return internal_syscall64(SYSCALL(mmap), addr, length, prot, flags, fd,
 			  (long)0, offset);
 #elif SANITIZER_FREEBSD || SANITIZER_LINUX_USES_64BIT_SYSCALLS
   return internal_syscall(SYSCALL(mmap), (uptr)addr, length, prot, flags, fd,



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-05-23 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed May 23 11:14:49 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
Cherry-pick upstream patch for internal_mmap() in GCC sanitizers

Fix internal_mmap() on 32-bit NetBSD platforms

There is need to use internal_syscall64() instead of internal_syscall_ptr().
The offset argument of type off_t is always 64-bit.

http://llvm.org/viewvc/llvm-project?view=revision=333075

PR kern/53261 by Martin Husemann


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 25 01:05:09 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_unwind_linux_libcdep.cc

Log Message:
fix some types of netbsd arm builds.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.2	Wed Feb 14 02:10:06 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc	Sun Feb 25 01:05:09 2018
@@ -80,7 +80,7 @@ void SanitizerInitializeUnwinder() {
 #endif
 
 uptr Unwind_GetIP(struct _Unwind_Context *ctx) {
-#if defined(__arm__) && !SANITIZER_MAC
+#if defined(__arm__) && !SANITIZER_MAC && !SANITIZER_NETBSD
   uptr val;
   _Unwind_VRS_Result res = _Unwind_VRS_Get(ctx, _UVRSC_CORE,
   15 /* r15 = PC */, _UVRSD_UINT32, );



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 25 01:05:09 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_unwind_linux_libcdep.cc

Log Message:
fix some types of netbsd arm builds.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:10:32 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_flags.inc

Log Message:
enable addr2line


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:10:32 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_flags.inc

Log Message:
enable addr2line


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc:1.1.1.1	Thu Feb  1 20:58:46 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.inc	Tue Feb 13 21:10:32 2018
@@ -27,7 +27,7 @@ COMMON_FLAG(
 "Path to external symbolizer. If empty, the tool will search $PATH for "
 "the symbolizer.")
 COMMON_FLAG(
-bool, allow_addr2line, false,
+bool, allow_addr2line, true,
 "If set, allows online symbolizer to run addr2line binary to symbolize "
 "stack traces (addr2line will only be used if llvm-symbolizer binary is "
 "unavailable.")



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:10:06 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_unwind_linux_libcdep.cc

Log Message:
- enable netbsd
- add cast to (uptr) for _Unwind_GetIP


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.1.1.1 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc:1.1.1.1	Thu Feb  1 20:58:46 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc	Tue Feb 13 21:10:06 2018
@@ -10,7 +10,7 @@
 //===--===//
 
 #include "sanitizer_platform.h"
-#if SANITIZER_FREEBSD || SANITIZER_LINUX
+#if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
 #include "sanitizer_common.h"
 #include "sanitizer_stacktrace.h"
 
@@ -88,7 +88,7 @@ uptr Unwind_GetIP(struct _Unwind_Context
   // Clear the Thumb bit.
   return val & ~(uptr)1;
 #else
-  return _Unwind_GetIP(ctx);
+  return (uptr)_Unwind_GetIP(ctx);
 #endif
 }
 



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2018-02-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Feb 14 02:10:06 UTC 2018

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_unwind_linux_libcdep.cc

Log Message:
- enable netbsd
- add cast to (uptr) for _Unwind_GetIP


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_unwind_linux_libcdep.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2017-06-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 14 12:16:27 UTC 2017

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_procmaps_netbsd.cc

Log Message:
Detach  from sanitizer_procmaps_netbsd.cc (GCC)

This header in this context is freebsdism.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.3
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc:1.2	Wed Jun  1 04:06:15 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc	Wed Jun 14 12:16:27 2017
@@ -15,7 +15,6 @@
 
 #include 
 #include 
-#include 
 
 namespace __sanitizer {
 



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2017-06-14 Thread Kamil Rytarowski
Module Name:src
Committed By:   kamil
Date:   Wed Jun 14 12:16:27 UTC 2017

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_procmaps_netbsd.cc

Log Message:
Detach  from sanitizer_procmaps_netbsd.cc (GCC)

This header in this context is freebsdism.

Sponsored by 


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_procmaps_netbsd.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  1 18:20:25 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_flags.cc

Log Message:
on NetBSD we don't have llvm_symbolizer, so try addr2line...


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  1 18:20:25 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_flags.cc

Log Message:
on NetBSD we don't have llvm_symbolizer, so try addr2line...


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc:1.1.1.2 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc:1.1.1.2	Sun Jan 24 01:05:41 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_flags.cc	Thu Dec  1 13:20:25 2016
@@ -35,7 +35,11 @@ IntrusiveList flag_desc
 void SetCommonFlagsDefaults(CommonFlags *f) {
   f->symbolize = true;
   f->external_symbolizer_path = 0;
+#if SANITIZER_NETBSD
+  f->allow_addr2line = true;
+#else
   f->allow_addr2line = false;
+#endif
   f->strip_path_prefix = "";
   f->fast_unwind_on_check = false;
   f->fast_unwind_on_fatal = false;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  1 18:19:19 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
use the right sysctl to find the main binary name. We don't really need
this since our dl_iterate_phdr DTRT's for objmain, but...


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-12-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Dec  1 18:19:19 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
use the right sysctl to find the main binary name. We don't really need
this since our dl_iterate_phdr DTRT's for objmain, but...


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.7 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.8
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.7	Sat Jun 11 16:45:07 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Thu Dec  1 13:19:19 2016
@@ -751,7 +751,11 @@ uptr ReadBinaryName(/*out*/char *buf, up
 return module_name_len;
   }
 #if SANITIZER_FREEBSD || SANITIZER_NETBSD
+# if SANITIZER_FREEBSD
   const int Mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
+# else
+  const int Mib[4] = { CTL_KERN, KERN_PROC_ARGS, -1, KERN_PROC_PATHNAME };
+# endif
   size_t Size = buf_len;
   bool IsErr = (sysctl(Mib, 4, buf, , NULL, 0) != 0);
   int readlink_error = IsErr ? errno : 0;



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 13:13:09 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
__NetBSD__ -> SANITIZER_NETBSD


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.9
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8	Wed Sep 21 23:43:07 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	Thu Sep 22 09:13:09 2016
@@ -13,7 +13,7 @@
 #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
 #define SANITIZER_PLATFORM_LIMITS_POSIX_H
 
-#ifdef __NetBSD__
+#if SANITIZER_NETBSD
 #define _SYS_SIGNAL_H_
 #include 
 #undef _SYS_SIGNAL_H_
@@ -343,7 +343,7 @@ namespace __sanitizer {
 # endif
 void *ifa_dstaddr; // (struct sockaddr *)
 void *ifa_data;
-# ifdef __NetBSD__
+# if SANITIZER_NETBSD
 #  if __NetBSD_Prereq__(7, 99, 39)
 unsigned int ifa_addrflags;
 #  endif



re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-22 Thread Christos Zoulas
On Sep 22,  4:02pm, m...@eterna.com.au (matthew green) wrote:
-- Subject: re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer

| sorry to bug you again, but... ;)
| 
| > Modified Files:
| > src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
| > sanitizer_platform_limits_posix.h
| > 
| > Log Message:
| > Check the NetBSD version
| 
| ! # ifdef __NetBSD__
| 
| hmmm, shouldn't that be SANITZIER_NETBSD or whatever it is?

Could be... I've changed it.

christos


CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-22 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 13:13:09 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
__NetBSD__ -> SANITIZER_NETBSD


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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



re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-22 Thread matthew green
sorry to bug you again, but... ;)

> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_platform_limits_posix.h
> 
> Log Message:
> Check the NetBSD version

! # ifdef __NetBSD__

hmmm, shouldn't that be SANITZIER_NETBSD or whatever it is?


CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Sep 22 03:43:08 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
Avoid definining a prototype for signal(3) from  because the
INTERCEPTOR macro cannot handle function returns easily.
TODO: fix  to avoid this kind of name pollution.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.7 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.8
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.7	Wed Sep 21 19:18:42 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	Wed Sep 21 23:43:07 2016
@@ -14,7 +14,9 @@
 #define SANITIZER_PLATFORM_LIMITS_POSIX_H
 
 #ifdef __NetBSD__
+#define _SYS_SIGNAL_H_
 #include 
+#undef _SYS_SIGNAL_H_
 #endif
 #include "sanitizer_internal_defs.h"
 #include "sanitizer_platform.h"



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 21 23:18:42 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
need 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 21 23:18:42 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
need 


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.6 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.6	Wed Sep 21 17:30:56 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	Wed Sep 21 19:18:42 2016
@@ -13,6 +13,9 @@
 #ifndef SANITIZER_PLATFORM_LIMITS_POSIX_H
 #define SANITIZER_PLATFORM_LIMITS_POSIX_H
 
+#ifdef __NetBSD__
+#include 
+#endif
 #include "sanitizer_internal_defs.h"
 #include "sanitizer_platform.h"
 



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 21 21:30:56 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
Check the NetBSD version


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.5 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.5	Wed Sep 21 15:18:01 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	Wed Sep 21 17:30:56 2016
@@ -338,9 +338,11 @@ namespace __sanitizer {
 # endif
 void *ifa_dstaddr; // (struct sockaddr *)
 void *ifa_data;
-#ifdef __NetBSD__
+# ifdef __NetBSD__
+#  if __NetBSD_Prereq__(7, 99, 39)
 unsigned int ifa_addrflags;
-#endif
+#  endif
+# endif
   };
 #endif  // !SANITIZER_ANDROID
 



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 21 21:30:56 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
Check the NetBSD version


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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



re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread matthew green
"Christos Zoulas" writes:
> Module Name:  src
> Committed By: christos
> Date: Wed Sep 21 19:18:01 UTC 2016
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
>   sanitizer_platform_limits_posix.h
> 
> Log Message:
> add new field

+ #ifdef __NetBSD__
+ unsigned int ifa_addrflags;
+ #endif

thanks for cleaning up :-)

can you make this version specific so that we can upstream this
change?  the above only works on todays netbsd.

thanks.


.mrg.


CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 21 19:18:01 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
add new field


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.4 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.5
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h:1.4	Thu Jun  9 03:38:45 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h	Wed Sep 21 15:18:01 2016
@@ -338,6 +338,9 @@ namespace __sanitizer {
 # endif
 void *ifa_dstaddr; // (struct sockaddr *)
 void *ifa_data;
+#ifdef __NetBSD__
+unsigned int ifa_addrflags;
+#endif
   };
 #endif  // !SANITIZER_ANDROID
 



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-09-21 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Sep 21 19:18:01 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_platform_limits_posix.h

Log Message:
add new field


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-06-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 11 20:45:07 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix compilation and getdents.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-06-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 11 20:45:07 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc

Log Message:
fix compilation and getdents.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc

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

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.6 src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc:1.6	Sat Jun 11 09:39:26 2016
+++ src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc	Sat Jun 11 16:45:07 2016
@@ -538,7 +538,7 @@ uptr internal_ptrace(int request, int pi
 }
 
 uptr internal_waitpid(int pid, int *status, int options) {
-+#if SANITIZER_NETBSD
+#if SANITIZER_NETBSD
   return internal_syscall(SYSCALL(wait4), pid, status, options,
   NULL /* rusage */);
 #else
@@ -556,7 +556,9 @@ uptr internal_getppid() {
 }
 
 uptr internal_getdents(fd_t fd, struct linux_dirent *dirp, unsigned int count) {
-#if SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
+#if SANITIZER_NETBSD
+  return internal_syscall(SYSCALL(getdents), fd, dirp, (uptr)count);
+#elif SANITIZER_USES_CANONICAL_LINUX_SYSCALLS
   return internal_syscall(SYSCALL(getdents64), fd, (uptr)dirp, count);
 #else
   return internal_syscall(SYSCALL(getdents), fd, (uptr)dirp, count);



CVS commit: src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common

2016-06-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 11 13:39:26 UTC 2016

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common:
sanitizer_linux.cc sanitizer_syscall_generic.inc

Log Message:
More fixed from Rin Okuyama
fix waitpid, getdents, explain ptrace, cleanup redefinitions


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_linux.cc
cvs rdiff -u -r1.3 -r1.4 \

src/external/gpl3/gcc/dist/libsanitizer/sanitizer_common/sanitizer_syscall_generic.inc

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



  1   2   >