2.9
[glibc/nacl-glibc.git] / sysdeps / sparc / sparc32 / elf / configure
blobd4f9517959ae324489db621cc05dd196ee5bd3ce
1 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/sparc/sparc32/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 sparc32 TLS support" >&5
7 echo $ECHO_N "checking for sparc32 TLS support... $ECHO_C" >&6
8 if test "${libc_cv_sparc32_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 baz:    sethi   %tgd_hi22(foo), %l1
20         add     %l1, %tgd_lo10(foo), %l1
21         add     %l7, %l1, %o0, %tgd_add(foo)
22         call    __tls_get_addr, %tgd_call(foo)
23         sethi   %tldm_hi22(bar), %l1
24         add     %l1, %tldm_lo10(bar), %l1
25         add     %l7, %l1, %o0, %tldm_add(bar)
26         call    __tls_get_addr, %tldm_call(bar)
27         sethi   %tldo_hix22(bar), %l1
28         xor     %l1, %tldo_lox10(bar), %l1
29         add     %o0, %l1, %l1, %tldo_add(bar)
30         sethi   %tie_hi22(foo), %l1
31         add     %l1, %tie_lo10(foo), %l1
32         ld      [%l7 + %l1], %l1, %tie_ld(foo)
33         add     %g7, %l1, %l1, %tie_add(foo)
34         sethi   %tle_hix22(foo), %l1
35         xor     %l1, %tle_lox10(foo), %l1
36 EOF
37 if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
38   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
39   (eval $ac_try) 2>&5
40   ac_status=$?
41   echo "$as_me:$LINENO: \$? = $ac_status" >&5
42   (exit $ac_status); }; }; then
43   libc_cv_sparc32_tls=yes
44 else
45   libc_cv_sparc32_tls=no
47 rm -f conftest*
49 echo "$as_me:$LINENO: result: $libc_cv_sparc32_tls" >&5
50 echo "${ECHO_T}$libc_cv_sparc32_tls" >&6
51 if test $libc_cv_sparc32_tls = yes; then
52   cat >>confdefs.h <<\_ACEOF
53 #define HAVE_TLS_SUPPORT 1
54 _ACEOF
59 # Check for broken WDISP22 in the linker.
60 echo "$as_me:$LINENO: checking for sparc32 ld WDISP22 handling" >&5
61 echo $ECHO_N "checking for sparc32 ld WDISP22 handling... $ECHO_C" >&6
62 if test "${libc_cv_sparc32_wdisp22+set}" = set; then
63   echo $ECHO_N "(cached) $ECHO_C" >&6
64 else
65   echo 'bne foo; nop' > conftest1.s
66 echo '.globl foo; .hidden foo; foo: nop' > conftest2.s
67 libc_cv_sparc32_wdisp22=unknown
68 if { ac_try='${CC-cc} -nostdlib -shared $CFLAGS conftest1.s conftest2.s -o conftest.so 1>&5'
69   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
70   (eval $ac_try) 2>&5
71   ac_status=$?
72   echo "$as_me:$LINENO: \$? = $ac_status" >&5
73   (exit $ac_status); }; }; then
74   if readelf -r conftest.so | grep -q R_SPARC_WDISP22; then
75     libc_cv_sparc32_wdisp22=broken
76   else
77     libc_cv_sparc32_wdisp22=ok
78   fi
80 rm -f conftest*
82 echo "$as_me:$LINENO: result: $libc_cv_sparc32_wdisp22" >&5
83 echo "${ECHO_T}$libc_cv_sparc32_wdisp22" >&6
84 if test $libc_cv_sparc32_wdisp22 != ok; then
85   cat >>confdefs.h <<\_ACEOF
86 #define BROKEN_SPARC_WDISP22 1
87 _ACEOF