-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rust builds an unloadable shared library: No space available for static Thread Local Storage #140092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Th default tls-model is general-dynamic, and I'm not seeing it being overridden by the base target (freebsd) or the target (x86_64_unknown_freebsd). rust/compiler/rustc_target/src/spec/mod.rs Line 2797 in b8c54d6
What happens if you set (or export) cc @asomers @MikaelUrankar (our FreeBSD target maintainers) Footnotes |
|
Yes, I forgot to mention: |
The bug might as well be in Maturin. I am not familiar how Maturin interacts with Rust. |
Polars looks to pull in mimalloc and that has a TLS model override by default for the C code it compiles (I'm not sure why): https://github.com/purpleprotocol/mimalloc_rust/blob/59d7ee3ba7aa030b46a7cf721720f63a579b7fdb/libmimalloc-sys/build.rs#L28-L34 I'd recommend filing upstream bug report (with mimalloc and/or polars) to change that. I don't think there's any particular bug in Rust here, indeed the rustc TLS model might be global dynamic for the whole build. |
I created the mimalloc bug report: Thank you for your help! Yuri |
The Polars project builds the shared library that can't be loaded. dlopen fails with the error:
The binary is /usr/local/lib/python3.11/site-packages/polars/polars.abi3.so
Meta
rustc --version --verbose
:FreeBSD 14.2 amd64
Description
One possible reason is that wrong tls-model is used. It probably uses the tls-model initial-exec intended for non-PIC binaries instead of the tls-model global-dynamic intended for PIC binaries.
The tls-model choice is buried in Rust and Maturin code and it is unclear where the problem lies.
Additional details are in this downstream bug report.
How to reproduce:
The text was updated successfully, but these errors were encountered: