riscv: Fix feenvupdate with FE_DFL_ENV (BZ 31022)
[glibc.git] / sysdeps / x86 / configure
bloba2f9a7c2c6447b6f6ab5cda1790c9284073221e4
1 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
2  # Local configure fragment for sysdeps/x86.
4 if test $enable_cet != no; then
5   # Check if CET can be enabled.
6   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether CET can be enabled" >&5
7 printf %s "checking whether CET can be enabled... " >&6; }
8 if test ${libc_cv_x86_cet_available+y}
9 then :
10   printf %s "(cached) " >&6
11 else $as_nop
12   cat > conftest.c <<EOF
13 #if !defined __CET__ || __CET__ != 3
14 # error CET isn't available.
15 #endif
16 EOF
17                  if { ac_try='${CC-cc} -c $CFLAGS -fcf-protection -include cet.h conftest.c 1>&5'
18   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
19   (eval $ac_try) 2>&5
20   ac_status=$?
21   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
22   test $ac_status = 0; }; }; then
23                    libc_cv_x86_cet_available=yes
24                  else
25                    libc_cv_x86_cet_available=no
26                  fi
27                  rm -rf conftest*
29 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_cet_available" >&5
30 printf "%s\n" "$libc_cv_x86_cet_available" >&6; }
31   if test $libc_cv_x86_cet_available != yes; then
32     as_fn_error $? "$CC doesn't support CET" "$LINENO" 5
33   fi
35 if test $enable_cet != no; then
36   # Check if assembler supports CET.
37   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether assembler supports CET" >&5
38 printf %s "checking whether assembler supports CET... " >&6; }
39 if test ${libc_cv_x86_cet_as+y}
40 then :
41   printf %s "(cached) " >&6
42 else $as_nop
43   cat > conftest.s <<EOF
44         incsspd %ecx
45 EOF
46                  if { ac_try='${CC-cc} -c $CFLAGS conftest.s -o conftest.o 1>&5'
47   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
48   (eval $ac_try) 2>&5
49   ac_status=$?
50   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
51   test $ac_status = 0; }; }; then
52                    libc_cv_x86_cet_as=yes
53                  else
54                    libc_cv_x86_cet_as=no
55                  fi
56                  rm -rf conftest*
58 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_cet_as" >&5
59 printf "%s\n" "$libc_cv_x86_cet_as" >&6; }
60   if test $libc_cv_x86_cet_as = no; then
61     as_fn_error $? "$AS doesn't support CET" "$LINENO" 5
62   fi
64 if test $enable_cet = yes; then
65   printf "%s\n" "#define DEFAULT_DL_X86_CET_CONTROL cet_elf_property" >>confdefs.h
67 elif test $enable_cet = permissive; then
68   printf "%s\n" "#define DEFAULT_DL_X86_CET_CONTROL cet_permissive" >>confdefs.h
71 config_vars="$config_vars
72 enable-cet = $enable_cet"
74 # Check if linker supports x86 ISA level.
75 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for linker x86 ISA level support" >&5
76 printf %s "checking for linker x86 ISA level support... " >&6; }
77 if test ${libc_cv_include_x86_isa_level+y}
78 then :
79   printf %s "(cached) " >&6
80 else $as_nop
81   cat > conftest1.S <<EOF
82 #ifdef __LP64__
83 # define P2ALIGN 3
84 #else
85 # define P2ALIGN 2
86 #endif
87         .section ".note.gnu.property", "a"
88         .p2align P2ALIGN
89         .long 1f - 0f           /* name length.  */
90         .long 4f - 1f           /* data length.  */
91         /* NT_GNU_PROPERTY_TYPE_0 */
92         .long 5                 /* note type.  */
94         .asciz "GNU"            /* vendor name.  */
96         .p2align P2ALIGN
97         /* GNU_PROPERTY_X86_ISA_1_NEEDED */
98         .long 0xc0008002        /* pr_type.  */
99         .long 3f - 2f           /* pr_datasz.  */
101         .long 0x1
103         .p2align P2ALIGN
106 cat > conftest2.S <<EOF
107 #ifdef __LP64__
108 # define P2ALIGN 3
109 #else
110 # define P2ALIGN 2
111 #endif
112         .section ".note.gnu.property", "a"
113         .p2align P2ALIGN
114         .long 1f - 0f           /* name length.  */
115         .long 4f - 1f           /* data length.  */
116         /* NT_GNU_PROPERTY_TYPE_0 */
117         .long 5                 /* note type.  */
119         .asciz "GNU"            /* vendor name.  */
121         .p2align P2ALIGN
122         /* GNU_PROPERTY_X86_ISA_1_NEEDED */
123         .long 0xc0008002        /* pr_type.  */
124         .long 3f - 2f           /* pr_datasz.  */
126         .long 0x2
128         .p2align P2ALIGN
131 libc_cv_include_x86_isa_level=no
132 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest conftest1.S conftest2.S'
133   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
134   (eval $ac_try) 2>&5
135   ac_status=$?
136   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
137   test $ac_status = 0; }; }; then
138   count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l`
139   if test "$count" = 1; then
140     libc_cv_include_x86_isa_level=yes
141   fi
143 rm -f conftest*
145 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_include_x86_isa_level" >&5
146 printf "%s\n" "$libc_cv_include_x86_isa_level" >&6; }
147 if test $libc_cv_include_x86_isa_level = yes; then
148   printf "%s\n" "#define INCLUDE_X86_ISA_LEVEL 1" >>confdefs.h
150   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LAHF/SAHF instruction support" >&5
151 printf %s "checking for LAHF/SAHF instruction support... " >&6; }
152 if test ${libc_cv_have_x86_lahf_sahf+y}
153 then :
154   printf %s "(cached) " >&6
155 else $as_nop
156       libc_cv_have_x86_lahf_sahf=no
157     if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null'
158   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
159   (eval $ac_try) 2>&5
160   ac_status=$?
161   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
162   test $ac_status = 0; }; } | grep -qE '(-msahf\b|-march=x86-64-v)'; then
163       libc_cv_have_x86_lahf_sahf=yes
164     fi
166 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_have_x86_lahf_sahf" >&5
167 printf "%s\n" "$libc_cv_have_x86_lahf_sahf" >&6; }
168   if test $libc_cv_have_x86_lahf_sahf = yes; then
169     printf "%s\n" "#define HAVE_X86_LAHF_SAHF 1" >>confdefs.h
171   fi
172   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MOVBE instruction support" >&5
173 printf %s "checking for MOVBE instruction support... " >&6; }
174 if test ${libc_cv_have_x86_movbe+y}
175 then :
176   printf %s "(cached) " >&6
177 else $as_nop
178       libc_cv_have_x86_movbe=no
179     if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null'
180   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
181   (eval $ac_try) 2>&5
182   ac_status=$?
183   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
184   test $ac_status = 0; }; } | grep -qE '(-mmovbe\b|-march=x86-64-v([3-9]|[1-9][0-9]))'; then
185       libc_cv_have_x86_movbe=yes
186     fi
188 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_have_x86_movbe" >&5
189 printf "%s\n" "$libc_cv_have_x86_movbe" >&6; }
190   if test $libc_cv_have_x86_movbe = yes; then
191     printf "%s\n" "#define HAVE_X86_MOVBE 1" >>confdefs.h
193   fi
195 config_vars="$config_vars
196 enable-x86-isa-level = $libc_cv_include_x86_isa_level"
198 printf "%s\n" "#define SUPPORT_STATIC_PIE 1" >>confdefs.h