diff --git a/configure.ac b/configure.ac
index df17cbe5d98cc841db6ce57054116d6a148e8e7a..16500818c0366b21d9681538f684181357b6273c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1046,19 +1046,6 @@ AC_CHECK_FUNCS([eventfd])
 
 AC_CHECK_FUNCS([getpid getuid raise])
 
-dnl ** Check for __thread support in the compiler
-AC_MSG_CHECKING(for __thread support)
-AC_COMPILE_IFELSE(
-  [ AC_LANG_SOURCE([[__thread int tester = 0;]]) ],
-  [
-   AC_MSG_RESULT(yes)
-   AC_DEFINE([CC_SUPPORTS_TLS],[1],[Define to 1 if __thread is supported])
-  ],
-  [
-   AC_MSG_RESULT(no)
-   AC_DEFINE([CC_SUPPORTS_TLS],[0],[Define to 1 if __thread is supported])
-  ])
-
 GHC_ADJUSTORS_METHOD([Target])
 AC_SUBST([UseLibffiForAdjustors])
 
diff --git a/rts/configure.ac b/rts/configure.ac
index 54bc0630e93a97c1c5a2bc23859124bf80aaca3e..706f579a9c5763993911b99213a4ce03527340dd 100644
--- a/rts/configure.ac
+++ b/rts/configure.ac
@@ -33,6 +33,19 @@ GHC_CONVERT_PLATFORM_PARTS([host], [Host])
 FPTOOLS_SET_PLATFORM_VARS([host], [Host])
 FPTOOLS_SET_HASKELL_PLATFORM_VARS([Host])
 
+dnl ** Check for __thread support in the compiler
+AC_MSG_CHECKING(for __thread support)
+AC_COMPILE_IFELSE(
+  [ AC_LANG_SOURCE([[__thread int tester = 0;]]) ],
+  [
+   AC_MSG_RESULT(yes)
+   AC_DEFINE([CC_SUPPORTS_TLS],[1],[Define to 1 if __thread is supported])
+  ],
+  [
+   AC_MSG_RESULT(no)
+   AC_DEFINE([CC_SUPPORTS_TLS],[0],[Define to 1 if __thread is supported])
+  ])
+
 dnl large address space support (see rts/include/rts/storage/MBlock.h)
 dnl
 dnl Darwin has vm_allocate/vm_protect