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

2024-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 25 01:12:16 UTC 2024

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl.h

Log Message:
add some missing alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.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/tsan

2024-02-24 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Feb 25 01:12:16 UTC 2024

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl.h

Log Message:
add some missing alignment.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.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/tsan/tsan_rtl.h
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h:1.3 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h:1.4
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h:1.3	Sun Jul 30 05:51:42 2023
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl.h	Sun Feb 25 01:12:16 2024
@@ -132,7 +132,7 @@ struct ScopedGlobalProcessor {
 
 // This struct is stored in TLS.
 struct ThreadState {
-  FastState fast_state;
+  FastState fast_state ALIGNED(SANITIZER_CACHE_LINE_SIZE);
   // Synch epoch represents the threads's epoch before the last synchronization
   // action. It allows to reduce number of shadow state updates.
   // For example, fast_synch_epoch=100, last write to addr X was at epoch=150,



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

2019-06-01 Thread Kamil Rytarowski
On 01.06.2019 21:04, Christos Zoulas wrote:
> On Jun 1,  8:48pm, n...@gmx.com (Kamil Rytarowski) wrote:
> -- Subject: Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan
> 
> | There is some overlap, but not full.
> 
> I understand.
> 
> | https://github.com/llvm-mirror/compiler-rt/blob/master/lib/tsan/rtl/tsan_rt=
> | l_amd64.S
> | 
> | Each call of this code was verified and it passed regression suite.
> | 
> | There is also need to handle NetBSD specific renaming of symbols in this
> | file and in .c file.
> 
> I also said that the NetBSD symbols are not handled. Newer gcc will fix it.
> I just wanted to make it compile.
> 
> christos
> 

I see, thank you! I'm doing it in the way that code flows with new
upstream versions into the basesystem. Cherry picking TSan support
shouldn't be that difficult probably.



signature.asc
Description: OpenPGP digital signature


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

2019-06-01 Thread Christos Zoulas
On Jun 1,  8:48pm, n...@gmx.com (Kamil Rytarowski) wrote:
-- Subject: Re: CVS commit: src/external/gpl3/gcc/dist/libsanitizer/tsan

| There is some overlap, but not full.

I understand.

| https://github.com/llvm-mirror/compiler-rt/blob/master/lib/tsan/rtl/tsan_rt=
| l_amd64.S
| 
| Each call of this code was verified and it passed regression suite.
| 
| There is also need to handle NetBSD specific renaming of symbols in this
| file and in .c file.

I also said that the NetBSD symbols are not handled. Newer gcc will fix it.
I just wanted to make it compile.

christos


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

2019-06-01 Thread Kamil Rytarowski
On 01.06.2019 20:38, Christos Zoulas wrote:
> I just checked and the offsets are correct (we are the same as FreeBSD).
> We are missing support for the the names of the functions __setjmp14 etc.
> 
> Thanks,
> 

There is some overlap, but not full.

https://github.com/llvm-mirror/compiler-rt/blob/master/lib/tsan/rtl/tsan_rtl_amd64.S

Each call of this code was verified and it passed regression suite.

There is also need to handle NetBSD specific renaming of symbols in this
.S file and in .c file.

> christos
> 
>> On Jun 1, 2019, at 1:52 PM, Kamil Rytarowski  wrote:
>>
>> On 01.06.2019 19:22, Christos Zoulas wrote:
>>> Module Name:src
>>> Committed By:   christos
>>> Date:   Sat Jun  1 17:22:58 UTC 2019
>>>
>>> Modified Files:
>>> src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S
>>>
>>> Log Message:
>>> Do as FreeBSD does now (I have not checked that the offsets are correct)
>>>
>>
>> These values differ on NetBSD.
>>
>> There is upstreamed support into upstream repository here:
>>
>> https://github.com/llvm-mirror/compiler-rt/tree/master/lib/tsan/rtl
>>
>> Please grep for NetBSD specific code. We will get it with GCC9, maybe
>> GCC8.. but I would need to check.
>>
>> 
> 




signature.asc
Description: OpenPGP digital signature


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

2019-06-01 Thread Christos Zoulas
I just checked and the offsets are correct (we are the same as FreeBSD).
We are missing support for the the names of the functions __setjmp14 etc.

Thanks,

christos

> On Jun 1, 2019, at 1:52 PM, Kamil Rytarowski  wrote:
> 
> On 01.06.2019 19:22, Christos Zoulas wrote:
>> Module Name: src
>> Committed By:christos
>> Date:Sat Jun  1 17:22:58 UTC 2019
>> 
>> Modified Files:
>>  src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S
>> 
>> Log Message:
>> Do as FreeBSD does now (I have not checked that the offsets are correct)
>> 
> 
> These values differ on NetBSD.
> 
> There is upstreamed support into upstream repository here:
> 
> https://github.com/llvm-mirror/compiler-rt/tree/master/lib/tsan/rtl
> 
> Please grep for NetBSD specific code. We will get it with GCC9, maybe
> GCC8.. but I would need to check.
> 
> 



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

2019-06-01 Thread Kamil Rytarowski
On 01.06.2019 19:22, Christos Zoulas wrote:
> Module Name:  src
> Committed By: christos
> Date: Sat Jun  1 17:22:58 UTC 2019
> 
> Modified Files:
>   src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S
> 
> Log Message:
> Do as FreeBSD does now (I have not checked that the offsets are correct)
> 

These values differ on NetBSD.

There is upstreamed support into upstream repository here:

https://github.com/llvm-mirror/compiler-rt/tree/master/lib/tsan/rtl

Please grep for NetBSD specific code. We will get it with GCC9, maybe
GCC8.. but I would need to check.



signature.asc
Description: OpenPGP digital signature


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

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

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Add defines so this compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.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/tsan

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

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_interceptors.cc

Log Message:
Add defines so this compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.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/tsan/tsan_interceptors.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.6 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.7
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc:1.6	Sat Jan 19 07:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_interceptors.cc	Sat Jun  1 13:23:29 2019
@@ -44,7 +44,7 @@ using namespace __tsan;  // NOLINT
 #define mallopt(a, b)
 #endif
 
-#if SANITIZER_LINUX || SANITIZER_FREEBSD
+#if SANITIZER_LINUX || SANITIZER_FREEBSD || SANITIZER_NETBSD
 #define PTHREAD_CREATE_DETACHED 1
 #elif SANITIZER_MAC
 #define PTHREAD_CREATE_DETACHED 2
@@ -2020,7 +2020,7 @@ TSAN_INTERCEPTOR(int, sigaction, int sig
   sigactions[sig].sa_flags = *(volatile int*)>sa_flags;
   internal_memcpy([sig].sa_mask, >sa_mask,
   sizeof(sigactions[sig].sa_mask));
-#if !SANITIZER_FREEBSD && !SANITIZER_MAC
+#if !SANITIZER_FREEBSD && !SANITIZER_MAC && !SANITIZER_NETBSD
   sigactions[sig].sa_restorer = act->sa_restorer;
 #endif
   sigaction_t newact;



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

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

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S

Log Message:
Do as FreeBSD does now (I have not checked that the offsets are correct)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S

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/tsan

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

Modified Files:
src/external/gpl3/gcc/dist/libsanitizer/tsan: tsan_rtl_amd64.S

Log Message:
Do as FreeBSD does now (I have not checked that the offsets are correct)


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S

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/tsan/tsan_rtl_amd64.S
diff -u src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.5 src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.6
--- src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S:1.5	Sat Jan 19 07:10:12 2019
+++ src/external/gpl3/gcc/dist/libsanitizer/tsan/tsan_rtl_amd64.S	Sat Jun  1 13:22:58 2019
@@ -186,7 +186,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(setjmp):
   CFI_ADJUST_CFA_OFFSET(8)
   CFI_REL_OFFSET(%rdi, 0)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 8(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -227,7 +227,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(_setjmp):
   CFI_ADJUST_CFA_OFFSET(8)
   CFI_REL_OFFSET(%rdi, 0)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 8(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -275,7 +275,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(sigsetjmp):
   sub $8, %rsp
   CFI_ADJUST_CFA_OFFSET(8)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 24(%rsp), %rdi
   mov %rdi, %rsi
 #elif defined(__APPLE__)
@@ -331,7 +331,7 @@ ASM_TSAN_SYMBOL_INTERCEPTOR(__sigsetjmp)
   sub $8, %rsp
   CFI_ADJUST_CFA_OFFSET(8)
   // obtain %rsp
-#if defined(__FreeBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__)
   lea 24(%rsp), %rdi
   mov %rdi, %rsi
 #else