Add disable_initial_exec_tls feature

This allows libraries that link against jemalloc to be dlopened. 

See

https://github.com/jemalloc/jemalloc/issues/937
https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md

for detailed explanation of the feature.
This commit is contained in:
Joel Höner 2019-03-19 23:28:36 +01:00 committed by gnzlbg
parent c23204616d
commit ea444b8758
3 changed files with 7 additions and 0 deletions

View File

@ -51,6 +51,7 @@ stats = ["jemalloc-sys/stats"]
background_threads_runtime_support = ["jemalloc-sys/background_threads_runtime_support"]
background_threads = ["jemalloc-sys/background_threads"]
unprefixed_malloc_on_supported_platforms = ["jemalloc-sys/unprefixed_malloc_on_supported_platforms"]
disable_initial_exec_tls = ["jemalloc-sys/disable_initial_exec_tls"]
[package.metadata.docs.rs]
features = [ "alloc_trait" ]

View File

@ -45,6 +45,7 @@ background_threads_runtime_support = []
background_threads = [ "background_threads_runtime_support" ]
stats = []
unprefixed_malloc_on_supported_platforms = []
disable_initial_exec_tls = []
[package.metadata.docs.rs]
rustdoc-args = [ "--cfg jemallocator_docs" ]

View File

@ -292,6 +292,11 @@ fn main() {
cmd.arg("--enable-stats");
}
if env::var("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS").is_ok() {
info!("CARGO_FEATURE_DISABLE_INITIAL_EXEC_TLS set");
cmd.arg("--disable-initial-exec-tls");
}
cmd.arg(format!("--host={}", gnu_target(&target)));
cmd.arg(format!("--build={}", gnu_target(&host)));
cmd.arg(format!("--prefix={}", out_dir.display()));