rtld: Add glibc.rtld.enable_secure tunable.
[glibc.git] / sysdeps / x86_64 / configure.ac
blobc714c47351e70390b5cf6de35d12e76ab9d87c2e
1 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
2 # Local configure fragment for sysdeps/x86_64.
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])
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])
17 if test x"$build_mathvec" = xnotset; then
18   build_mathvec=yes
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
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
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)
62 LIBC_CONFIG_VAR([enable-cet], [$enable_cet])
64 # Check if -mamx-tile works properly.
65 AC_CACHE_CHECK(whether -mamx-tile works properly,
66                libc_cv_x86_have_amx_tile, [dnl
67 cat > conftest.c <<EOF
68 #include <x86intrin.h>
69 EOF
70                libc_cv_x86_have_amx_tile=no
71                if AC_TRY_COMMAND(${CC-cc} -E $CFLAGS -mamx-tile conftest.c > conftest.i); then
72                  if grep -q __builtin_ia32_ldtilecfg conftest.i; then
73                    libc_cv_x86_have_amx_tile=yes
74                  fi
75                fi
76                rm -rf conftest*])
77 LIBC_CONFIG_VAR([have-mamx-tile], [$libc_cv_x86_have_amx_tile])
79 test -n "$critic_missing" && AC_MSG_ERROR([
80 *** $critic_missing])