From fe4e71e4d7e881ec3d08d385f16d9c77fee73bc9 Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Wed, 16 Apr 2014 09:09:42 +0000 Subject: [PATCH] Correctly detect native TLS support with 64-bit gas on Solaris/x86 (PR target/60817) 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 | 9 +++++++++ gcc/configure | 37 +++++++++++++++++++++---------------- gcc/configure.ac | 37 +++++++++++++++++++++---------------- 3 files changed, 51 insertions(+), 32 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1b81ddc..add19b2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2014-04-16 Rainer Orth + + 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 * ipa-devirt.c (referenced_from_vtable_p): New predicate. diff --git a/gcc/configure b/gcc/configure index 415377a..11fb90a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -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 diff --git a/gcc/configure.ac b/gcc/configure.ac index 0336066..47e85d5 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -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 -- 2.7.4