###############################################################################
# #
# IPFire.org - A linux based firewall #
-# Copyright (C) 2007-2020 IPFire Team <info@ipfire.org> #
+# Copyright (C) 2007-2021 IPFire Team <info@ipfire.org> #
# #
# This program is free software: you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
include Config
-VER = 5.3.0
+VER = 5.4.0
THISAPP = hyperscan-$(VER)
DL_FILE = $(THISAPP).tar.gz
$(DL_FILE) = $(DL_FROM)/$(DL_FILE)
-$(DL_FILE)_MD5 = 6acab4b242dd81b3cede211d4a9e7101
+$(DL_FILE)_MD5 = 65e08385038c24470a248f6ff2fa379b
install : $(TARGET)
$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
@$(PREBUILD)
@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-fix-cmake-build-system.patch
+ cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-fix-missing-instruction.patch
cd $(DIR_APP) && cmake . \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DBUILD_SHARED_LIBS:BOOL=ON \
--- /dev/null
+From: Robert Haist <rhaist@mailbox.org>
+Date: Tue, 19 Jan 2021 17:00:22 +0100
+Subject: Small upstream fix to the cmake build system
+
+---
+ cmake/build_wrapper.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/build_wrapper.sh b/cmake/build_wrapper.sh
+index 1962813..895610c 100755
+--- a/cmake/build_wrapper.sh
++++ b/cmake/build_wrapper.sh
+@@ -17,7 +17,7 @@ KEEPSYMS=$(mktemp -p /tmp keep.syms.XXXXX)
+ LIBC_SO=$("$@" --print-file-name=libc.so.6)
+ cp ${KEEPSYMS_IN} ${KEEPSYMS}
+ # get all symbols from libc and turn them into patterns
+-nm -f p -g -D ${LIBC_SO} | sed -s 's/\([^ ]*\).*/^\1$/' >> ${KEEPSYMS}
++nm -f p -g -D ${LIBC_SO} | sed -s 's/\([^ @]*\).*/^\1$/' >> ${KEEPSYMS}
+ # build the object
+ "$@"
+ # rename the symbols in the object
--- /dev/null
+From 52a698b0e134f0c29984ecbd0a885744d20812c1 Mon Sep 17 00:00:00 2001
+From: Wang Xiang W <xiang.w.wang@intel.com>
+Date: Tue, 26 Jan 2021 11:43:27 +0000
+Subject: [PATCH] fix missing instruction
+
+---
+ src/util/simd_utils.h | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/src/util/simd_utils.h b/src/util/simd_utils.h
+index d1f060b0..5d5ddaf1 100644
+--- a/src/util/simd_utils.h
++++ b/src/util/simd_utils.h
+@@ -156,6 +156,16 @@ static really_inline u32 movd(const m128 in) {
+ return _mm_cvtsi128_si32(in);
+ }
+
++static really_inline u64a movq(const m128 in) {
++#if defined(ARCH_X86_64)
++ return _mm_cvtsi128_si64(in);
++#else // 32-bit - this is horrific
++ u32 lo = movd(in);
++ u32 hi = movd(_mm_srli_epi64(in, 32));
++ return (u64a)hi << 32 | lo;
++#endif
++}
++
+ #if defined(HAVE_AVX512)
+ static really_inline u32 movd512(const m512 in) {
+ // NOTE: seems gcc doesn't support _mm512_cvtsi512_si32(in),
+@@ -166,20 +176,10 @@ static really_inline u32 movd512(const m512 in) {
+ static really_inline u64a movq512(const m512 in) {
+ // NOTE: seems AVX512 doesn't support _mm512_cvtsi512_si64(in),
+ // so we use 2-step convertions to work around.
+- return _mm_cvtsi128_si64(_mm512_castsi512_si128(in));
++ return movq(_mm512_castsi512_si128(in));
+ }
+ #endif
+
+-static really_inline u64a movq(const m128 in) {
+-#if defined(ARCH_X86_64)
+- return _mm_cvtsi128_si64(in);
+-#else // 32-bit - this is horrific
+- u32 lo = movd(in);
+- u32 hi = movd(_mm_srli_epi64(in, 32));
+- return (u64a)hi << 32 | lo;
+-#endif
+-}
+-
+ /* another form of movq */
+ static really_inline
+ m128 load_m128_from_u64a(const u64a *p) {
+@@ -791,7 +791,7 @@ m128 movdq_lo(m256 x) {
+ #define lshift128_m256(a, count_immed) _mm256_slli_si256(a, count_immed)
+ #define extract64from256(a, imm) _mm_extract_epi64(_mm256_extracti128_si256(a, imm >> 1), imm % 2)
+ #define extract32from256(a, imm) _mm_extract_epi32(_mm256_extracti128_si256(a, imm >> 2), imm % 4)
+-#define extractlow64from256(a) _mm_cvtsi128_si64(cast256to128(a))
++#define extractlow64from256(a) movq(cast256to128(a))
+ #define extractlow32from256(a) movd(cast256to128(a))
+ #define interleave256hi(a, b) _mm256_unpackhi_epi8(a, b)
+ #define interleave256lo(a, b) _mm256_unpacklo_epi8(a, b)