rust/src/libstd/sys
bors cb9323ec09 Auto merge of #28130 - alexcrichton:fix-msvc-static-tls-dtor, r=brson
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
2015-09-01 19:34:21 +00:00
..
common Auto merge of #27808 - SimonSapin:utf16decoder, r=alexcrichton 2015-08-27 00:41:13 +00:00
unix Atomically set CLOEXEC on duplicated sockets 2015-08-30 10:24:05 +02:00
windows std: Run TLS destructors in a statically linked binary 2015-09-01 11:03:28 -07:00