!10 fix failure caused by GCC upgrade to GCC-10

From: @aslfjk
Reviewed-by: @small_leek
Signed-off-by: @small_leek
This commit is contained in:
openeuler-ci-bot 2021-08-05 03:37:24 +00:00 committed by Gitee
commit 4164129016
2 changed files with 24 additions and 1 deletions

19
Fix-hyperscan-gcc10.patch Normal file
View File

@ -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

View File

@ -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 <wangyong187@huawei.com> - 5.2.1-4
- Fix build error caused by GCC upgrade to GCC-10
* Sat Jul 24 2021 wangyue <wangyue92@huawei.com> - 5.2.1-3
- Fix build error on X86