]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
x86/configure: Improve portability of isa level check
authorHenrik Lindström <henrik@lxm.se>
Sat, 10 May 2025 09:02:05 +0000 (11:02 +0200)
committerArjun Shankar <arjun@redhat.com>
Wed, 27 Aug 2025 15:14:15 +0000 (17:14 +0200)
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 <henrik@lxm.se>
Reviewed-by: Arjun Shankar <arjun@redhat.com>
sysdeps/x86/configure
sysdeps/x86/configure.ac

index b8583e266be0ebfd47520d3e86d04c3bdbdb9794..a021cdbcf500b5994eb25c7de1dee5ae9ce466fc 100644 (file)
@@ -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
index 07f62d0616bbc8aaf25333996c0efcca6db3fb59..a87e2f6c41048c4753a713e41dc38eb508697073 100644 (file)
@@ -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