chiark / gitweb /
eglibc (2.11.3-4+deb6u3) squeeze-lts; urgency=medium
[eglibc.git] / ports / sysdeps / hppa / elf / configure.in
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/hppa/elf.
3
4 if test "$usetls" != no; then
5 # Check for support of thread-local storage handling in assembler and
6 # linker.
7 AC_CACHE_CHECK(for hppa TLS support, libc_cv_hppa_tls, [dnl
8 cat > conftest.s <<\EOF
9 ; Setup tls data
10 .section ".tdata","awT",@progbits
11 foo:    .data   32 
12         .text
13 ; Test general dyanmic relocations
14 test0:
15         addil   LT'foo-$tls_gdidx$, %r19        
16         ldo     RT'foo-$tls_gdidx$(%r1), %r26
17         b       __tls_get_addr
18         nop
19 ; Test local dynamic relocations
20 test1:
21         addil   LT'foo-$tls_ldidx$, %r19
22         b       __tls_get_addr
23         ldo     RT'foo-$tls_ldidx$(%r1), %r26
24         ldo     RR'foo-$tls_dtpoff$(%r1), %r25
25         ; More variables can be loaded...
26 ; Test initial exec reloctiosn
27 test2:
28         mfctl   %cr27, %r26
29         addil   LT'foo-$tls_ieoff$, %r19
30         ldw     RT'foo-$tls_ieoff$(%r1), %r25
31         add     %r26, %r25, %r24
32 ; Test local exec relocations
33 test3:
34         mfctl   %cr27, %r26
35         addil   LR'foo-$tls_leoff$, %r26 
36         ldo     RR'foo-$tls_leoff$(%r1), %r25
37 ; Done all the TLS tests.
38 EOF
39 dnl
40 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
41   libc_cv_hppa_tls=yes
42 else
43   libc_cv_hppa_tls=no
44 fi
45 rm -f conftest*])
46 if test $libc_cv_hppa_tls = yes; then
47   AC_DEFINE(HAVE_TLS_SUPPORT)
48 fi
49 fi