Enable standard thread local storage ABI support
Picolibc supports TLS for thread-specific variables like errno, but without compiler support, it cannot be used which forces applications into single-threaded mode causing potential conflicts in multi-threaded environments. TLS support has been enabled in the Debian/Ubuntu and Zephyr toolchains for years, it would be nice to get that into the ARM toolchains as well.
commit b8ae11a58916a71221d4cc54b13532b139f45464 (HEAD -> enable-tls)
Author: Keith Packard <keithp@keithp.com>
Date: Mon Apr 21 11:52:39 2025 -0700
gcc: Enable compiler support for thread local storage
This enables compiler support for the standard TLS ABI rather than
using GCC's TLS emulation. This only affects applications using thread
local variables.
Signed-off-by: Keith Packard <keithp@keithp.com>
diff --git a/build-baremetal-toolchain.sh b/build-baremetal-toolchain.sh
index ffe29cf..c79877f 100755
--- a/build-baremetal-toolchain.sh
+++ b/build-baremetal-toolchain.sh
@@ -1014,7 +1014,7 @@ while true; do
--disable-shared \
--disable-nls \
--disable-threads \
- --disable-tls \
+ --enable-tls \
--enable-checking=$flag_check_final \
--enable-languages=$languages_gcc1 \
--without-cloog \
@@ -1133,7 +1133,7 @@ while true; do
--disable-shared \
--disable-nls \
--disable-threads \
- --disable-tls \
+ --enable-tls \
--enable-checking=$flag_check_final \
--enable-languages=$languages \
--with-newlib \
@@ -1186,7 +1186,7 @@ while true; do
--disable-shared \
--disable-nls \
--disable-threads \
- --disable-tls \
+ --enable-tls \
--enable-checking=$flag_check_final \
--enable-languages=$languages \
--with-newlib \
Edited by Congregate Migrate