Web lists-archives.com

[Mingw-users] Thread-local storage




Is thread-local storage with the __thread qualifier supposed to work
in MinGW GCC?  Specifically, with GCC 4.9.3 built by Keith and using
Binutils 2.26 (that I built myself)?

I've built today the release candidate of libmpfr 3.1.4 with those
tools.  The configure script ran a test of TLS, which succeeded.
However, almost all the tests in the test suite failed.  Debugging
pointed to TLS (some per-thread variable got a zero value instead of a
positive one), so I rebuilt without TLS -- and the tests all passed.
The official MinGW port of an older version of libmpfr was built
without TLS (config.log in the source tarball indicates that the TLS
test failed when that port was built).

This library builds as a DLL.  I know about the gotchas with loading
DLLs that use TLS, but AFAIK this is only relevant to DLLs loaded with
LoadLibrary.  In the case in point, the DLL was loaded because the
test programs were linked against libmpfr.

Does anyone know if this feature is supposed to work?  If it is, is
there something special that a shared library should do beyond using
the __thread qualifier?  Does linking with static libgcc have any
influence on this?

Thanks.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe