1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/sparc/sparc32/elf.
4 # Check for support of thread-local storage handling in assembler and linker.
5 AC_CACHE_CHECK(for sparc32 TLS support, libc_cv_sparc32_tls, [dnl
7 cat > conftest.s <<\EOF
8 .section ".tdata", "awT", @progbits
11 .section ".tbss", "awT", @nobits
15 baz: sethi %tgd_hi22(foo), %l1
16 add %l1, %tgd_lo10(foo), %l1
17 add %l7, %l1, %o0, %tgd_add(foo)
18 call __tls_get_addr, %tgd_call(foo)
19 sethi %tldm_hi22(bar), %l1
20 add %l1, %tldm_lo10(bar), %l1
21 add %l7, %l1, %o0, %tldm_add(bar)
22 call __tls_get_addr, %tldm_call(bar)
23 sethi %tldo_hix22(bar), %l1
24 xor %l1, %tldo_lox10(bar), %l1
25 add %o0, %l1, %l1, %tldo_add(bar)
26 sethi %tie_hi22(foo), %l1
27 add %l1, %tie_lo10(foo), %l1
28 ld [%l7 + %l1], %l1, %tie_ld(foo)
29 add %g7, %l1, %l1, %tie_add(foo)
30 sethi %tle_hix22(foo), %l1
31 xor %l1, %tle_lox10(foo), %l1
35 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
36 libc_cv_sparc32_tls=yes
38 libc_cv_sparc32_tls=no
41 if test $libc_cv_sparc32_tls = no; then
42 AC_MSG_ERROR([the assembler must support TLS])
45 # Check for broken WDISP22 in the linker.
46 AC_CACHE_CHECK(for sparc32 ld WDISP22 handling, libc_cv_sparc32_wdisp22, [dnl
47 echo 'bne foo; nop' > conftest1.s
48 echo '.globl foo; .hidden foo; foo: nop' > conftest2.s
49 libc_cv_sparc32_wdisp22=unknown
50 if AC_TRY_COMMAND(${CC-cc} -nostdlib -shared $CFLAGS conftest1.s conftest2.s -o conftest.so 1>&AS_MESSAGE_LOG_FD); then
51 if readelf -r conftest.so | grep -q R_SPARC_WDISP22; then
52 libc_cv_sparc32_wdisp22=broken
54 libc_cv_sparc32_wdisp22=ok
58 if test $libc_cv_sparc32_wdisp22 != ok; then
59 AC_DEFINE(BROKEN_SPARC_WDISP22)