Skip to content

MemorySanitizerLibcxxHowTo document is out-of-date #1815

Open

Description

@aDotInTheVoid

On https://github.com/google/sanitizers/wiki/MemorySanitizerLibcxxHowTo#instrumented-libc, the instructions say to run:

cmake -GNinja ../llvm \
	-DCMAKE_BUILD_TYPE=Release \
	-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
	-DCMAKE_C_COMPILER=clang \
	-DCMAKE_CXX_COMPILER=clang++ \
	-DLLVM_USE_SANITIZER=MemoryWithOrigins

However this fails with:

CMake Error at CMakeLists.txt:130 (MESSAGE):
  libcxx isn't a known project:
  bolt;clang;clang-tools-extra;compiler-rt;cross-project-tests;libc;libclc;lld;lldb;mlir;openmp;polly;pstl;flang.
  Did you mean to enable it as a runtime in LLVM_ENABLE_RUNTIMES?

Based on reading the libc++ vendor docs, the correct build command should be:

cmake -GNinja -S ../runtimes \
    -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
    -DLIBCXXABI_USE_LLVM_UNWINDER=off \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DLLVM_USE_SANITIZER=MemoryWithOrigins

Could this be updated on the wiki?

Activity

  1. aDotInTheVoid commented on Nov 13, 2024

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions