From 49d010d28ba10ba86c58e8cd71e9c5af35a7c9e7 Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Mon, 9 Oct 2023 11:11:18 -0700 Subject: [PATCH] [Sanitizer][Docs] Improve docs on building Asan Currently the documentation for building Asan doesn't specify that compiler-rt needs to be built as well. In addition, there's no minimal example for the LLVM CMake configuration. This patch addresses both of these issues. --- clang/docs/AddressSanitizer.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/clang/docs/AddressSanitizer.rst b/clang/docs/AddressSanitizer.rst index 37f34cb0cc9936..94ff3404cba602 100644 --- a/clang/docs/AddressSanitizer.rst +++ b/clang/docs/AddressSanitizer.rst @@ -26,7 +26,16 @@ Typical slowdown introduced by AddressSanitizer is **2x**. How to build ============ -Build LLVM/Clang with `CMake `_. +Build LLVM/Clang with `CMake ` and enable +the ``compiler-rt`` runtime. An example CMake configuration that will allow +for the use/testing of AddressSanitizer: + +.. code-block:: console + + cmake -DCMAKE_BUILD_TYPE=Release \ + -DLLVM_ENABLE_PROJECTS="clang" \ + -DLLVM_ENABLE_RUNTIMES="compiler-rt" \ + ../llvm Usage =====