Use -ftls-model=initial-exec with maxscale-common

Resolving the relocations right at startup reduces the cost of using
thread-local variables.
This commit is contained in:
Markus Mäkelä 2019-01-10 11:59:36 +02:00
parent 944ee3d977
commit 08dd55a26a
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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)