From: Henrik Lindström Date: Sat, 10 May 2025 09:02:05 +0000 (+0200) Subject: x86/configure: Improve portability of isa level check X-Git-Tag: glibc-2.43~588 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c49a32d7eb0466544cce089cd2affab15694dc5a;p=thirdparty%2Fglibc.git x86/configure: Improve portability of isa level check wc -l pads the output with leading spaces on some systems, e.g. FreeBSD. This results in the check `test "$count" = 1` failing. Use -eq for integer comparison instead. Signed-off-by: Henrik Lindström Reviewed-by: Arjun Shankar --- diff --git a/sysdeps/x86/configure b/sysdeps/x86/configure index b8583e266b..a021cdbcf5 100644 --- a/sysdeps/x86/configure +++ b/sysdeps/x86/configure @@ -66,7 +66,7 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest c printf "%s\n" "$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 + if test "$count" -eq 1; then libc_cv_include_x86_isa_level=yes fi fi diff --git a/sysdeps/x86/configure.ac b/sysdeps/x86/configure.ac index 07f62d0616..a87e2f6c41 100644 --- a/sysdeps/x86/configure.ac +++ b/sysdeps/x86/configure.ac @@ -57,7 +57,7 @@ EOF libc_cv_include_x86_isa_level=no if AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -nostartfiles -nostdlib -r -o conftest conftest1.S conftest2.S); then count=`LC_ALL=C $READELF -n conftest | grep NT_GNU_PROPERTY_TYPE_0 | wc -l` - if test "$count" = 1; then + if test "$count" -eq 1; then libc_cv_include_x86_isa_level=yes fi fi