Commit Graph

11 Commits

Author SHA1 Message Date
Dmitry Vyukov 26c1ced41c [sanitizer] Use __atomic_load/store() built-ins for generic 32-bit targets
Simplifies the code and fixes the build on SPARC.
See discussion in: http://lists.llvm.org/pipermail/llvm-dev/2020-October/145937.html

Author: glaubitz (John Paul Adrian Glaubitz)
Reviewed-in: https://reviews.llvm.org/D89940
2020-10-30 09:17:46 +01:00
Kamil Rytarowski 85e578f53a [compiler-rt] Replace INLINE with inline
This fixes the clash with BSD headers.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D87562
2020-09-17 16:24:20 +02:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Kostya Kortchinsky cb7912cc0f [sanitizer] Correct 64-bit atomic_store on 32-bit "other" platforms
Summary:
I think there might be something to optimize in `atomic_store`.
Currently, if everything goes well (and we have a different new value), we
always iterate 3 times.
For example, `with a = 0`, `oldval = a`, `newval = 42`, we get:
```
oldval = 0, newval = 42, curval = 0  
oldval = 0, newval = 42, curval = 42 
oldval = 42, newval = 42, curval = 42
```
and then it breaks.

Unless I am not seeing something, I don't see a point to the third iteration.
If the current value is the one we want, we should just break.
This means that 2 iterations (with a different newval) should be sufficient to
achieve what we want.

Reviewers: dvyukov, alekseyshl

Reviewed By: dvyukov

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 331890
2018-05-09 16:20:52 +00:00
Simon Dardis 92365cae1c Reland "[mips][compiler-rt] Provide 64bit atomic add and sub"
r318733 introduced a build failure for native MIPS32 systems for xray due
to the lack of __sync_fetch_and_add / __syn_fetch_and_sub support. This patch
extends the existing support providing atomics so that xray can be
successfully built.

The initial patch was reverted in r321292, as I suspected it may have caused the
buildbot failure. Another patch in the updates the bot fetched caused the test
failures which was reverted.

Reviewers: atanasyan, dberris

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

llvm-svn: 321383
2017-12-22 20:31:07 +00:00
Simon Dardis 6e62834fef Revert "[mips][compiler-rt] Provide 64bit atomic add and sub"
This reverts commit r321260. It appears to have broken the sanitizer
bot sanitizer-ppc64be-linux.

http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/5029

Reverting to see if the buildbot turns green.

llvm-svn: 321292
2017-12-21 19:01:32 +00:00
Simon Dardis 70cd933ff8 [mips][compiler-rt] Provide 64bit atomic add and sub
r318733 introduced a build failure for native MIPS32 systems for xray due
to the lack of __sync_fetch_and_add / __syn_fetch_and_sub support. This patch
extends the existing support providing atomics so that xray can be
successfully built.

Reviewers: atanasyan, dberris

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

llvm-svn: 321260
2017-12-21 13:05:41 +00:00
Simon Dardis f62399945c [mips][compiler-rt] Fix build breakage.
Change some reinterpret_casts to c-style casts due to template instantiation
restrictions and build breakage due to missing paranthesises.

llvm-svn: 305899
2017-06-21 11:29:15 +00:00
Sagar Thakur 6478d14a0d [scudo] Enabling MIPS support for Scudo
Adding MIPS 32-bit and 64-bit support for Scudo.

Reviewed by cryptoad, sdardis.
Differential: D31803

llvm-svn: 305682
2017-06-19 11:28:59 +00:00
Kostya Serebryany 0d00675df2 [sanitizer] fix for ARM Linux, patch by Maxim Ostapenko
llvm-svn: 208673
2014-05-13 08:01:59 +00:00
Dmitry Vyukov db1ad12ae2 asan: fix atomic operations on ARM
implement correct atomic load/store for ARM
add test for atomic load/store
http://llvm-reviews.chandlerc.com/D2582

llvm-svn: 199802
2014-01-22 14:13:37 +00:00