Don't trust OpenBSD's gcc to produce working code for __thread.
authorM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
Fri, 9 Jul 2010 09:09:07 +0000 (12:09 +0300)
committerM Joonas Pihlaja <jpihlaja@cc.helsinki.fi>
Wed, 21 Jul 2010 20:52:22 +0000 (23:52 +0300)
The gcc on OpenBSD 4.5 to 4.7 at least produces bad code for __thread,
without as much as a warning.

See PR #6410 "Using __thread TLS variables compiles ok but segfault at runtime."

http://cvs.openbsd.org/cgi-bin/query-pr-wrapper?full=yes&numbers=6410

configure.ac

index b9488d9..3c6f01d 100644 (file)
@@ -531,6 +531,9 @@ AC_LINK_IFELSE([
 #ifdef __MINGW32__
 #error MinGW has broken __thread support
 #endif
+#ifdef __OpenBSD__
+#error OpenBSD has broken __thread support
+#endif
 static __thread int x ;
 int main () { x = 123; return x; }
 ], support_for__thread=yes)