diff config/tls.m4 @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents f6334be47118
children
line wrap: on
line diff
--- a/config/tls.m4	Thu Oct 25 07:37:49 2018 +0900
+++ b/config/tls.m4	Thu Feb 13 11:34:05 2020 +0900
@@ -4,14 +4,14 @@
   GCC_ENABLE(tls, yes, [], [Use thread-local storage])
   AC_CACHE_CHECK([whether the target supports thread-local storage],
 		 gcc_cv_have_tls, [
-    AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
+    AC_RUN_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int main() { return a = b; }])],
       [dnl If the test case passed with dynamic linking, try again with
        dnl static linking, but only if static linking is supported (not
        dnl on Solaris 10).  This fails with some older Red Hat releases.
       chktls_save_LDFLAGS="$LDFLAGS"
       LDFLAGS="-static $LDFLAGS"
-      AC_LINK_IFELSE([int main() { return 0; }],
-	[AC_RUN_IFELSE([__thread int a; int b; int main() { return a = b; }],
+      AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
+	[AC_RUN_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int main() { return a = b; }])],
 		       [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no],[])],
 	[gcc_cv_have_tls=yes])
       LDFLAGS="$chktls_save_LDFLAGS"
@@ -71,20 +71,20 @@
       [gcc_cv_have_tls=no],
       [dnl This is the cross-compiling case. Assume libc supports TLS if the
        dnl binutils and the compiler do.
-       AC_LINK_IFELSE([__thread int a; int b; int main() { return a = b; }],
+       AC_LINK_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int main() { return a = b; }])],
 	 [chktls_save_LDFLAGS="$LDFLAGS"
 	  dnl Shared library options may depend on the host; this check
 	  dnl is only known to be needed for GNU/Linux.
 	  case $host in
-	    *-*-linux*)
+	    *-*-linux* | -*-uclinuxfdpic*)
 	      LDFLAGS="-shared -Wl,--no-undefined $LDFLAGS"
 	      ;;
 	  esac
 	  chktls_save_CFLAGS="$CFLAGS"
 	  CFLAGS="-fPIC $CFLAGS"
 	  dnl If -shared works, test if TLS works in a shared library.
-	  AC_LINK_IFELSE([int f() { return 0; }],
-	    [AC_LINK_IFELSE([__thread int a; int b; int f() { return a = b; }],
+	  AC_LINK_IFELSE([AC_LANG_SOURCE([int f() { return 0; }])],
+	    [AC_LINK_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int f() { return a = b; }])],
 	      [gcc_cv_have_tls=yes],
 	      [gcc_cv_have_tls=no])],
 	    [gcc_cv_have_tls=yes])
@@ -102,7 +102,7 @@
   GCC_ENABLE(tls, yes, [], [Use thread-local storage])
   AC_CACHE_CHECK([whether the target assembler supports thread-local storage],
 		 gcc_cv_have_cc_tls, [
-    AC_COMPILE_IFELSE([__thread int a; int b; int main() { return a = b; }],
+    AC_COMPILE_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int main() { return a = b; }])],
       [gcc_cv_have_cc_tls=yes], [gcc_cv_have_cc_tls=no])]
     )])
   if test "$enable_tls $gcc_cv_have_cc_tls" = "yes yes"; then