diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-08-31 10:28:07 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-09-01 11:03:28 -0700 |
| commit | 9a3acece30414a2d306102ec4e6faac0b6f3c482 (patch) | |
| tree | 7ddb8a1bcdf0d1357400d15c305da2f8f20199b1 /src/libstd/sys/unix/stack_overflow.rs | |
| parent | 8dba06aeee28e9ed6a1b9918a91cbef242af53d3 (diff) | |
| download | rust-9a3acece30414a2d306102ec4e6faac0b6f3c482.tar.gz rust-9a3acece30414a2d306102ec4e6faac0b6f3c482.zip | |
std: Run TLS destructors in a statically linked binary
Running TLS destructors for a MSVC Windows binary requires the linker doesn't elide the `_tls_used` or `__tls_used` symbols (depending on the architecture). This is currently achieved via a `#[link_args]` hack but this only works for dynamically linked binaries because the link arguments aren't propagated to statically linked binaries. This commit alters the strategy to instead emit a volatile load from those symbols so LLVM can't elide it, forcing the reference to the symbol to stay alive as long as the callback function stays alive (which we've made sure of with the `#[linkage]` attribute). Closes #28111
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
