[scudo][standalone] Introduce platform specific code & mutexes
authorKostya Kortchinsky <kostyak@google.com>
Tue, 26 Feb 2019 16:47:25 +0000 (16:47 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Tue, 26 Feb 2019 16:47:25 +0000 (16:47 +0000)
commit41aba567d991c2bd551c72c73b8f76f2de392984
treee4f3e5a5225cf3a2b327b9ffa3aaa94a06b7b767
parent421c6e6864fac06145b3a51d3bcdb2344479cddf
[scudo][standalone] Introduce platform specific code & mutexes

Summary:
This CL adds the platform specific code for Fuchsia, Linux & Android,
as well as some tests related to those (more tests to come later).
While some of it is pretty much a straight port of the existing scudo &
sanitizer_common code, the memory mapping functions have been reworked
a bit to fit the limited usage scenario that Scudo has for them.

For Fuchsia, I can now track the Vmar/Vmo pair for memory mappings if
there is an intent to grow or decommit some mapping (that will be
useful for the Primary).

Reviewers: eugenis, vitalybuka, mcgrathr, phosek, flowerhack, morehouse, dmmoore415

Reviewed By: vitalybuka, morehouse

Subscribers: kcc, dvyukov, srhines, mgorny, delcypher, jfb, jdoerfert, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 354895
15 files changed:
compiler-rt/lib/scudo/standalone/CMakeLists.txt
compiler-rt/lib/scudo/standalone/atomic_helpers.h
compiler-rt/lib/scudo/standalone/common.cc [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/common.h [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/empty.cc [deleted file]
compiler-rt/lib/scudo/standalone/fuchsia.cc [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/internal_defs.h
compiler-rt/lib/scudo/standalone/linux.cc [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/linux.h [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/mutex.h [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt
compiler-rt/lib/scudo/standalone/tests/atomic_test.cc
compiler-rt/lib/scudo/standalone/tests/list_test.cc
compiler-rt/lib/scudo/standalone/tests/map_test.cc [new file with mode: 0644]
compiler-rt/lib/scudo/standalone/tests/mutex_test.cc [new file with mode: 0644]