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.
why do we need this after list(APPEND COMPILER_RT_TEST_COMPILER_CFLAGS -gline-tables-only) above