From 8bb4ab61a2ddebd98acaf0a8cd2005f93833caf2 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 11 May 2026 08:11:03 +0200 Subject: [PATCH 1/4] NEWS: gcc 16 native tls --- web/news.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/web/news.md b/web/news.md index cadb52a0..b46b8203 100644 --- a/web/news.md +++ b/web/news.md @@ -5,6 +5,39 @@ summary: Important events happening. 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 :) +### 2026-05-12 - Native Thread Local Storage (TLS) with GCC 16 + +GCC 16 gained support for native TLS, which we just enabled in MSYS2. + +Native TLS provides superior performance compared to the emulated variant +(emutls), which was used by GCC up until now. For example, certain micro +benchmarks with CPython, which relies heavily on TLS, are now [three times +faster](https://github.com/msys2/MINGW-packages/issues/22917#issuecomment-4411966245). + +All affected packages (~300) in the MSYS2 repository have been rebuilt to make +use of it. Clang in our GCC environments were also switched to use native TLS. +Our Clang environments were already using native TLS, so no changes there. + +Some things to watch out for in case you build/maintain binaries outside of +MSYS2: + +* libstdc++ lost some symbols (`__emutls_v._ZSt11__once_call` and + `__emutls_v._ZSt15__once_callable`), so existing binaries linking against + libstdc++ might fail to load after the update. Simply rebuilding your code + which links to libstdc++ with the newest GCC will fix this. +* Binaries linking to libgcc using emutls (indicated by imports to + `__emutls_get_address`) will continue to work, but to make use of native TLS + will also have to be rebuild. +* A limitation of native TLS compared to emutls (and Linux) is that TLS + variables cannot be accessed directly across DLLs boundaries and will now + result in linker errors. You can work around this by accessing TLS variables + via accessor functions, or static linking. Note that this limitation also + applies to MSVC and Clang on Windows, so cross platform code is very unlikely + to be affected. + +tl;dr: if your external binaries do any TLS related imports (`grep __emutls_ +*.exe *.dll`) it's recommended to rebuild them. + ### 2026-03-15 - Deprecating the MINGW64 Environment As support for Windows 8.1 has been dropped, there is no longer a need for From 63399884cf83ab7101bdb0dffa6050504fc7c29d Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 11 May 2026 08:17:50 +0200 Subject: [PATCH 2/4] fix --- web/news.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/news.md b/web/news.md index b46b8203..b9ad2dec 100644 --- a/web/news.md +++ b/web/news.md @@ -16,7 +16,7 @@ faster](https://github.com/msys2/MINGW-packages/issues/22917#issuecomment-441196 All affected packages (~300) in the MSYS2 repository have been rebuilt to make use of it. Clang in our GCC environments were also switched to use native TLS. -Our Clang environments were already using native TLS, so no changes there. +Our Clang environments have already been using native TLS, so no changes there. Some things to watch out for in case you build/maintain binaries outside of MSYS2: From aa1b408f583adc8cd7119c361ee77c837ce99112 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 11 May 2026 08:19:00 +0200 Subject: [PATCH 3/4] fix --- web/news.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/news.md b/web/news.md index b9ad2dec..93ffee74 100644 --- a/web/news.md +++ b/web/news.md @@ -27,7 +27,7 @@ MSYS2: which links to libstdc++ with the newest GCC will fix this. * Binaries linking to libgcc using emutls (indicated by imports to `__emutls_get_address`) will continue to work, but to make use of native TLS - will also have to be rebuild. + will also have to be rebuilt. * A limitation of native TLS compared to emutls (and Linux) is that TLS variables cannot be accessed directly across DLLs boundaries and will now result in linker errors. You can work around this by accessing TLS variables From d0b80b981a8411301784c01f7b1b851fb8059fd9 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Mon, 11 May 2026 20:45:39 +0200 Subject: [PATCH 4/4] update --- web/news.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/news.md b/web/news.md index 93ffee74..45a79711 100644 --- a/web/news.md +++ b/web/news.md @@ -5,7 +5,7 @@ summary: Important events happening. 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 :) -### 2026-05-12 - Native Thread Local Storage (TLS) with GCC 16 +### 2026-05-11 - Native Thread Local Storage (TLS) with GCC 16 GCC 16 gained support for native TLS, which we just enabled in MSYS2.