From 104a6d1bfba4d705f5bed3ed7dc09ca0c47462ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Fri, 28 Sep 2018 11:05:51 +0300 Subject: [PATCH] Explicitly link against ASAN libraries Some systems (Ubuntu Trusty) require explicit linking against ASAN libraries. --- avro/CMakeLists.txt | 4 ++++ server/core/CMakeLists.txt | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/avro/CMakeLists.txt b/avro/CMakeLists.txt index cef0e2e05..81c0bb9ca 100644 --- a/avro/CMakeLists.txt +++ b/avro/CMakeLists.txt @@ -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) diff --git a/server/core/CMakeLists.txt b/server/core/CMakeLists.txt index 503adf401..ce39307e7 100644 --- a/server/core/CMakeLists.txt +++ b/server/core/CMakeLists.txt @@ -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