[libFuzzer] Fix libFuzzer flag propagation for standalone builds.

Under the previous configurations, flags from SANITIZER_COMMON were not
propagated for standalone builds.

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

llvm-svn: 311912
This commit is contained in:
George Karpenkov 2017-08-28 19:44:19 +00:00
parent 16a05f2dfe
commit dacfd66dfd
1 changed files with 5 additions and 2 deletions

View File

@ -30,11 +30,14 @@ CHECK_CXX_SOURCE_COMPILES("
}
" HAS_THREAD_LOCAL)
set(LIBFUZZER_CFLAGS ${SANITIZER_COMMON_CFLAGS})
if (CMAKE_CXX_FLAGS MATCHES "fsanitize-coverage")
set(LIBFUZZER_CFLAGS -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters)
list(APPEND LIBFUZZER_CFLAGS -fno-sanitize-coverage=trace-pc-guard,edge,trace-cmp,indirect-calls,8bit-counters)
endif()
if(NOT HAS_THREAD_LOCAL)
set(LIBFUZZER_CFLAGS "${LIBFUZZER_CFLAGS} -Dthread_local=__thread")
list(APPEND LIBFUZZER_CFLAGS -Dthread_local=__thread)
endif()
if(APPLE)