mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-15 02:18:39 +08:00
Set special sanitizer annotations in stacktrace.amalgamation.cpp
That's the only place they're needed. This fixes at least the USE_TSAN build and possibly other sanitizer builds
This commit is contained in:
parent
8c063656df
commit
128c758edc
@ -86,7 +86,6 @@ set(FLOW_SRCS
|
|||||||
rte_memcpy.h
|
rte_memcpy.h
|
||||||
serialize.cpp
|
serialize.cpp
|
||||||
serialize.h
|
serialize.h
|
||||||
stacktrace.amalgamation.cpp
|
|
||||||
stacktrace.h
|
stacktrace.h
|
||||||
test_memcpy.cpp
|
test_memcpy.cpp
|
||||||
test_memcpy_perf.cpp
|
test_memcpy_perf.cpp
|
||||||
@ -94,6 +93,17 @@ set(FLOW_SRCS
|
|||||||
xxhash.c
|
xxhash.c
|
||||||
xxhash.h)
|
xxhash.h)
|
||||||
|
|
||||||
|
add_library(stacktrace stacktrace.amalgamation.cpp stacktrace.h)
|
||||||
|
if (USE_ASAN)
|
||||||
|
target_compile_definitions(stacktrace PRIVATE ADDRESS_SANITIZER)
|
||||||
|
elseif(USE_MSAN)
|
||||||
|
target_compile_definitions(stacktrace PRIVATE MEMORY_SANITIZER)
|
||||||
|
elseif(USE_UBSAN)
|
||||||
|
target_compile_definitions(stacktrace PRIVATE UNDEFINED_BEHAVIOR_SANITIZER)
|
||||||
|
elseif(USE_TSAN)
|
||||||
|
target_compile_definitions(stacktrace PRIVATE THREAD_SANITIZER DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(UNIX AND NOT APPLE)
|
if(UNIX AND NOT APPLE)
|
||||||
list(APPEND FLOW_SRCS folly_memcpy.S)
|
list(APPEND FLOW_SRCS folly_memcpy.S)
|
||||||
endif()
|
endif()
|
||||||
@ -102,6 +112,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/SourceVersion.h.cmake ${CMAKE_CURRENT
|
|||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
||||||
|
|
||||||
add_flow_target(STATIC_LIBRARY NAME flow SRCS ${FLOW_SRCS})
|
add_flow_target(STATIC_LIBRARY NAME flow SRCS ${FLOW_SRCS})
|
||||||
|
target_link_libraries(flow PRIVATE stacktrace)
|
||||||
if (NOT APPLE AND NOT WIN32)
|
if (NOT APPLE AND NOT WIN32)
|
||||||
set (FLOW_LIBS ${FLOW_LIBS} rt)
|
set (FLOW_LIBS ${FLOW_LIBS} rt)
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
|
@ -14,24 +14,12 @@
|
|||||||
# cmakedefine USE_ASAN
|
# cmakedefine USE_ASAN
|
||||||
# cmakedefine USE_MSAN
|
# cmakedefine USE_MSAN
|
||||||
# cmakedefine USE_UBSAN
|
# cmakedefine USE_UBSAN
|
||||||
|
# cmakedefine USE_TSAN
|
||||||
# if defined(USE_ASAN) || \
|
# if defined(USE_ASAN) || \
|
||||||
defined(USE_MSAN) || \
|
defined(USE_MSAN) || \
|
||||||
defined(USE_UBSAN) || \
|
defined(USE_UBSAN) || \
|
||||||
defined(USE_TSAN)
|
defined(USE_TSAN)
|
||||||
# define DUSE_SANITIZER
|
# define USE_SANITIZER
|
||||||
# #endif
|
|
||||||
# #ifdef USE_ASAN
|
|
||||||
# define ADDRESS_SANITIZER
|
|
||||||
# endif // USE_ASAN
|
|
||||||
# ifdef USE_MSAN
|
|
||||||
# define MEMORY_SANITIZER
|
|
||||||
# endif
|
|
||||||
# ifdef USE_UBSAN
|
|
||||||
# define UNDEFINED_BEHAVIOR_SANITIZER
|
|
||||||
# endif
|
|
||||||
# ifdef USE_TSAN
|
|
||||||
# define THREAD_SANITIZER
|
|
||||||
# define DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL 1
|
|
||||||
# endif
|
# endif
|
||||||
# cmakedefine USE_GCOV
|
# cmakedefine USE_GCOV
|
||||||
# cmakedefine USE_VALGRIND
|
# cmakedefine USE_VALGRIND
|
||||||
|
Loading…
x
Reference in New Issue
Block a user