[PATCH] D44791: [scudo] Fuchsia minimal shared runtime

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 25 18:08:06 PDT 2018


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

Typo.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D44791

Files:
  lib/scudo/CMakeLists.txt


Index: lib/scudo/CMakeLists.txt
===================================================================
--- lib/scudo/CMakeLists.txt
+++ lib/scudo/CMakeLists.txt
@@ -4,15 +4,33 @@
 
 set(SCUDO_CFLAGS ${SANITIZER_COMMON_CFLAGS})
 # SANITIZER_COMMON_CFLAGS include -fno-builtin, but we actually want builtins!
-list(APPEND SCUDO_CFLAGS -fbuiltin)
+list(APPEND SCUDO_CFLAGS -fbuiltin -ffunction-sections -fdata-sections)
 append_rtti_flag(OFF SCUDO_CFLAGS)
 
-set(SCUDO_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
+set(SCUDO_DYNAMIC_LIBS ${SANITIZER_COMMON_LINK_LIBS})
+append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_DYNAMIC_LIBS)
+append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_DYNAMIC_LIBS)
+append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_DYNAMIC_LIBS)
+append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_DYNAMIC_LIBS)
 
+set(SCUDO_DYNAMIC_LINK_FLAGS ${SANITIZER_COMMON_LINK_FLAGS})
 # Use gc-sections by default to avoid unused code being pulled in.
-list(APPEND SCUDO_CFLAGS -ffunction-sections -fdata-sections)
 list(APPEND SCUDO_DYNAMIC_LINK_FLAGS -Wl,--gc-sections)
 
+set(SCUDO_OBJECT_LIBS
+  RTSanitizerCommonNoTermination
+  RTSanitizerCommonLibc
+  RTInterception)
+
+if (FUCHSIA)
+  list(APPEND SCUDO_CFLAGS -nostdinc++ -nostdlib++)
+  # TODO(kostyak): remove when stacktraces are split off of RTSanitizerCommon
+  list(APPEND SCUDO_DYNAMIC_LIBS unwind_shared)
+else()
+  list(APPEND SCUDO_OBJECT_LIBS RTSanitizerCommonCoverage RTUbsan)
+  list(APPEND SCUDO_DYNAMIC_LIBS ${SANITIZER_CXX_ABI_LIBRARY})
+endif()
+
 set(SCUDO_SOURCES
   scudo_allocator.cpp
   scudo_crc32.cpp
@@ -38,22 +56,11 @@
 endif()
 
 if(COMPILER_RT_HAS_SCUDO)
-  set(SCUDO_DYNAMIC_LIBS ${SANITIZER_CXX_ABI_LIBRARY}
-                         ${SANITIZER_COMMON_LINK_LIBS})
-  append_list_if(COMPILER_RT_HAS_LIBDL dl SCUDO_DYNAMIC_LIBS)
-  append_list_if(COMPILER_RT_HAS_LIBRT rt SCUDO_DYNAMIC_LIBS)
-  append_list_if(COMPILER_RT_HAS_LIBPTHREAD pthread SCUDO_DYNAMIC_LIBS)
-  append_list_if(COMPILER_RT_HAS_LIBLOG log SCUDO_DYNAMIC_LIBS)
-
   add_compiler_rt_runtime(clang_rt.scudo
     STATIC
     ARCHS ${SCUDO_SUPPORTED_ARCH}
     SOURCES ${SCUDO_SOURCES}
-    OBJECT_LIBS RTSanitizerCommonNoTermination
-                RTSanitizerCommonLibc
-                RTSanitizerCommonCoverage
-                RTInterception
-                RTUbsan
+    OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
     CFLAGS ${SCUDO_CFLAGS}
     PARENT_TARGET scudo)
 
@@ -69,12 +76,7 @@
     SHARED
     ARCHS ${SCUDO_SUPPORTED_ARCH}
     SOURCES ${SCUDO_SOURCES} ${SCUDO_CXX_SOURCES}
-    OBJECT_LIBS RTSanitizerCommonNoTermination
-                RTSanitizerCommonLibc
-                RTSanitizerCommonCoverage
-                RTInterception
-                RTUbsan
-                RTUbsan_cxx
+    OBJECT_LIBS ${SCUDO_OBJECT_LIBS}
     CFLAGS ${SCUDO_CFLAGS}
     LINK_FLAGS ${SCUDO_DYNAMIC_LINK_FLAGS}
     LINK_LIBS ${SCUDO_DYNAMIC_LIBS}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44791.139753.patch
Type: text/x-patch
Size: 2905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180326/f6dfb2f6/attachment-0001.bin>


More information about the llvm-commits mailing list