Enable Thread Local Storage when building a mingw-w64 cross-compiler

714 Views Asked by At

I've been trying for days to build a mingw-w64 toolchain, I'm stuck at building the cross-compiler, GCC 8.1.0.

The problem is that I must have Thread Local Storage (TLS) enabled, therefore I pass --enable-tls to GCC's configure script.

With no success, since at the end of the build, _GLIBCXX_HAVE_TLS is undefined in config.h, same thing for _GLIBCXX_HAVE_CC_TLS.

I tried to browse and even patch the autotools files to understand how to make it work.

Has anyone encountered this issue?

Note that the mingw-w64 installer on Windows has TLS symbols, so it must be possible to build GCC for this target and TLS.

1

There are 1 best solutions below

0
On

Sorry for this very late response, but trying to resolve the same problem, I just found this commit on GCC : https://github.com/gcc-mirror/gcc/commit/cc1e28878a228b6c4a0872e56d97ac88971b7725

Seems to be exactly what we need. Not tested yet on my side.