зеркало из https://github.com/microsoft/snmalloc.git
Adding an option to disable TLS (#632)
Signed-off-by: Matthew A Johnson <matjoh@microsoft.com>
This commit is contained in:
Родитель
7b597335ae
Коммит
35eef33099
|
@ -26,6 +26,7 @@ option(SNMALLOC_NO_REALLOCARR "Build without reallocarr exported" ON)
|
|||
option(SNMALLOC_LINK_ICF "Link with Identical Code Folding" ON)
|
||||
option(SNMALLOC_IPO "Link with IPO/LTO support" OFF)
|
||||
option(SNMALLOC_BENCHMARK_INDIVIDUAL_MITIGATIONS "Build tests and ld_preload for individual mitigations" OFF)
|
||||
option(SNMALLOC_ENABLE_DYNAMIC_LOADING "Build such that snmalloc can be dynamically loaded. This is not required for LD_PRELOAD, and will harm performance if enabled." OFF)
|
||||
# Options that apply only if we're not building the header-only library
|
||||
cmake_dependent_option(SNMALLOC_RUST_SUPPORT "Build static library for rust" OFF "NOT SNMALLOC_HEADER_ONLY_LIBRARY" OFF)
|
||||
cmake_dependent_option(SNMALLOC_STATIC_LIBRARY "Build static libraries" ON "NOT SNMALLOC_HEADER_ONLY_LIBRARY" OFF)
|
||||
|
@ -396,7 +397,8 @@ if(NOT SNMALLOC_HEADER_ONLY_LIBRARY)
|
|||
target_compile_options(${name} PRIVATE -mprfchw)
|
||||
endif()
|
||||
# Static TLS model is unsupported on Haiku.
|
||||
if (NOT CMAKE_SYSTEM_NAME STREQUAL "Haiku")
|
||||
if ((NOT CMAKE_SYSTEM_NAME STREQUAL "Haiku") AND (NOT SNMALLOC_ENABLE_DYNAMIC_LOADING))
|
||||
message(STATUS "snmalloc: Using static TLS model")
|
||||
target_compile_options(${name} PRIVATE -ftls-model=initial-exec)
|
||||
target_compile_options(${name} PRIVATE $<$<BOOL:${SNMALLOC_CI_BUILD}>:-g>)
|
||||
endif()
|
||||
|
|
Загрузка…
Ссылка в новой задаче