[47/50] suricata: Fix check for level one cache line size

Message ID 20220222125135.1211290-48-michael.tremer@ipfire.org
State Accepted
Commit a7834bcf1091510110262ed8a0eeaad95e803717
Headers
Series [01/50] expat: Update to version 2.4.6 - Security/CVE fixes |

Commit Message

Michael Tremer Feb. 22, 2022, 12:51 p.m. UTC
  riscv64 does not return any value on our machine (maybe because it is
emulated?). "undefined" is however seen as a valid value, which makes
the build fail.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 lfs/suricata                                        |  1 +
 ...5.0.8-fix-level1-cache-line-size-detection.patch | 13 +++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 src/patches/suricata-5.0.8-fix-level1-cache-line-size-detection.patch
  

Patch

diff --git a/lfs/suricata b/lfs/suricata
index a870e3668..65f5e504c 100644
--- a/lfs/suricata
+++ b/lfs/suricata
@@ -72,6 +72,7 @@  $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
 	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/suricata-5.0-stream-tcp-Handle-retransmitted-SYN-with-TSval.patch
 	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/suricata-disable-sid-2210059.patch
+	cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/suricata-5.0.8-fix-level1-cache-line-size-detection.patch
 	cd $(DIR_APP) && LDFLAGS="$(LDFLAGS)" ./configure \
 		--prefix=/usr \
 		--sysconfdir=/etc \
diff --git a/src/patches/suricata-5.0.8-fix-level1-cache-line-size-detection.patch b/src/patches/suricata-5.0.8-fix-level1-cache-line-size-detection.patch
new file mode 100644
index 000000000..a6747a2a7
--- /dev/null
+++ b/src/patches/suricata-5.0.8-fix-level1-cache-line-size-detection.patch
@@ -0,0 +1,13 @@ 
+diff --git a/configure.ac b/configure.ac
+index d56d3a550..81abf8f00 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -2313,7 +2313,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" != "" && test "$CLS" != "0" && test "$CLS" != "undefined"]; then
+             AC_DEFINE_UNQUOTED([CLS],[${CLS}],[L1 cache line size])
+         else
+             AC_DEFINE([CLS],[64],[L1 cache line size])