diff options
Diffstat (limited to 'sysdeps/x86/configure')
-rw-r--r-- | sysdeps/x86/configure | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure index 81cc4e8..5e32dc6 100644 --- a/sysdeps/x86/configure +++ b/sysdeps/x86/configure @@ -68,3 +68,82 @@ elif test $enable_cet = permissive; then fi config_vars="$config_vars enable-cet = $enable_cet" + +# Check if linker supports x86 ISA level. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for linker x86 ISA level support" >&5 +$as_echo_n "checking for linker x86 ISA level support... " >&6; } +if ${libc_cv_include_x86_isa_level+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest1.S <<EOF +#ifdef __LP64__ +# define P2ALIGN 3 +#else +# define P2ALIGN 2 +#endif + .section ".note.gnu.property", "a" + .p2align P2ALIGN + .long 1f - 0f /* name length. */ + .long 4f - 1f /* data length. */ + /* NT_GNU_PROPERTY_TYPE_0 */ + .long 5 /* note type. */ +0: + .asciz "GNU" /* vendor name. */ +1: + .p2align P2ALIGN + /* GNU_PROPERTY_X86_ISA_1_NEEDED */ + .long 0xc0008002 /* pr_type. */ + .long 3f - 2f /* pr_datasz. */ +2: + .long 0x1 +3: + .p2align P2ALIGN +4: +EOF +cat > conftest2.S <<EOF +#ifdef __LP64__ +# define P2ALIGN 3 +#else +# define P2ALIGN 2 +#endif + .section ".note.gnu.property", "a" + .p2align P2ALIGN + .long 1f - 0f /* name length. */ + .long 4f - 1f /* data length. */ + /* NT_GNU_PROPERTY_TYPE_0 */ + .long 5 /* note type. */ +0: + .asciz "GNU" /* vendor name. */ +1: + .p2align P2ALIGN + /* GNU_PROPERTY_X86_ISA_1_NEEDED */ + .long 0xc0008002 /* pr_type. */ + .long 3f - 2f /* pr_datasz. */ +2: + .long 0x2 +3: + .p2align P2ALIGN +4: +EOF +libc_cv_include_x86_isa_level=no +if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest conftest1.S conftest2.S' + { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l` + if test "$count" = 1; then + libc_cv_include_x86_isa_level=yes + fi +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_include_x86_isa_level" >&5 +$as_echo "$libc_cv_include_x86_isa_level" >&6; } +if test $libc_cv_include_x86_isa_level = yes; then + $as_echo "#define INCLUDE_X86_ISA_LEVEL 1" >>confdefs.h + +fi +config_vars="$config_vars +enable-x86-isa-level = $libc_cv_include_x86_isa_level" |