-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Sanitizer][Docs] Improve docs on building Asan #68636
Conversation
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.
@llvm/pr-subscribers-clang ChangesCurrently 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. The lack of specification about building compiler-rt has shown up on Discourse (e.g., https://discourse.llvm.org/t/enabling-address-sanitizer/73940/2). Full diff: https://github.com/llvm/llvm-project/pull/68636.diff 1 Files Affected:
diff --git a/clang/docs/AddressSanitizer.rst b/clang/docs/AddressSanitizer.rst
index 37f34cb0cc9936d..94ff3404cba6024 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 <https://llvm.org/docs/CMake.html>`_.
+Build LLVM/Clang with `CMake <https://llvm.org/docs/CMake.html>` 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
=====
|
I am to late with comment, can you make it in the same style as https://llvm.org/docs/CMake.html One line, and with $:
|
Sorry. I'll wait longer to merge next time. I'll push a fixup to address the comment. Thanks for the comment/review! |
No need to be sorry, it's my fault. |
This was based on post-commit reviewer feedback in #68636.
Updated in 6828194. |
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.
The lack of specification about building compiler-rt has shown up on Discourse (e.g., https://discourse.llvm.org/t/enabling-address-sanitizer/73940/2).