chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / sysdeps / sparc / sparc64 / elf / configure.in
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/sparc/sparc64/elf.
3
4 AC_DEFINE(HAVE_TLS_SUPPORT) 
5 libc_cv_sparc64_tls=yes
6
7 dnl if test "$usetls" != no; then
8 dnl # Check for support of thread-local storage handling in assembler and linker.
9 dnl AC_CACHE_CHECK(for sparc64 TLS support, libc_cv_sparc64_tls, [dnl
10 dnl changequote(,)dnl
11 dnl cat > conftest.s <<\EOF
12 dnl     .section ".tdata", "awT", @progbits
13 dnl     .globl foo
14 dnl foo:        .word   1
15 dnl     .section ".tbss", "awT", @nobits
16 dnl     .globl bar
17 dnl bar:        .skip   4
18 dnl     .text
19 dnl     .globl main
20 dnl main:       sethi   %tgd_hi22(foo), %l1
21 dnl     add     %l1, %tgd_lo10(foo), %l1
22 dnl     add     %l7, %l1, %o0, %tgd_add(foo)
23 dnl     call    __tls_get_addr, %tgd_call(foo)
24 dnl     sethi   %tldm_hi22(bar), %l1
25 dnl     add     %l1, %tldm_lo10(bar), %l1
26 dnl     add     %l7, %l1, %o0, %tldm_add(bar)
27 dnl     call    __tls_get_addr, %tldm_call(bar)
28 dnl     sethi   %tldo_hix22(bar), %l1
29 dnl     xor     %l1, %tldo_lox10(bar), %l1
30 dnl     add     %o0, %l1, %l1, %tldo_add(bar)
31 dnl     sethi   %tie_hi22(foo), %l1
32 dnl     add     %l1, %tie_lo10(foo), %l1
33 dnl     ldx     [%l7 + %l1], %l1, %tie_ldx(foo)
34 dnl     add     %g7, %l1, %l1, %tie_add(foo)
35 dnl     sethi   %tle_hix22(foo), %l1
36 dnl     xor     %l1, %tle_lox10(foo), %l1
37 dnl EOF
38 dnl changequote([,])dnl
39 dnl dnl
40 dnl if AC_TRY_COMMAND(${CC-cc} -o conftest.bin $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
41 dnl   libc_cv_sparc64_tls=yes
42 dnl else
43 dnl   libc_cv_sparc64_tls=no
44 dnl fi
45 dnl rm -f conftest*])
46 dnl if test $libc_cv_sparc64_tls = yes; then
47 dnl   AC_DEFINE(HAVE_TLS_SUPPORT)
48 dnl fi
49 dnl fi
50
51 # Check for broken WDISP22 in the linker.
52 AC_CACHE_CHECK(for sparc64 ld WDISP22 handling, libc_cv_sparc64_wdisp22, [dnl
53 echo 'bne foo; nop' > conftest1.s
54 echo '.globl foo; .hidden foo; foo: nop' > conftest2.s
55 libc_cv_sparc64_wdisp22=unknown
56 if AC_TRY_COMMAND(${CC-cc} -nostdlib -shared $CFLAGS conftest1.s conftest2.s -o conftest.so 1>&AS_MESSAGE_LOG_FD); then
57   if readelf -r conftest.so | grep -q R_SPARC_WDISP22; then
58     libc_cv_sparc64_wdisp22=broken
59   else
60     libc_cv_sparc64_wdisp22=ok
61   fi
62 fi
63 rm -f conftest*])
64 if test $libc_cv_sparc64_wdisp22 != ok; then
65   AC_DEFINE(BROKEN_SPARC_WDISP22)
66 fi