]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Enforce usage -zrelax=transtls when GNU C Compiler is used on Solaris
authorOndřej Surý <ondrej@sury.org>
Wed, 19 Jun 2019 09:21:36 +0000 (11:21 +0200)
committerWitold Krecicki <wpk@isc.org>
Thu, 27 Jun 2019 08:18:44 +0000 (04:18 -0400)
When GNU C Compiler is used on Solaris (11), the Thread Local Storage
is completely broken.  The behaviour doesn't manifest when GNU ld is
used.  Thus, we need to enforce usage of GNU ld when GNU C Compiler is
the compiler of choice.

For more background for this change, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90912

configure
configure.ac

index dfce44b5706b8c41f10343973e7868667e744037..50c2bacdca1e377116d9665112bb7d45e659edb0 100755 (executable)
--- a/configure
+++ b/configure
 
 
 
+#
+# Using Solaris linker with gcc on Solaris breaks Thread Local Storage
+#
+case $host in #(
+  *-solaris*) :
+
+           if test "$GCC" = "yes"; then :
+  LDFLAGS="$LDFLAGS -zrelax=transtls"
+                  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage" >&5
+$as_echo "$as_me: WARNING: When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage" >&2;}
+
+fi
+        ;; #(
+  *) :
+     ;;
+esac
+
 #
 # CCNOOPT defaults to -O0 on gcc and disables optimization when is last
 #
index 714b501d0a02d585da9d335729288528166c8a47..3058a33eb9419bb15873f2094a34c7b78aa2ecca 100644 (file)
@@ -326,6 +326,17 @@ esac
 AC_PROG_CC
 AC_PROG_CC_C99
 
+#
+# Using Solaris linker with gcc on Solaris breaks Thread Local Storage
+#
+AS_CASE([$host],
+       [*-solaris*],[
+           AS_IF([test "$GCC" = "yes"],
+                 [LDFLAGS="$LDFLAGS -zrelax=transtls"
+                  AC_MSG_WARN([When using GNU C Compiler on Solaris, -zrelax=transtls linker flag is used to fix bug in Thread Local Storage])
+                 ])
+       ])
+
 #
 # CCNOOPT defaults to -O0 on gcc and disables optimization when is last
 #