[PATCH] D91620: [compiler-rt][test] Heed COMPILER_RT_DEBUG when compiling unittests

Rainer Orth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 04:57:44 PST 2020


ro created this revision.
ro added a reviewer: vitalybuka.
ro added a project: Sanitizers.
Herald added subscribers: Sanitizers, pengfei, fedor.sergeev, mgorny, dberris, jyknight.
ro requested review of this revision.

When trying to debug some `compiler-rt` unittest, I initially had a hard time because

- even in a `Debug` build one needs to set `COMPILER_RT_DEBUG` to get debugging info for some of the code and
- even the so the unittests used a hardcoded `-O2` which often makes debugging impossible.

This patch addresses this by instead using `-O0` if `COMPILER_RT_DEBUG`.  `sanitizer_stacktrace_test.cpp` needs a definition of `BufferedStackTrace::UnwindImpl` to avoid a link failure.

Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and `x86_64-pc-linux-gnu`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91620

Files:
  compiler-rt/CMakeLists.txt
  compiler-rt/lib/asan/tests/CMakeLists.txt
  compiler-rt/lib/fuzzer/tests/CMakeLists.txt
  compiler-rt/lib/gwp_asan/tests/CMakeLists.txt
  compiler-rt/lib/interception/tests/CMakeLists.txt
  compiler-rt/lib/msan/tests/CMakeLists.txt
  compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
  compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91620.305745.patch
Type: text/x-patch
Size: 5412 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201117/3d518e66/attachment.bin>


More information about the llvm-commits mailing list