From bc80eef39f493439a48be34b71693a91f6fbdada Mon Sep 17 00:00:00 2001 From: "Chang, Harry" Date: Fri, 23 Aug 2019 10:50:22 +0800 Subject: [PATCH 1/5] Doc changes in "pure negative" logical combination support. --- doc/dev-reference/compilation.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/dev-reference/compilation.rst b/doc/dev-reference/compilation.rst index 5d2c70f7..93290467 100644 --- a/doc/dev-reference/compilation.rst +++ b/doc/dev-reference/compilation.rst @@ -613,8 +613,9 @@ When an expression has the :c:member:`HS_FLAG_COMBINATION` flag set, it ignores all other flags except the :c:member:`HS_FLAG_SINGLEMATCH` flag and the :c:member:`HS_FLAG_QUIET` flag. -Hyperscan will reject logical combination expressions at compile time that -evaluate to *true* when no patterns have matched; for example: :: +Hyperscan will accept logical combination expressions at compile time that +evaluate to *true* when no patterns have matched, and report the match for +combination at end of data if no patterns have matched; for example: :: !101 !101|102 From 52e19cb61c82ab130ffd6f4a6557d7301b2ba595 Mon Sep 17 00:00:00 2001 From: "Wang, Xiang W" Date: Thu, 5 Sep 2019 08:16:08 -0400 Subject: [PATCH 2/5] gcc-9:disable redundant move check for older compiler versions --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3801f994..61057819 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -395,6 +395,12 @@ if (CXX_IGNORED_ATTR) set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-ignored-attributes") endif() +# gcc 9 complains about redundant move for returned variable +CHECK_CXX_COMPILER_FLAG("-Wredundant-move" CXX_REDUNDANT_MOVE) +if (CXX_REDUNDANT_MOVE) + set(EXTRA_CXX_FLAGS "${EXTRA_CXX_FLAGS} -Wno-redundant-move") +endif() + # note this for later # g++ doesn't have this flag but clang does CHECK_CXX_COMPILER_FLAG("-Wweak-vtables" CXX_WEAK_VTABLES) From e811a8dbb8679b048313e0b67bdf5a15dae81f51 Mon Sep 17 00:00:00 2001 From: "Hong, Yang A" Date: Thu, 22 Aug 2019 21:54:54 +0800 Subject: [PATCH 3/5] tools: fix compile issue for RELEASE_BUILD code Fixes github issue #186 --- tools/hsbench/engine_hyperscan.cpp | 21 +++++++++++++++++++++ tools/hscheck/main.cpp | 5 ++--- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/tools/hsbench/engine_hyperscan.cpp b/tools/hsbench/engine_hyperscan.cpp index c1f1e8c4..79c58f77 100644 --- a/tools/hsbench/engine_hyperscan.cpp +++ b/tools/hsbench/engine_hyperscan.cpp @@ -414,6 +414,7 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode, hs_compile_error_t *compile_err; Timer timer; +#ifndef RELEASE_BUILD if (useLiteralApi) { // Pattern length computation should be done before timer start. vector lens(count); @@ -434,6 +435,26 @@ buildEngineHyperscan(const ExpressionMap &expressions, ScanMode scan_mode, grey); timer.complete(); } +#else + if (useLiteralApi) { + // Pattern length computation should be done before timer start. + vector lens(count); + for (unsigned int i = 0; i < count; i++) { + lens[i] = strlen(patterns[i]); + } + timer.start(); + err = hs_compile_lit_multi(patterns.data(), flags.data(), + ids.data(), lens.data(), count, + full_mode, nullptr, &db, &compile_err); + timer.complete(); + } else { + timer.start(); + err = hs_compile_ext_multi(patterns.data(), flags.data(), + ids.data(), ext_ptr.data(), count, + full_mode, nullptr, &db, &compile_err); + timer.complete(); + } +#endif compileSecs = timer.seconds(); peakMemorySize = getPeakHeap(); diff --git a/tools/hscheck/main.cpp b/tools/hscheck/main.cpp index 9cfe73df..197087bb 100644 --- a/tools/hscheck/main.cpp +++ b/tools/hscheck/main.cpp @@ -336,9 +336,8 @@ void checkExpression(UNUSED void *threadarg) { #else if (use_literal_api) { size_t len = strlen(regexp); - err = hs_compile_lit_multi_int(®exp, &flags, nullptr, &extp, - &len, 1, mode, nullptr, &db, - &compile_err, *g_grey); + err = hs_compile_lit_multi(®exp, &flags, nullptr, &len, 1, + mode, nullptr, &db, &compile_err); } else { err = hs_compile_ext_multi(®exp, &flags, nullptr, &extp, 1, mode, nullptr, &db, &compile_err); From c0b9b61e9789ec64bc7d11d4437433aaf0de45c5 Mon Sep 17 00:00:00 2001 From: "Hong, Yang A" Date: Mon, 14 Oct 2019 12:56:01 +0000 Subject: [PATCH 4/5] changelog: updates for 5.2.1 release --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8910bd..ea44debe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ This is a list of notable changes to Hyperscan, in reverse chronological order. +## [5.2.1] 2019-10-13 +- Bugfix for issue #186: fix compile issue when `BUILD_SHARED_LIBS` is on in + release mode. +- Disable redundant move check for older compiler versions. + ## [5.2.0] 2019-07-12 - Literal API: add new API `hs_compile_lit()` and `hs_compile_lit_multi()` to process pure literal rule sets. The 2 literal APIs treat each expression text From a15927a401ab7d39434b30dd9592836b70e53c9f Mon Sep 17 00:00:00 2001 From: "Hong, Yang A" Date: Mon, 14 Oct 2019 13:02:26 +0000 Subject: [PATCH 5/5] Bump version number for release --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 61057819..83197af1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project (hyperscan C CXX) set (HS_MAJOR_VERSION 5) set (HS_MINOR_VERSION 2) -set (HS_PATCH_VERSION 0) +set (HS_PATCH_VERSION 1) set (HS_VERSION ${HS_MAJOR_VERSION}.${HS_MINOR_VERSION}.${HS_PATCH_VERSION}) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)