2.9
[glibc/nacl-glibc.git] / sysdeps / sparc / sparc32 / elf / configure.in
blobaa75e0bfaae23b4683784f1e9ce693287a393874
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
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 AC_CACHE_CHECK(for sparc32 TLS support, libc_cv_sparc32_tls, [dnl
7 changequote(,)dnl
8 cat > conftest.s <<\EOF
9         .section ".tdata", "awT", @progbits
10         .globl foo
11 foo:    .word   1
12         .section ".tbss", "awT", @nobits
13         .globl bar
14 bar:    .skip   4
15         .text
16 baz:    sethi   %tgd_hi22(foo), %l1
17         add     %l1, %tgd_lo10(foo), %l1
18         add     %l7, %l1, %o0, %tgd_add(foo)
19         call    __tls_get_addr, %tgd_call(foo)
20         sethi   %tldm_hi22(bar), %l1
21         add     %l1, %tldm_lo10(bar), %l1
22         add     %l7, %l1, %o0, %tldm_add(bar)
23         call    __tls_get_addr, %tldm_call(bar)
24         sethi   %tldo_hix22(bar), %l1
25         xor     %l1, %tldo_lox10(bar), %l1
26         add     %o0, %l1, %l1, %tldo_add(bar)
27         sethi   %tie_hi22(foo), %l1
28         add     %l1, %tie_lo10(foo), %l1
29         ld      [%l7 + %l1], %l1, %tie_ld(foo)
30         add     %g7, %l1, %l1, %tie_add(foo)
31         sethi   %tle_hix22(foo), %l1
32         xor     %l1, %tle_lox10(foo), %l1
33 EOF
34 changequote([,])dnl
35 dnl
36 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
37   libc_cv_sparc32_tls=yes
38 else
39   libc_cv_sparc32_tls=no
41 rm -f conftest*])
42 if test $libc_cv_sparc32_tls = yes; then
43   AC_DEFINE(HAVE_TLS_SUPPORT)
47 # Check for broken WDISP22 in the linker.
48 AC_CACHE_CHECK(for sparc32 ld WDISP22 handling, libc_cv_sparc32_wdisp22, [dnl
49 echo 'bne foo; nop' > conftest1.s
50 echo '.globl foo; .hidden foo; foo: nop' > conftest2.s
51 libc_cv_sparc32_wdisp22=unknown
52 if AC_TRY_COMMAND(${CC-cc} -nostdlib -shared $CFLAGS conftest1.s conftest2.s -o conftest.so 1>&AS_MESSAGE_LOG_FD); then
53   if readelf -r conftest.so | grep -q R_SPARC_WDISP22; then
54     libc_cv_sparc32_wdisp22=broken
55   else
56     libc_cv_sparc32_wdisp22=ok
57   fi
59 rm -f conftest*])
60 if test $libc_cv_sparc32_wdisp22 != ok; then
61   AC_DEFINE(BROKEN_SPARC_WDISP22)