Add AVX support to ld.so auditing for x86-64.
[glibc.git] / sysdeps / x86_64 / elf / configure.in
blob14d18753029ab215ab0e5165dff13f6799192558
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/x86_64/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 x86-64 TLS support, libc_cv_x86_64_tls, [dnl
7 cat > conftest.s <<\EOF
8         .section ".tdata", "awT", @progbits
9         .globl foo
10 foo:    .quad   1
11         .section ".tbss", "awT", @nobits
12         .globl bar
13 bar:    .skip   8
14         .text
15 baz:    leaq    bar@TLSLD(%rip), %rdi
16         leaq    bar@DTPOFF(%rax), %rcx
17         addq    foo@GOTTPOFF(%rip), %rax
18         movq    $bar@TPOFF, %rdx
19 EOF
20 dnl
21 if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
22   libc_cv_x86_64_tls=yes
23 else
24   libc_cv_x86_64_tls=no
26 rm -f conftest*])
27 if test $libc_cv_x86_64_tls = yes; then
28   AC_DEFINE(HAVE_TLS_SUPPORT)
32 dnl It is always possible to access static and hidden symbols in an
33 dnl position independent way.
34 AC_DEFINE(PI_STATIC_AND_HIDDEN)
36 dnl Check if -mavx works.
37 AC_CACHE_CHECK(for AVX support, libc_cv_cc_avx, [dnl
38 if AC_TRY_COMMAND([${CC-cc} -mavx -xc /dev/null -S -o /dev/null]); then
39   libc_cv_cc_avx=yes
40 else
41   libc_cv_cc_avx=no
42 fi])
43 if test $libc_cv_cc_avx = yes; then
44   AC_DEFINE(HAVE_AVX_SUPPORT)