[GWP-ASan] Respect compiler-rt's -fno-lto
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Thu, 7 Nov 2019 15:41:08 +0000 (07:41 -0800)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Thu, 7 Nov 2019 15:43:02 +0000 (07:43 -0800)
https://bugs.llvm.org/show_bug.cgi?id=43722

GWP-ASan didn't include SANITIZER_COMMON_CFLAGS, and thus would produce
LLVM bitcode files, when compiler-rt is generally built without LTO.

compiler-rt/lib/gwp_asan/CMakeLists.txt

index 84839e6..afdd624 100644 (file)
@@ -23,7 +23,8 @@ set(GWP_ASAN_HEADERS
 # Ensure that GWP-ASan meets the delegated requirements of some supporting
 # allocators. Some supporting allocators (e.g. scudo standalone) cannot use any
 # parts of the C++ standard library.
-set(GWP_ASAN_CFLAGS -fno-rtti -fno-exceptions -nostdinc++ -pthread)
+set(GWP_ASAN_CFLAGS ${SANITIZER_COMMON_CFLAGS} -fno-rtti -fno-exceptions
+    -nostdinc++ -pthread)
 append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC GWP_ASAN_CFLAGS)
 append_list_if(COMPILER_RT_HAS_OMIT_FRAME_POINTER_FLAG -fno-omit-frame-pointer
                GWP_ASAN_CFLAGS)