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]
ASAN_DYNAMIC_LINK_FLAGS <- is this a typo?
Can this be done in a common code for all sanitizers that intercept malloc?
Also, I don't think github is the canonical source for AOSP, could you update the link in the patch description to https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md ?