[PATCH] D49198: [scudo] Use -Wl,-z,global on Android

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 12 11:10:47 PDT 2018


cryptoad updated this revision to Diff 155227.
cryptoad added a comment.

s/ASAN/SCUDO because I failed at copy/pasting :(


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D49198

Files:
  lib/scudo/CMakeLists.txt


Index: lib/scudo/CMakeLists.txt
===================================================================
--- lib/scudo/CMakeLists.txt
+++ lib/scudo/CMakeLists.txt
@@ -17,6 +17,14 @@
 # Use gc-sections by default to avoid unused code being pulled in.
 list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -Wl,--gc-sections)
 
+if(ANDROID)
+# Put the Scudo shared library in the global group. For more details, see
+# android-changes-for-ndk-developers.md#changes-to-library-search-order
+  if (COMPILER_RT_HAS_Z_GLOBAL)
+    list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -Wl,-z,global)
+  endif()
+endif()
+
 # The minimal Scudo runtime does not inlude the UBSan runtime.
 set(SCUDO_MINIMAL_OBJECT_LIBS
   RTSanitizerCommonNoTermination


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49198.155227.patch
Type: text/x-patch
Size: 706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180712/47845198/attachment.bin>


More information about the llvm-commits mailing list