elf: Add ELF_DYNAMIC_AFTER_RELOC to rewrite PLT
[platform/upstream/glibc.git] / sysdeps / x86_64 / configure.ac
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/x86_64.
3
4 dnl Check if -mprefer-vector-width=128 works.
5 AC_CACHE_CHECK(-mprefer-vector-width=128, libc_cv_cc_mprefer_vector_width, [dnl
6 LIBC_TRY_CC_OPTION([-mprefer-vector-width=128],
7                    [libc_cv_cc_mprefer_vector_width=yes],
8                    [libc_cv_cc_mprefer_vector_width=no])
9 ])
10 LIBC_CONFIG_VAR([config-cflags-mprefer-vector-width],
11                 [$libc_cv_cc_mprefer_vector_width])
12
13 LIBC_LINKER_FEATURE([-z mark-plt], [-Wl,-z,mark-plt],
14                     [libc_cv_z_mark_plt=yes], [libc_cv_z_mark_plt=no])
15 LIBC_CONFIG_VAR([have-z-mark-plt], [$libc_cv_z_mark_plt])
16
17 if test x"$build_mathvec" = xnotset; then
18   build_mathvec=yes
19 fi
20
21 if test $enable_cet != no; then
22   # Check if CET can be enabled.
23   AC_CACHE_CHECK(whether CET can be enabled,
24                  libc_cv_x86_cet_available, [dnl
25 cat > conftest.c <<EOF
26 #if !defined __CET__ || __CET__ != 3
27 # error CET isn't available.
28 #endif
29 EOF
30                  if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS -fcf-protection -include cet.h conftest.c 1>&AS_MESSAGE_LOG_FD); then
31                    libc_cv_x86_cet_available=yes
32                  else
33                    libc_cv_x86_cet_available=no
34                  fi
35                  rm -rf conftest*])
36   if test $libc_cv_x86_cet_available != yes; then
37     AC_MSG_ERROR([$CC doesn't support CET])
38   fi
39 fi
40 if test $enable_cet != no; then
41   # Check if assembler supports CET.
42   AC_CACHE_CHECK(whether assembler supports CET,
43                  libc_cv_x86_cet_as, [dnl
44 cat > conftest.s <<EOF
45         incsspd %ecx
46 EOF
47                  if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s -o conftest.o 1>&AS_MESSAGE_LOG_FD); then
48                    libc_cv_x86_cet_as=yes
49                  else
50                    libc_cv_x86_cet_as=no
51                  fi
52                  rm -rf conftest*])
53   if test $libc_cv_x86_cet_as = no; then
54     AC_MSG_ERROR([$AS doesn't support CET])
55   fi
56 fi
57 if test $enable_cet = yes; then
58   AC_DEFINE(DEFAULT_DL_X86_CET_CONTROL, cet_elf_property)
59 elif test $enable_cet = permissive; then
60   AC_DEFINE(DEFAULT_DL_X86_CET_CONTROL, cet_permissive)
61 fi
62 LIBC_CONFIG_VAR([enable-cet], [$enable_cet])
63
64 test -n "$critic_missing" && AC_MSG_ERROR([
65 *** $critic_missing])