Skip to content

Commit 69a3bfe

Browse files
adapt to boost ucontext for asan (#193)
1 parent 0fa6113 commit 69a3bfe

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

sql/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ SET(SQL_DEP_LIBS
285285
IF(COROUTINE_ENABLED)
286286
SET(SQL_DEP_LIBS ${SQL_DEP_LIBS} Boost::context)
287287
set(SQL_INCLUDE_DIR ${Boost_INCLUDE_DIRS})
288+
if (WITH_ASAN)
289+
# Boost stackful contexts need to switch to the ucontext backend when
290+
# ASAN is enabled, otherwise fcontext symbols are missing at link time.
291+
set(SQL_USE_ASAN_UCONTEXT ON)
292+
endif()
288293
ENDIF()
289294

290295
IF(ELOQ_MODULE_ENABLED)
@@ -311,6 +316,10 @@ MAYBE_DISABLE_IPO(sql)
311316
DTRACE_INSTRUMENT(sql)
312317
TARGET_LINK_LIBRARIES(sql ${SQL_DEP_LIBS})
313318

319+
if (SQL_USE_ASAN_UCONTEXT)
320+
target_compile_definitions(sql PRIVATE BOOST_USE_ASAN BOOST_USE_UCONTEXT)
321+
endif()
322+
314323
# IF(PLUGIN_ELOQ)
315324
ADD_DEFINITIONS(-DWITH_ELOQ_STORAGE_ENGINE)
316325
SET(ELOQ_SOURCE_DIR ${ELOQSQL_SOURCE_DIR}/storage/eloq)

0 commit comments

Comments
 (0)