[PATCH] D96133: Allow building with scudo memory allocator on Windows

Russell Gallop via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 06:50:46 PST 2021


russell.gallop updated this revision to Diff 321750.
russell.gallop added a comment.

Add documentation to CMake.rst


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96133/new/

https://reviews.llvm.org/D96133

Files:
  llvm/docs/CMake.rst
  llvm/lib/Support/CMakeLists.txt


Index: llvm/lib/Support/CMakeLists.txt
===================================================================
--- llvm/lib/Support/CMakeLists.txt
+++ llvm/lib/Support/CMakeLists.txt
@@ -62,7 +62,7 @@
   string(REGEX REPLACE "(/|\\\\)$" "" LLVM_INTEGRATED_CRT_ALLOC "${LLVM_INTEGRATED_CRT_ALLOC}")
 
   if(NOT EXISTS "${LLVM_INTEGRATED_CRT_ALLOC}")
-    message(FATAL_ERROR "Cannot find the path to `git clone` for the CRT allocator! (${LLVM_INTEGRATED_CRT_ALLOC}). Currently, rpmalloc, snmalloc and mimalloc are supported.")
+    message(FATAL_ERROR "Cannot find the path to `git clone` for the CRT allocator! (${LLVM_INTEGRATED_CRT_ALLOC}). Currently, rpmalloc, snmalloc, mimalloc and scudo are supported.")
   endif()
 
   if(LLVM_INTEGRATED_CRT_ALLOC MATCHES "rpmalloc$")
@@ -77,6 +77,8 @@
 	  message(FATAL_ERROR "Cannot find the mimalloc static library. To build it, first apply the patch from https://github.com/microsoft/mimalloc/issues/268 then build the Release x64 target through ${LLVM_INTEGRATED_CRT_ALLOC}\\ide\\vs2019\\mimalloc.sln")
     endif()
     set(system_libs ${system_libs} "${MIMALLOC_LIB}" "-INCLUDE:malloc")
+  elseif(LLVM_INTEGRATED_CRT_ALLOC MATCHES "scudo")
+    set(system_libs ${system_libs} "${LLVM_INTEGRATED_CRT_ALLOC}" "-INCLUDE:malloc")
   endif()
 endif()
 
Index: llvm/docs/CMake.rst
===================================================================
--- llvm/docs/CMake.rst
+++ llvm/docs/CMake.rst
@@ -479,15 +479,22 @@
   On Windows, allows embedding a different C runtime allocator into the LLVM
   tools and libraries. Using a lock-free allocator such as the ones listed below
   greatly decreases ThinLTO link time by about an order of magnitude. It also
-  midly improves Clang build times, by about 5-10%. At the moment, rpmalloc,
-  snmalloc and mimalloc are supported. Use the path to `git clone` to select
-  the respective allocator, for example:
+  mildly improves Clang build times, by about 5-10%. At the moment, rpmalloc,
+  snmalloc and mimalloc from outside llvm-project are supported. Use the path
+  to `git clone` to select the respective allocator, for example:
 
   .. code-block:: console
 
     $ D:\git> git clone https://github.com/mjansson/rpmalloc
     $ D:\llvm-project> cmake ... -DLLVM_INTEGRATED_CRT_ALLOC=D:\git\rpmalloc
-  
+ 
+  Scudo from compiler-rt is also supported by specifying the path to the built
+  library, for example:
+
+  .. code-block:: console
+
+    $ D:\llvm-project> cmake ... -DLLVM_INTEGRATED_CRT_ALLOC=<stage1>\lib\clang\<version>\lib\windows\clang_rt.scudo-x86_64.lib
+
   This flag needs to be used along with the static CRT, ie. if building the
   Release target, add -DLLVM_USE_CRT_RELEASE=MT.
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96133.321750.patch
Type: text/x-patch
Size: 2693 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210205/4569f849/attachment.bin>


More information about the llvm-commits mailing list