From 08dd55a26aab2552d2566002e87297be61b8f878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Thu, 10 Jan 2019 11:59:36 +0200 Subject: [PATCH] Use -ftls-model=initial-exec with maxscale-common Resolving the relocations right at startup reduces the cost of using thread-local variables. --- server/core/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/core/CMakeLists.txt b/server/core/CMakeLists.txt index 53238e5c4..25c221525 100644 --- a/server/core/CMakeLists.txt +++ b/server/core/CMakeLists.txt @@ -81,6 +81,10 @@ if (HAVE_LIBDL) target_link_libraries(maxscale-common dl) endif() +# Using initial-exec instead of the default global-dynamic tls-model +# reduces the cost of using thread-local variables in dynamic libraries. +target_compile_options(maxscale-common PUBLIC "-ftls-model=initial-exec") + add_dependencies(maxscale-common pcre2 connector-c libmicrohttpd jansson maxbase) set_target_properties(maxscale-common PROPERTIES VERSION "1.0.0") install_module(maxscale-common core)