Issue 203730
Summary Can't build MSAN-instrumented libc++ without other tools built triggering false positives
Labels libc++
Assignees
Reporter fuhsnn
    I'm trying to build `v22.1.7` libc++ with MemorySanitizer enabled as recommended by the documentation, the CMake options are:
```
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang
-DCMAKE_CXX_COMPILER=clang++
-DLLVM_USE_LINKER=lld
-DLLVM_TARGETS_TO_BUILD=host

-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind"
-DLLVM_USE_SANITIZER=MemoryWithOrigins
```

The first try failed with `bin/llvm-min-tblgen` triggering `MemorySanitizer: use-of-uninitialized-value`, which can be worked around with `-DLLVM_TABLEGEN=/usr/bin/llvm-tblgen`, but next a configure failed:
```
[2484/2709] Performing configure step for 'runtimes'

...

-- Performing Test CXX_SUPPORTS_EHSC_FLAG
-- Performing Test CXX_SUPPORTS_EHSC_FLAG - Failed
-- Performing Test CXX_SUPPORTS_FUNWIND_TABLES_FLAG
-- Performing Test CXX_SUPPORTS_FUNWIND_TABLES_FLAG - Failed
-- Performing Test CXX_SUPPORTS_FNO_EXCEPTIONS_FLAG
-- Performing Test CXX_SUPPORTS_FNO_EXCEPTIONS_FLAG - Success
-- Performing Test CXX_SUPPORTS_FNO_RTTI_FLAG
-- Performing Test CXX_SUPPORTS_FNO_RTTI_FLAG - Success
-- Looking for getauxval
-- Looking for getauxval - not found
-- Looking for elf_aux_info
-- Looking for elf_aux_info - not found
CMake Error at /home/h/space2tb/compiletest/llvm-project-llvmorg-22.1.7/libunwind/src/CMakeLists.txt:95 (message):
  Compiler doesn't support generation of unwind tables if exception support
  is disabled.  Building libunwind DSO with runtime dependency on C++ ABI
  library is not supported.
```
Found a similar issue https://github.com/llvm/llvm-project/issues/150122 but my case looks to be in the `CXX_SUPPORTS_FUNWIND_TABLES_FLAG` instead. Investigating `CMakeConfigureLog` showed that it's `bin/llvm-ar` again triggering `MemorySanitizer: use-of-uninitialized-value` that led to probe failure.

I'm trying working around `llvm-ar` now, but there must be a better procedure for this? 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to