1
Fork 0

Rollup merge of #92042 - ChrisDenton:msvc-static-tls, r=nagisa

Enable `#[thread_local]` for all windows-msvc targets

As it stands, `#[thread_local]` is enabled haphazardly for msvc. It seems all 64-bit targets have it enabled, but not 32-bit targets unless they're also UWP targets (perhaps because UWP was added more recently?). So this PR simply enables it for 32-bit targets as well. I can't think of a reason not to and I've confirmed by running tests locally which pass.

See also #91659
This commit is contained in:
Matthias Krüger 2021-12-19 10:45:53 +01:00 committed by GitHub
commit 4dbe966fdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 21 additions and 27 deletions

View file

@ -880,7 +880,7 @@ fn default_configuration(sess: &Session) -> CrateConfig {
ret.insert((sym::target_env, Some(Symbol::intern(env))));
ret.insert((sym::target_abi, Some(Symbol::intern(abi))));
ret.insert((sym::target_vendor, Some(Symbol::intern(vendor))));
if sess.target.has_elf_tls {
if sess.target.has_thread_local {
ret.insert((sym::target_thread_local, None));
}
for (i, align) in [