handle undefined LEVEL1_DCACHE_LINESIZE
authorSascha Steinbiss <satta@debian.org>
Tue, 27 Sep 2022 21:24:59 +0000 (22:24 +0100)
committerSascha Steinbiss <satta@debian.org>
Tue, 27 Sep 2022 21:24:59 +0000 (22:24 +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 ddd12dd2146eb9ee61c9eb6e54f7df4364bb22b4..cb452499b0c5daec3b687af09f210de50f811033 100644 (file)
@@ -2405,7 +2405,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])