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

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 11 12:17:40 PDT 2018


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

Updating comment.


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 ASAN_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.155044.patch
Type: text/x-patch
Size: 705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180711/e8ec33f4/attachment.bin>


More information about the llvm-commits mailing list