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}
10 printf %s "(cached) " >&6
12 cat > conftest.c <<EOF
13 #if !defined __CET__ || __CET__ != 3
14 # error CET isn't available.
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
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
25 libc_cv_x86_cet_available=no
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
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}
41 printf %s "(cached) " >&6
43 cat > conftest.s <<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
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
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
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}
79 printf %s "(cached) " >&6
81 cat > conftest1.S <<EOF
87 .section ".note.gnu.property", "a"
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. */
97 /* GNU_PROPERTY_X86_ISA_1_NEEDED */
98 .long 0xc0008002 /* pr_type. */
99 .long 3f - 2f /* pr_datasz. */
106 cat > conftest2.S <<EOF
112 .section ".note.gnu.property", "a"
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. */
122 /* GNU_PROPERTY_X86_ISA_1_NEEDED */
123 .long 0xc0008002 /* pr_type. */
124 .long 3f - 2f /* pr_datasz. */
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
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
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}
154 printf %s "(cached) " >&6
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
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
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
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}
176 printf %s "(cached) " >&6
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
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
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
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