Skip to content

[Sanitizer][Docs] Improve docs on building Asan - #68636

Merged
boomanaiden154 merged 1 commit into
llvm:mainfrom
boomanaiden154:asan-docs-building
Oct 9, 2023
Merged

[Sanitizer][Docs] Improve docs on building Asan#68636
boomanaiden154 merged 1 commit into
llvm:mainfrom
boomanaiden154:asan-docs-building

Conversation

@boomanaiden154

Copy link
Copy Markdown
Contributor

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).

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.
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 9, 2023
@llvmbot

llvmbot commented Oct 9, 2023

Copy link
Copy Markdown
Member

@llvm/pr-subscribers-clang

Changes

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).


Full diff: https://github.com/llvm/llvm-project/pull/68636.diff

1 Files Affected:

  • (modified) clang/docs/AddressSanitizer.rst (+10-1)
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
 =====

@boomanaiden154
boomanaiden154 merged commit 115b6a3 into llvm:main Oct 9, 2023
@vitalybuka

Copy link
Copy Markdown
Contributor

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 $:

.. code-block:: console

  $  cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang"  -DLLVM_ENABLE_RUNTIMES="compiler-rt" path/to/llvm/source

@boomanaiden154

Copy link
Copy Markdown
Contributor Author

Sorry. I'll wait longer to merge next time. I'll push a fixup to address the comment. Thanks for the comment/review!

@vitalybuka

Copy link
Copy Markdown
Contributor

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.
Thanks for improving documentation.

boomanaiden154 added a commit that referenced this pull request Oct 9, 2023
This was based on post-commit reviewer feedback in #68636.
@boomanaiden154

Copy link
Copy Markdown
Contributor Author

Updated in 6828194.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants