Correctly detect native TLS support with 64-bit gas on Solaris/x86 (PR target/60817)
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 16 Apr 2014 09:09:42 +0000 (09:09 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Wed, 16 Apr 2014 09:09:42 +0000 (09:09 +0000)
PR target/60817
* configure.ac (set_have_as_tls): Merge i[34567]86-*-* and
x86_64-*-* cases.
Pass necessary as flags on 64-bit Solaris/x86.
Use lowercase relocs for x86_64-*-*.
* configure: Regenerate.

From-SVN: r209440

gcc/ChangeLog
gcc/configure
gcc/configure.ac

index 1b81ddc4b7ddc3c44374be1e449e2341e45ba860..add19b2b3a13ad9d264cf40719e44fdd47f66478 100644 (file)
@@ -1,3 +1,12 @@
+2014-04-16  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       PR target/60817
+       * configure.ac (set_have_as_tls): Merge i[34567]86-*-* and
+       x86_64-*-* cases.
+       Pass necessary as flags on 64-bit Solaris/x86.
+       Use lowercase relocs for x86_64-*-*.
+       * configure: Regenerate.
+
 2014-04-15  Jan Hubicka  <jh@suse.cz>
 
        * ipa-devirt.c (referenced_from_vtable_p): New predicate.
index 415377adc190bb34b8407bc3122d97fc93480093..11fb90aae6c357c85071af1ca753a10b3a176761 100755 (executable)
@@ -23283,7 +23283,7 @@ foo:    .long   25
        tls_first_major=2
        tls_first_minor=17
        ;;
-  i[34567]86-*-* | x86_64-*-solaris2.1[0-9]*)
+  i[34567]86-*-* | x86_64-*-*)
     case "$target" in
       i[34567]86-*-solaris2.*)
        on_solaris=yes
@@ -23314,7 +23314,9 @@ $as_echo "#define TLS_SECTION_ASM_FLAG 't'" >>confdefs.h
       tls_section_flag=T
       tls_as_opt="--fatal-warnings"
     fi
-    conftest_s="$conftest_s
+    case "$target" in
+      i[34567]86-*-*)
+       conftest_s="$conftest_s
 foo:   .long   25
        .text
        movl    %gs:0, %eax
@@ -23328,23 +23330,26 @@ foo:  .long   25
        movl    \$foo@tpoff, %eax
        subl    \$foo@tpoff, %eax
        leal    foo@ntpoff(%ecx), %eax"
-    ;;
-  x86_64-*-*)
-    conftest_s='
-       .section ".tdata","awT",@progbits
+       ;;
+      x86_64-*-*)
+       if test x$on_solaris = xyes; then
+         case $gas_flag in
+           yes) tls_as_opt="$tls_as_opt --64" ;;
+           no)  tls_as_opt="$tls_as_opt -xarch=amd64" ;;
+         esac
+       fi
+       conftest_s="$conftest_s
 foo:   .long   25
        .text
        movq    %fs:0, %rax
-       leaq    foo@TLSGD(%rip), %rdi
-       leaq    foo@TLSLD(%rip), %rdi
-       leaq    foo@DTPOFF(%rax), %rdx
-       movq    foo@GOTTPOFF(%rip), %rax
-       movq    $foo@TPOFF, %rax'
-       tls_first_major=2
-       tls_first_minor=14
-       tls_section_flag=T
-       tls_as_opt=--fatal-warnings
-       ;;
+       leaq    foo@tlsgd(%rip), %rdi
+       leaq    foo@tlsld(%rip), %rdi
+       leaq    foo@dtpoff(%rax), %rdx
+       movq    foo@gottpoff(%rip), %rax
+       movq    \$foo@tpoff, %rax"
+        ;;
+    esac
+    ;;
   ia64-*-*)
     conftest_s='
        .section ".tdata","awT",@progbits
index 0336066ccd2ccac200930349bf2808979cd8bfd6..47e85d5deb9830f9b7b6baf48989f3c372fc11a9 100644 (file)
@@ -2954,7 +2954,7 @@ foo:      .long   25
        tls_first_major=2
        tls_first_minor=17
        ;;
-  i[34567]86-*-* | x86_64-*-solaris2.1[0-9]*)
+  i[34567]86-*-* | x86_64-*-*)
     case "$target" in
       i[34567]86-*-solaris2.*)
        on_solaris=yes
@@ -2986,7 +2986,9 @@ changequote(,)dnl
       tls_section_flag=T
       tls_as_opt="--fatal-warnings"
     fi
-    conftest_s="$conftest_s
+    case "$target" in
+      i[34567]86-*-*)
+       conftest_s="$conftest_s
 foo:   .long   25
        .text
        movl    %gs:0, %eax
@@ -3000,23 +3002,26 @@ foo:    .long   25
        movl    \$foo@tpoff, %eax
        subl    \$foo@tpoff, %eax
        leal    foo@ntpoff(%ecx), %eax"
-    ;;
-  x86_64-*-*)
-    conftest_s='
-       .section ".tdata","awT",@progbits
+       ;;
+      x86_64-*-*)
+       if test x$on_solaris = xyes; then
+         case $gas_flag in
+           yes) tls_as_opt="$tls_as_opt --64" ;;
+           no)  tls_as_opt="$tls_as_opt -xarch=amd64" ;;
+         esac    
+       fi
+       conftest_s="$conftest_s
 foo:   .long   25
        .text
        movq    %fs:0, %rax
-       leaq    foo@TLSGD(%rip), %rdi
-       leaq    foo@TLSLD(%rip), %rdi
-       leaq    foo@DTPOFF(%rax), %rdx
-       movq    foo@GOTTPOFF(%rip), %rax
-       movq    $foo@TPOFF, %rax'
-       tls_first_major=2
-       tls_first_minor=14
-       tls_section_flag=T
-       tls_as_opt=--fatal-warnings
-       ;;
+       leaq    foo@tlsgd(%rip), %rdi
+       leaq    foo@tlsld(%rip), %rdi
+       leaq    foo@dtpoff(%rax), %rdx
+       movq    foo@gottpoff(%rip), %rax
+       movq    \$foo@tpoff, %rax"
+        ;;
+    esac
+    ;;
   ia64-*-*)
     conftest_s='
        .section ".tdata","awT",@progbits