mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-06 09:35:20 +00:00
build: Support ASAN for boost coroutine2 using ucontext (#6531)
This commit is contained in:
parent
8636dca164
commit
c250dac2e7
@ -205,6 +205,13 @@ function(setupBuildFlags)
|
||||
-fsanitize-coverage=edge,indirect-calls
|
||||
)
|
||||
|
||||
# Support ASAN within coroutines2.
|
||||
# Note that __ucontext__ is orders of magnitude slower than __fcontext__.
|
||||
target_compile_definitions(cxx_settings INTERFACE
|
||||
BOOST_USE_UCONTEXT
|
||||
BOOST_USE_ASAN
|
||||
)
|
||||
|
||||
# Require at least address (may be refactored out)
|
||||
target_link_options(cxx_settings INTERFACE
|
||||
-fsanitize=address
|
||||
|
@ -676,6 +676,10 @@ endfunction()
|
||||
function(generateBoostContext)
|
||||
set(library_root "${BOOST_ROOT}/libs/context")
|
||||
|
||||
set(source_files
|
||||
"${library_root}/src/execution_context.cpp"
|
||||
)
|
||||
|
||||
if(DEFINED PLATFORM_LINUX)
|
||||
set(asm_source_file_list
|
||||
"${library_root}/src/asm/jump_x86_64_sysv_elf_gas.S"
|
||||
@ -710,8 +714,14 @@ function(generateBoostContext)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(OSQUERY_ENABLE_ADDRESS_SANITIZER)
|
||||
list(APPEND source_files
|
||||
"${library_root}/src/fiber.cpp"
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(thirdparty_boost_context STATIC
|
||||
"${library_root}/src/execution_context.cpp"
|
||||
${source_files}
|
||||
${asm_source_file_list}
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user