handle undefined LEVEL1_DCACHE_LINESIZE
authorSascha Steinbiss <satta@debian.org>
Wed, 1 Jun 2022 09:33:06 +0000 (10:33 +0100)
committerSascha Steinbiss <satta@debian.org>
Wed, 1 Jun 2022 09:33:06 +0000 (10:33 +0100)
Applied-Upstream: https://github.com/OISF/suricata/pull/7350
Last-Update: 2022-06-01

On some platforms (riscv64, s390x) this value is undefined as returned from getconf.
We also need to handle this to avoid using the string undefined blindly in further
#defines, which would otherwise cause compile errors.

Gbp-Pq: Name LEVEL1_DCACHE_LINESIZE.patch

configure.ac

index 51306c761d84136e4479a4f14cd24f8009bc30e9..e0958b7f924975a6b0abb4afddee04d4fa9d9290 100644 (file)
@@ -2447,7 +2447,7 @@ fi
     AC_PATH_PROG(HAVE_GETCONF_CMD, getconf, "no")
     if test "$HAVE_GETCONF_CMD" != "no"; then
         CLS=$(getconf LEVEL1_DCACHE_LINESIZE)
-        if [test "$CLS" != "" && test "$CLS" != "0"]; then
+        if [test "$CLS" != "undefined" && "$CLS" != "" && test "$CLS" != "0"]; then
             AC_DEFINE_UNQUOTED([CLS],[${CLS}],[L1 cache line size])
         else
             AC_DEFINE([CLS],[64],[L1 cache line size])