From 1d4779215daafca57d2e4a3b7637e71d2ce3a549 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 1 Mar 2016 21:29:13 +0200 Subject: [PATCH] Ensure symbols are resolved at link-time. With the linker flags "-Wl,-z,defs", all symbols used by a library are resolved at link-time. Otherwise they will be resolved at runtime. The use of these flags ensures that missing symbols are found as early as possible. Case in point, the binlog router test-cases failed, because the loading of the binlog router failed due to missing symbols my_uuid_init and my_uuid. The reason was that when maxscale no longer was linked with the embedded library, those symbols were not available. Now we know that the loading of the binlog router will not fail due to missing symbols. --- server/modules/routing/binlog/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/server/modules/routing/binlog/CMakeLists.txt b/server/modules/routing/binlog/CMakeLists.txt index 5a3e54a0a..2250ca0ea 100644 --- a/server/modules/routing/binlog/CMakeLists.txt +++ b/server/modules/routing/binlog/CMakeLists.txt @@ -1,5 +1,6 @@ add_library(binlogrouter SHARED blr.c blr_master.c blr_cache.c blr_slave.c blr_file.c) set_target_properties(binlogrouter PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_RPATH}:${MAXSCALE_LIBDIR} VERSION "2.0.0") +set_target_properties(binlogrouter PROPERTIES LINK_FLAGS -Wl,-z,defs) # libbinlogrouter refers to my_uuid_init and my_uuid. They are non-public functions and # should not be used. They are found only from the embedded lib. target_link_libraries(binlogrouter maxscale-common ${MYSQL_EMBEDDED_LIBRARIES})