From 655a10b28950385e9e2985056db1fc521632dee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=8B=87?= Date: Wed, 4 Aug 2021 17:39:48 +0800 Subject: [PATCH] fix failure caused by GCC upgrade to GCC-10 [why] set default value when ${GNUCC_ARCH} is NULL --- Fix-hyperscan-gcc10.patch | 19 +++++++++++++++++++ hyperscan.spec | 6 +++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 Fix-hyperscan-gcc10.patch diff --git a/Fix-hyperscan-gcc10.patch b/Fix-hyperscan-gcc10.patch new file mode 100644 index 0000000..0e23997 --- /dev/null +++ b/Fix-hyperscan-gcc10.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ef09142..3eb6d73 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -194,8 +194,12 @@ else() + string(REGEX REPLACE ".*march=[ \t]*([^ \n]*)[ \n].*" "\\1" + GNUCC_ARCH "${_GCC_OUTPUT}") + +- # test the parsed flag +- set (EXEC_ARGS ${CC_ARG1} -E - -mtune=${GNUCC_ARCH}) ++ # test the parsed flag ++ if (!GNUCC_ARCH EQUAL NULL) ++ set (EXEC_ARGS ${CC_ARG1} -E - -mtune=${GNUCC_ARCH}) ++ else () ++ set (EXEC_ARGS ${CC_ARG1} -E - -mtune=native) ++ endif() + execute_process(COMMAND ${CMAKE_C_COMPILER} ${EXEC_ARGS} + OUTPUT_QUIET ERROR_QUIET + INPUT_FILE /dev/null diff --git a/hyperscan.spec b/hyperscan.spec index 3a53315..e118dea 100644 --- a/hyperscan.spec +++ b/hyperscan.spec @@ -1,6 +1,6 @@ Name: hyperscan Version: 5.2.1 -Release: 3 +Release: 4 Summary: High-performance regular expression matching library License: BSD @@ -9,6 +9,7 @@ Source0: https://github.com/intel/%{name}/archive/v%{version}.tar.gz#/%{name}-%{ Patch0: hyperscan-aarch64-support.patch Patch1: Fix-build-errot-on-x86_64.patch +Patch2: Fix-hyperscan-gcc10.patch BuildRequires: gcc-c++ BuildRequires: boost-devel @@ -74,6 +75,9 @@ needed for developing Hyperscan applications. %{_includedir}/hs/ %changelog +* Wed Aug 04 2021 wangyong - 5.2.1-4 +- Fix build error caused by GCC upgrade to GCC-10 + * Sat Jul 24 2021 wangyue - 5.2.1-3 - Fix build error on X86