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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CET can be enabled" >&5
7 $as_echo_n "checking whether CET can be enabled... " >&6; }
8 if ${libc_cv_x86_cet_available+:} false; then :
9 $as_echo_n "(cached) " >&6
11 cat > conftest.c <<EOF
12 #if !defined __CET__ || __CET__ != 3
13 # error CET isn't available.
16 if { ac_try='${CC-cc} -c $CFLAGS -fcf-protection -include cet.h conftest.c 1>&5'
17 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
20 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
21 test $ac_status = 0; }; }; then
22 libc_cv_x86_cet_available=yes
24 libc_cv_x86_cet_available=no
28 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_cet_available" >&5
29 $as_echo "$libc_cv_x86_cet_available" >&6; }
30 if test $libc_cv_x86_cet_available != yes; then
31 as_fn_error $? "$CC doesn't support CET" "$LINENO" 5
34 if test $enable_cet != no; then
35 # Check if assembler supports CET.
36 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether assembler supports CET" >&5
37 $as_echo_n "checking whether assembler supports CET... " >&6; }
38 if ${libc_cv_x86_cet_as+:} false; then :
39 $as_echo_n "(cached) " >&6
41 cat > conftest.s <<EOF
44 if { ac_try='${CC-cc} -c $CFLAGS conftest.s -o conftest.o 1>&5'
45 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
48 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
49 test $ac_status = 0; }; }; then
50 libc_cv_x86_cet_as=yes
56 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_x86_cet_as" >&5
57 $as_echo "$libc_cv_x86_cet_as" >&6; }
58 if test $libc_cv_x86_cet_as = no; then
59 as_fn_error $? "$AS doesn't support CET" "$LINENO" 5
62 if test $enable_cet = yes; then
63 $as_echo "#define DEFAULT_DL_X86_CET_CONTROL cet_elf_property" >>confdefs.h
65 elif test $enable_cet = permissive; then
66 $as_echo "#define DEFAULT_DL_X86_CET_CONTROL cet_permissive" >>confdefs.h
69 config_vars="$config_vars
70 enable-cet = $enable_cet"
72 # Check if linker supports x86 ISA level.
73 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker x86 ISA level support" >&5
74 $as_echo_n "checking for linker x86 ISA level support... " >&6; }
75 if ${libc_cv_include_x86_isa_level+:} false; then :
76 $as_echo_n "(cached) " >&6
78 cat > conftest1.S <<EOF
84 .section ".note.gnu.property", "a"
86 .long 1f - 0f /* name length. */
87 .long 4f - 1f /* data length. */
88 /* NT_GNU_PROPERTY_TYPE_0 */
89 .long 5 /* note type. */
91 .asciz "GNU" /* vendor name. */
94 /* GNU_PROPERTY_X86_ISA_1_NEEDED */
95 .long 0xc0008002 /* pr_type. */
96 .long 3f - 2f /* pr_datasz. */
103 cat > conftest2.S <<EOF
109 .section ".note.gnu.property", "a"
111 .long 1f - 0f /* name length. */
112 .long 4f - 1f /* data length. */
113 /* NT_GNU_PROPERTY_TYPE_0 */
114 .long 5 /* note type. */
116 .asciz "GNU" /* vendor name. */
119 /* GNU_PROPERTY_X86_ISA_1_NEEDED */
120 .long 0xc0008002 /* pr_type. */
121 .long 3f - 2f /* pr_datasz. */
128 libc_cv_include_x86_isa_level=no
129 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest conftest1.S conftest2.S'
130 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
133 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
134 test $ac_status = 0; }; }; then
135 count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l`
136 if test "$count" = 1; then
137 libc_cv_include_x86_isa_level=yes
142 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_include_x86_isa_level" >&5
143 $as_echo "$libc_cv_include_x86_isa_level" >&6; }
144 if test $libc_cv_include_x86_isa_level = yes; then
145 $as_echo "#define INCLUDE_X86_ISA_LEVEL 1" >>confdefs.h
147 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LAHF/SAHF instruction support" >&5
148 $as_echo_n "checking for LAHF/SAHF instruction support... " >&6; }
149 if ${libc_cv_have_x86_lahf_sahf+:} false; then :
150 $as_echo_n "(cached) " >&6
152 libc_cv_have_x86_lahf_sahf=no
153 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null'
154 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
157 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
158 test $ac_status = 0; }; } | grep -qE '(-msahf\b|-march=x86-64-v)'; then
159 libc_cv_have_x86_lahf_sahf=yes
162 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_have_x86_lahf_sahf" >&5
163 $as_echo "$libc_cv_have_x86_lahf_sahf" >&6; }
164 if test $libc_cv_have_x86_lahf_sahf = yes; then
165 $as_echo "#define HAVE_X86_LAHF_SAHF 1" >>confdefs.h
168 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MOVBE instruction support" >&5
169 $as_echo_n "checking for MOVBE instruction support... " >&6; }
170 if ${libc_cv_have_x86_movbe+:} false; then :
171 $as_echo_n "(cached) " >&6
173 libc_cv_have_x86_movbe=no
174 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fverbose-asm -S -o - -x c /dev/null'
175 { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
178 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
179 test $ac_status = 0; }; } | grep -qE '(-mmovbe\b|-march=x86-64-v([3-9]|[1-9][0-9]))'; then
180 libc_cv_have_x86_movbe=yes
183 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_have_x86_movbe" >&5
184 $as_echo "$libc_cv_have_x86_movbe" >&6; }
185 if test $libc_cv_have_x86_movbe = yes; then
186 $as_echo "#define HAVE_X86_MOVBE 1" >>confdefs.h
190 config_vars="$config_vars
191 enable-x86-isa-level = $libc_cv_include_x86_isa_level"
193 $as_echo "#define SUPPORT_STATIC_PIE 1" >>confdefs.h