mirror of
https://github.com/microsoft/mimalloc.git
synced 2024-12-30 23:43:39 +08:00
Merge pull request #148 from pitrou/tls-local-dynamic
Fix #147: provide CMake option for alternate TLS mechanism
This commit is contained in:
commit
270e765454
@ -10,6 +10,7 @@ option(MI_SEE_ASM "Generate assembly files" OFF)
|
|||||||
option(MI_CHECK_FULL "Use full internal invariant checking in DEBUG mode" OFF)
|
option(MI_CHECK_FULL "Use full internal invariant checking in DEBUG mode" OFF)
|
||||||
option(MI_USE_CXX "Use the C++ compiler to compile the library" OFF)
|
option(MI_USE_CXX "Use the C++ compiler to compile the library" OFF)
|
||||||
option(MI_SECURE "Use security mitigations (like guard pages and randomization)" OFF)
|
option(MI_SECURE "Use security mitigations (like guard pages and randomization)" OFF)
|
||||||
|
option(MI_LOCAL_DYNAMIC_TLS "Use slightly slower, dlopen-compatible TLS mechanism (Unix)" OFF)
|
||||||
option(MI_BUILD_TESTS "Build test executables" ON)
|
option(MI_BUILD_TESTS "Build test executables" ON)
|
||||||
|
|
||||||
set(mi_install_dir "lib/mimalloc-${mi_version}")
|
set(mi_install_dir "lib/mimalloc-${mi_version}")
|
||||||
@ -84,7 +85,12 @@ endif()
|
|||||||
|
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
|
if(CMAKE_C_COMPILER_ID MATCHES "AppleClang|Clang|GNU")
|
||||||
list(APPEND mi_cflags -Wall -Wextra -Wno-unknown-pragmas -ftls-model=initial-exec)
|
list(APPEND mi_cflags -Wall -Wextra -Wno-unknown-pragmas)
|
||||||
|
if(MI_LOCAL_DYNAMIC_TLS MATCHES "ON")
|
||||||
|
list(APPEND mi_cflags -ftls-model=local-dynamic)
|
||||||
|
else()
|
||||||
|
list(APPEND mi_cflags -ftls-model=initial-exec)
|
||||||
|
endif()
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU")
|
||||||
list(APPEND mi_cflags -Wno-invalid-memory-model)
|
list(APPEND mi_cflags -Wno-invalid-memory-model)
|
||||||
list(APPEND mi_cflags -fvisibility=hidden)
|
list(APPEND mi_cflags -fvisibility=hidden)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user