[compiler-rt] 3ea3b6b - sanitizers: build tests with -g

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 23:55:17 PDT 2021


Author: Dmitry Vyukov
Date: 2021-07-31T08:55:12+02:00
New Revision: 3ea3b6b2d411e1507a5a81d29d2ae5de11555202

URL: https://github.com/llvm/llvm-project/commit/3ea3b6b2d411e1507a5a81d29d2ae5de11555202
DIFF: https://github.com/llvm/llvm-project/commit/3ea3b6b2d411e1507a5a81d29d2ae5de11555202.diff

LOG: sanitizers: build tests with -g

We currently build tests without -g, which is quite inconvenient.
Crash stacks don't have line numbers, gdb don't how line numbers either.
Always build tests with -g.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D107168

Added: 
    

Modified: 
    compiler-rt/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/compiler-rt/CMakeLists.txt b/compiler-rt/CMakeLists.txt
index 84429052af5e..cc0b5d4a3943 100644
--- a/compiler-rt/CMakeLists.txt
+++ b/compiler-rt/CMakeLists.txt
@@ -548,6 +548,9 @@ set(COMPILER_RT_GMOCK_CFLAGS
   -I${COMPILER_RT_GMOCK_PATH}
 )
 
+if(COMPILER_RT_HAS_G_FLAG)
+  list(APPEND COMPILER_RT_UNITTEST_CFLAGS -g)
+endif()
 append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_UNITTEST_CFLAGS)
 append_list_if(COMPILER_RT_HAS_WCOVERED_SWITCH_DEFAULT_FLAG -Wno-covered-switch-default COMPILER_RT_UNITTEST_CFLAGS)
 append_list_if(COMPILER_RT_HAS_WSUGGEST_OVERRIDE_FLAG -Wno-suggest-override COMPILER_RT_UNITTEST_CFLAGS)


        


More information about the llvm-commits mailing list