diff --git a/compiler-rt/lib/scudo/standalone/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/CMakeLists.txt --- a/compiler-rt/lib/scudo/standalone/CMakeLists.txt +++ b/compiler-rt/lib/scudo/standalone/CMakeLists.txt @@ -23,7 +23,7 @@ append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto SCUDO_CFLAGS) if(COMPILER_RT_DEBUG) - list(APPEND SCUDO_CFLAGS -O0) + list(APPEND SCUDO_CFLAGS -O0 -DSCUDO_DEBUG=1) else() list(APPEND SCUDO_CFLAGS -O3) endif() diff --git a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt --- a/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt +++ b/compiler-rt/lib/scudo/standalone/tests/CMakeLists.txt @@ -12,12 +12,15 @@ -I${COMPILER_RT_SOURCE_DIR}/lib/scudo/standalone -I${COMPILER_RT_SOURCE_DIR}/lib/scudo/standalone/include -DGTEST_HAS_RTTI=0 - -DSCUDO_DEBUG=1 -g # Extra flags for the C++ tests # TODO(kostyak): find a way to make -fsized-deallocation work -Wno-mismatched-new-delete) +if(COMPILER_RT_DEBUG) + list(APPEND SCUDO_UNITTEST_CFLAGS -DSCUDO_DEBUG=1) +endif() + if(ANDROID) list(APPEND SCUDO_UNITTEST_CFLAGS -fno-emulated-tls) endif()