changeset 59204:989e9917c462

8244615: build-performance.m4 is not always parsing /proc/cpuinfo correctly Reviewed-by: erikj
author ihse
date Thu, 07 May 2020 17:44:21 +0200
parents 88b19513bd02
children dea6a63e9ab0
files make/autoconf/build-performance.m4
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/autoconf/build-performance.m4	Thu May 07 16:44:48 2020 +0200
+++ b/make/autoconf/build-performance.m4	Thu May 07 17:44:21 2020 +0200
@@ -32,7 +32,12 @@
   if test -f /proc/cpuinfo; then
     # Looks like a Linux (or cygwin) system
     NUM_CORES=`cat /proc/cpuinfo  | grep -c processor`
-    FOUND_CORES=yes
+    if test "$NUM_CORES" -eq "0"; then
+      NUM_CORES=`cat /proc/cpuinfo  | grep -c ^CPU`
+    fi
+    if test "$NUM_CORES" -ne "0"; then
+      FOUND_CORES=yes
+    fi
   elif test -x /usr/sbin/psrinfo; then
     # Looks like a Solaris system
     NUM_CORES=`/usr/sbin/psrinfo -v | grep -c on-line`