Skip to content

Commit 71c71a1

Browse files
authored
NEWS: gcc 16 native tls (#434)
* NEWS: gcc 16 native tls * fix * fix * update
1 parent feee3de commit 71c71a1

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

web/news.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,39 @@ summary: Important events happening.
55

66
This page lists important changes or issues affecting MSYS2 users. You can [:material-rss: subscribe via RSS](../news.xml). We also post them to [Mastodon](https://fosstodon.org/@msys2org) / [Bluesky](https://bsky.app/profile/msys2org.bsky.social), including some not-so-important things :)
77

8+
### 2026-05-11 - Native Thread Local Storage (TLS) with GCC 16
9+
10+
GCC 16 gained support for native TLS, which we just enabled in MSYS2.
11+
12+
Native TLS provides superior performance compared to the emulated variant
13+
(emutls), which was used by GCC up until now. For example, certain micro
14+
benchmarks with CPython, which relies heavily on TLS, are now [three times
15+
faster](https://github.com/msys2/MINGW-packages/issues/22917#issuecomment-4411966245).
16+
17+
All affected packages (~300) in the MSYS2 repository have been rebuilt to make
18+
use of it. Clang in our GCC environments were also switched to use native TLS.
19+
Our Clang environments have already been using native TLS, so no changes there.
20+
21+
Some things to watch out for in case you build/maintain binaries outside of
22+
MSYS2:
23+
24+
* libstdc++ lost some symbols (`__emutls_v._ZSt11__once_call` and
25+
`__emutls_v._ZSt15__once_callable`), so existing binaries linking against
26+
libstdc++ might fail to load after the update. Simply rebuilding your code
27+
which links to libstdc++ with the newest GCC will fix this.
28+
* Binaries linking to libgcc using emutls (indicated by imports to
29+
`__emutls_get_address`) will continue to work, but to make use of native TLS
30+
will also have to be rebuilt.
31+
* A limitation of native TLS compared to emutls (and Linux) is that TLS
32+
variables cannot be accessed directly across DLLs boundaries and will now
33+
result in linker errors. You can work around this by accessing TLS variables
34+
via accessor functions, or static linking. Note that this limitation also
35+
applies to MSVC and Clang on Windows, so cross platform code is very unlikely
36+
to be affected.
37+
38+
tl;dr: if your external binaries do any TLS related imports (`grep __emutls_
39+
*.exe *.dll`) it's recommended to rebuild them.
40+
841
### 2026-03-15 - Deprecating the MINGW64 Environment
942

1043
As support for Windows 8.1 has been dropped, there is no longer a need for

0 commit comments

Comments
 (0)