[sanitizer] Use -Wl,-z,global on Android
authorKostya Kortchinsky <kostyak@google.com>
Fri, 13 Jul 2018 15:31:05 +0000 (15:31 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Fri, 13 Jul 2018 15:31:05 +0000 (15:31 +0000)
commit4a547fb62d40a2406b5992e80cc27824f752b3db
tree8884cfe20ff2f78e6fd6c699442d72eeca48cb63
parentceabd50a5cff652dae468d872a8c31637c9ee415
[sanitizer] Use -Wl,-z,global on Android

Summary:
Use `-Wl,-z,global` for all Sanitizer shared libraries on
Android. We want them to be in the global group
(https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#changes-to-library-search-order)
to avoid any alloc/dealloc mismatch between the libc allocator & said library.

`audioserver` was one of the binary that exhibited the problem with Scudo,
this seems to fix it.

[edited for accuracy]

Reviewers: eugenis, alekseyshl

Reviewed By: eugenis

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

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

llvm-svn: 337010
compiler-rt/CMakeLists.txt
compiler-rt/lib/asan/CMakeLists.txt
compiler-rt/lib/hwasan/CMakeLists.txt