2.9
[glibc/nacl-glibc.git] / sysdeps / sparc / sparc64 / elf / configure
blob46181524c727a81fae65e82e558bc4bc253174d8
1 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/sparc/sparc64/elf.
4 if test "$usetls" != no; then
5 # Check for support of thread-local storage handling in assembler and linker.
6 echo "$as_me:$LINENO: checking for sparc64 TLS support" >&5
7 echo $ECHO_N "checking for sparc64 TLS support... $ECHO_C" >&6
8 if test "${libc_cv_sparc64_tls+set}" = set; then
9   echo $ECHO_N "(cached) $ECHO_C" >&6
10 else
11   cat > conftest.s <<\EOF
12         .section ".tdata", "awT", @progbits
13         .globl foo
14 foo:    .word   1
15         .section ".tbss", "awT", @nobits
16         .globl bar
17 bar:    .skip   4
18         .text
19         .globl main
20 main:   sethi   %tgd_hi22(foo), %l1
21         add     %l1, %tgd_lo10(foo), %l1
22         add     %l7, %l1, %o0, %tgd_add(foo)
23         call    __tls_get_addr, %tgd_call(foo)
24         sethi   %tldm_hi22(bar), %l1
25         add     %l1, %tldm_lo10(bar), %l1
26         add     %l7, %l1, %o0, %tldm_add(bar)
27         call    __tls_get_addr, %tldm_call(bar)
28         sethi   %tldo_hix22(bar), %l1
29         xor     %l1, %tldo_lox10(bar), %l1
30         add     %o0, %l1, %l1, %tldo_add(bar)
31         sethi   %tie_hi22(foo), %l1
32         add     %l1, %tie_lo10(foo), %l1
33         ldx     [%l7 + %l1], %l1, %tie_ldx(foo)
34         add     %g7, %l1, %l1, %tie_add(foo)
35         sethi   %tle_hix22(foo), %l1
36         xor     %l1, %tle_lox10(foo), %l1
37 EOF
38 if { ac_try='${CC-cc} -o conftest.bin $CFLAGS conftest.s 1>&5'
39   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
40   (eval $ac_try) 2>&5
41   ac_status=$?
42   echo "$as_me:$LINENO: \$? = $ac_status" >&5
43   (exit $ac_status); }; }; then
44   libc_cv_sparc64_tls=yes
45 else
46   libc_cv_sparc64_tls=no
48 rm -f conftest*
50 echo "$as_me:$LINENO: result: $libc_cv_sparc64_tls" >&5
51 echo "${ECHO_T}$libc_cv_sparc64_tls" >&6
52 if test $libc_cv_sparc64_tls = yes; then
53   cat >>confdefs.h <<\_ACEOF
54 #define HAVE_TLS_SUPPORT 1
55 _ACEOF
60 # Check for broken WDISP22 in the linker.
61 echo "$as_me:$LINENO: checking for sparc64 ld WDISP22 handling" >&5
62 echo $ECHO_N "checking for sparc64 ld WDISP22 handling... $ECHO_C" >&6
63 if test "${libc_cv_sparc64_wdisp22+set}" = set; then
64   echo $ECHO_N "(cached) $ECHO_C" >&6
65 else
66   echo 'bne foo; nop' > conftest1.s
67 echo '.globl foo; .hidden foo; foo: nop' > conftest2.s
68 libc_cv_sparc64_wdisp22=unknown
69 if { ac_try='${CC-cc} -nostdlib -shared $CFLAGS conftest1.s conftest2.s -o conftest.so 1>&5'
70   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
71   (eval $ac_try) 2>&5
72   ac_status=$?
73   echo "$as_me:$LINENO: \$? = $ac_status" >&5
74   (exit $ac_status); }; }; then
75   if readelf -r conftest.so | grep -q R_SPARC_WDISP22; then
76     libc_cv_sparc64_wdisp22=broken
77   else
78     libc_cv_sparc64_wdisp22=ok
79   fi
81 rm -f conftest*
83 echo "$as_me:$LINENO: result: $libc_cv_sparc64_wdisp22" >&5
84 echo "${ECHO_T}$libc_cv_sparc64_wdisp22" >&6
85 if test $libc_cv_sparc64_wdisp22 != ok; then
86   cat >>confdefs.h <<\_ACEOF
87 #define BROKEN_SPARC_WDISP22 1
88 _ACEOF