summaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>2010-03-24 18:49:49 +0000
committerRainer Orth <ro@gcc.gnu.org>2010-03-24 18:49:49 +0000
commitf1c26cad132b285586863242c4bb6b5f551fae41 (patch)
treeef6a9e9fc1a86c9ee173f222db3bc79d9f53eddf /gcc/configure.ac
parentd2af65b9bc0c020a647859b553eac045410d0181 (diff)
downloadgcc-f1c26cad132b285586863242c4bb6b5f551fae41.tar.gz
re PR target/38118 (gcc emits non-TLS data as TLS on Solaris 11/SPARC)
* configure.ac (i[34567]86-*-*): Handle Solaris 2/x86 TLS support and Sun as TLS syntax. (TLS_SECTION_ASM_FLAG) [on_solaris && !gas_flag]: Define. * configure: Regenerate. * config.in: Regenerate. * varasm.c (TLS_SECTION_ASM_FLAG): Define default. (default_elf_asm_named_section): Use it. * config/i386/i386.c (output_pic_addr_const): Lowercase @DTPOFF. (i386_output_dwarf_dtprel): Likewise. (output_addr_const_extra): Likewise. (output_pic_addr_const): Lowercase @GOTTPOFF. (output_addr_const_extra): Likewise. (output_pic_addr_const): Lowercase @GOTNTPOFF. (output_addr_const_extra): Likewise. (output_pic_addr_const): Lowercase @INDNTPOFF. (output_addr_const_extra): Likewise. (output_pic_addr_const): Lowercase @NTPOFF. (output_addr_const_extra): Likewise. (output_pic_addr_const): Lowercase @TPOFF. (output_addr_const_extra): Likewise. * config/i386/i386.md (*tls_global_dynamic_32_gnu): Lowercase @TLSGD. (*tls_global_dynamic_64): Likewise. (*tls_local_dynamic_base_32_gnu): Lowercase @TLSLDM. (*tls_local_dynamic_base_64): Lowercase @TLSLD. * defaults.h (TLS_COMMON_ASM_OP): Provide default. (ASM_OUTPUT_TLS_COMMON): Use it. * config/i386/sol2-gas.h (TLS_COMMON_ASM_OP): Undef. PR target/38118 * config.gcc (sparc*-*-solaris2*) [$gas=yes]: Add usegas.h to tm_file. * config/sparc/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): Move ... * config/sol2.h (ASM_OUTPUT_ALIGNED_COMMON): ... here. * config/i386/sol2-10.h (ASM_OUTPUT_ALIGNED_COMMON): Redefine. * config/i386/sol2.h (TARGET_SUN_TLS): Redefine. From-SVN: r157705
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac63
1 files changed, 46 insertions, 17 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 15ce300dd6d..6eee49b48e3 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to generate a configuration script.
# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -2573,25 +2573,54 @@ foo: .long 25
tls_first_minor=17
;;
i[34567]86-*-*)
- conftest_s='
- .section ".tdata","awT",@progbits
+ case "$target" in
+ i[34567]86-*-solaris2.[56789]*)
+ # TLS was introduced in the Solaris 9 4/04 release but
+ # we do not enable it by default on Solaris 9 either.
+ if test "x$enable_tls" = xyes ; then
+ on_solaris=yes
+ else
+ enable_tls=no;
+ fi
+ ;;
+ i[34567]86-*-solaris2.*)
+ on_solaris=yes
+ ;;
+ *)
+ on_solaris=no
+ ;;
+ esac
+ if test x$on_solaris = xyes && test x$gas_flag = xno; then
+ conftest_s='
+ .section .tdata,"awt",@progbits'
+ tls_first_major=0
+ tls_first_minor=0
+changequote([,])dnl
+ AC_DEFINE(TLS_SECTION_ASM_FLAG, 't',
+[Define to the flag used to mark TLS sections if the default (`T') doesn't work.])
+changequote(,)dnl
+ else
+ conftest_s='
+ .section ".tdata","awT",@progbits'
+ tls_first_major=2
+ tls_first_minor=14
+ tls_as_opt="--fatal-warnings"
+ fi
+ conftest_s="$conftest_s
foo: .long 25
.text
movl %gs:0, %eax
- leal foo@TLSGD(,%ebx,1), %eax
- leal foo@TLSLDM(%ebx), %eax
- leal foo@DTPOFF(%eax), %edx
- movl foo@GOTTPOFF(%ebx), %eax
- subl foo@GOTTPOFF(%ebx), %eax
- addl foo@GOTNTPOFF(%ebx), %eax
- movl foo@INDNTPOFF, %eax
- movl $foo@TPOFF, %eax
- subl $foo@TPOFF, %eax
- leal foo@NTPOFF(%ecx), %eax'
- tls_first_major=2
- tls_first_minor=14
- tls_as_opt=--fatal-warnings
- ;;
+ leal foo@tlsgd(,%ebx,1), %eax
+ leal foo@tlsldm(%ebx), %eax
+ leal foo@dtpoff(%eax), %edx
+ movl foo@gottpoff(%ebx), %eax
+ subl foo@gottpoff(%ebx), %eax
+ addl foo@gotntpoff(%ebx), %eax
+ movl foo@indntpoff, %eax
+ movl \$foo@tpoff, %eax
+ subl \$foo@tpoff, %eax
+ leal foo@ntpoff(%ecx), %eax"
+ ;;
x86_64-*-*)
conftest_s='
.section ".tdata","awT",@progbits