Explicitly link against ASAN libraries

Some systems (Ubuntu Trusty) require explicit linking against ASAN
libraries.
This commit is contained in:
Markus Mäkelä 2018-09-28 11:05:51 +03:00
parent 5b644a785b
commit 104a6d1bfb
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 8 additions and 6 deletions

View File

@ -3,6 +3,10 @@ if (AVRO_FOUND AND JANSSON_FOUND)
add_library(maxavro maxavro.c maxavro_schema.c maxavro_record.c maxavro_file.c)
target_link_libraries(maxavro maxscale-common ${JANSSON_LIBRARIES})
if(WITH_ASAN AND ASAN_FOUND)
target_link_libraries(maxavro ${ASAN_LIBRARIES})
endif()
add_executable(maxavrocheck maxavrocheck.c)
target_link_libraries(maxavrocheck maxavro)
install_executable(maxavrocheck core)

View File

@ -54,12 +54,6 @@ add_library(maxscale-common SHARED
workertask.cc
)
if(WITH_JEMALLOC)
target_link_libraries(maxscale-common ${JEMALLOC_LIBRARIES})
elseif(WITH_TCMALLOC)
target_link_libraries(maxscale-common ${TCMALLOC_LIBRARIES})
endif()
target_link_libraries(maxscale-common
${MARIADB_CONNECTOR_LIBRARIES}
${LZMA_LINK_FLAGS}
@ -80,6 +74,10 @@ target_link_libraries(maxscale-common
${MICROHTTPD_LIBRARIES}
)
if(WITH_ASAN AND ASAN_FOUND)
target_link_libraries(maxscale-common ${ASAN_LIBRARIES})
endif()
find_library(HAVE_LIBDL NAMES dl)
if (HAVE_LIBDL)
# libdl just exposes libc functionality on most systems. This means that if