1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/sparc/sparc64/elf.
4 AC_DEFINE(HAVE_TLS_SUPPORT)
5 libc_cv_sparc64_tls=yes
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
11 dnl cat > conftest.s <<\EOF
12 dnl .section ".tdata", "awT", @progbits
15 dnl .section ".tbss", "awT", @nobits
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
38 dnl changequote([,])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
43 dnl libc_cv_sparc64_tls=no
46 dnl if test $libc_cv_sparc64_tls = yes; then
47 dnl AC_DEFINE(HAVE_TLS_SUPPORT)
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
60 libc_cv_sparc64_wdisp22=ok
64 if test $libc_cv_sparc64_wdisp22 != ok; then
65 AC_DEFINE(BROKEN_SPARC_WDISP22)