Compare commits

..

No commits in common. "8ccc0db211134fab472e9372d3389b4868a76822" and "04183688ffb2f145b265613ae9805921d72565f6" have entirely different histories.

6 changed files with 10649 additions and 227 deletions

View File

@ -0,0 +1,25 @@
From f92e690190b51eb6bada384174887501f4c3f43f Mon Sep 17 00:00:00 2001
From: wang_yue111 <648774160@qq.com>
Date: Sat, 24 Jul 2021 10:21:03 +0800
Subject: [PATCH] fix build error on X86
---
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
--
2.23.0

BIN
hyperscan-5.4.0.tar.gz Normal file

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
Name: hyperscan Name: hyperscan
Version: 5.4.2 Version: 5.4.0
Release: 2 Release: 1
Summary: High-performance regular expression matching library Summary: High-performance regular expression matching library
License: BSD License: BSD
@ -8,10 +8,8 @@ URL: https://www.hyperscan.io/
Source0: https://github.com/intel/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source0: https://github.com/intel/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: hyperscan-aarch64-support.patch Patch0: hyperscan-aarch64-support.patch
Patch1: Fix-hyperscan-gcc10.patch Patch1: Fix-build-error-on-x86_64.patch
%if "%{?toolchain}" == "clang" Patch2: Fix-hyperscan-gcc10.patch
Patch2: support-clang-build.patch
%endif
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: boost-devel BuildRequires: boost-devel
@ -54,15 +52,7 @@ This package provides the libraries, include files and other resources
needed for developing Hyperscan applications. needed for developing Hyperscan applications.
%prep %prep
%setup -q -n %{name}-%{version} %autosetup -n %{name}-%{version} -p1
cd %{_builddir}/%{name}-%{version}
mv src/util/simd_utils.h src/util/simd_x86.h
sed -i 's/SIMD_UTILS/SIMD_X86/' src/util/simd_x86.h
sed -i 's/_mm_set_epi32/set32x4/' src/util/state_compress.c
sed -i 's/_mm_set_epi64x/set64x2/' src/util/state_compress.c
sed -i 's/_mm_srli_si128/rshiftbyte_m128/' src/util/state_compress.c
cd -
%autopatch -p1
%build %build
%cmake -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_AND_SHARED:BOOL=OFF . %cmake -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_AND_SHARED:BOOL=OFF .
@ -71,9 +61,6 @@ cd -
%install %install
%make_install %make_install
%check
./bin/unit-hyperscan
%files %files
%doc %{_defaultdocdir}/%{name}/examples/README.md %doc %{_defaultdocdir}/%{name}/examples/README.md
%doc %{_defaultdocdir}/%{name}/examples/*.cc %doc %{_defaultdocdir}/%{name}/examples/*.cc
@ -88,21 +75,6 @@ cd -
%{_includedir}/hs/ %{_includedir}/hs/
%changelog %changelog
* Fri Sep 8 2023 luofeng <luofeng13@huawei.com> - 5.4.2-2
- support clang build
* Fri Aug 18 2023 wangqia <wangqia@uniontech.com> - 5.4.2-1
- Update to 5.4.2
* Sat Mar 25 2023 Liu Zixian <liuzixian4@huawei.com> - 5.4.1-1
- Update to 5.4.1
* Tue Mar 21 2023 Liu Zixian <liuzixian4@huawei.com> - 5.4.0-3
- Cleanup aarch64 patch
* Thu Oct 20 2022 Liu Zixian <liuzixian4@huawei.com> - 5.4.0-2
- Sync upstream bugfix and enable regression test
* Wed Oct 06 2021 sdlzx <hdu_sdlzx@163.com> - 5.4.0-1 * Wed Oct 06 2021 sdlzx <hdu_sdlzx@163.com> - 5.4.0-1
- Update to 5.4.0 - Update to 5.4.0

View File

@ -1,111 +0,0 @@
From 34f04fb1e5a0c305463016d99ca47b2ed52ff472 Mon Sep 17 00:00:00 2001
From: luofeng 00425382 <luofeng13@huawei.com>
Date: Sat, 9 Sep 2023 16:55:00 +0800
Subject: [PATCH] support clang build
---
src/util/simd_arm.h | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
diff --git a/src/util/simd_arm.h b/src/util/simd_arm.h
index cce119f..feaf504 100644
--- a/src/util/simd_arm.h
+++ b/src/util/simd_arm.h
@@ -82,6 +82,12 @@ vmvnq_u64(uint64x2_t a) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshadow"
+#define VSHLQ_N_S64(a0, a1) vshlq_n_s64(a0, a1)
+#define VSHRQ_N_U64(a0, a1) vshrq_n_u64(a0, a1)
+#define VEXTQ_S8(a0, a1, a2) vextq_s8(a0, a1, a2)
+#define VGETQ_LANE_S32(a0, a1) vgetq_lane_s32(a0, a1)
+#define VGETQ_LANE_S64(a0, a1) vgetq_lane_s64(a0, a1)
+
static really_inline m128 ones128(void) {
m128 result;
result.vect_s32 = vdupq_n_s32(0xFFFFFFFF);
@@ -130,7 +136,7 @@ static really_inline u32 diffrich64_128(m128 a, m128 b) {
static really_really_inline m128 lshift64_m128(m128 a, unsigned b) {
assert(b <= 63);
m128 result;
- result.vect_s64 = vshlq_n_s64(a.vect_s64, b);
+ result.vect_s64 = VSHLQ_N_S64(a.vect_s64, b);
return result;
}
@@ -140,7 +146,7 @@ static really_really_inline m128 rshift64_m128(m128 a, int imm8) {
return a;
}
m128 result;
- result.vect_u64 = vshrq_n_u64(a.vect_u64, imm8);
+ result.vect_u64 = VSHRQ_N_U64(a.vect_u64, imm8);
return result;
}
@@ -163,7 +169,7 @@ static really_really_inline u32 movemask128(m128 a) {
static really_really_inline m128 rshiftbyte_m128(m128 a, int imm8) {
assert(imm8 >= 0 && imm8 <= 15);
m128 result;
- result.vect_s8 = vextq_s8(a.vect_s8, vdupq_n_s8(0), imm8);
+ result.vect_s8 = VEXTQ_S8(a.vect_s8, vdupq_n_s8(0), imm8);
return result;
}
@@ -173,7 +179,7 @@ static really_really_inline m128 lshiftbyte_m128(m128 a, int imm8) {
if (unlikely(imm8 == 0)) {
return a;
}
- result.vect_s8 = vextq_s8(vdupq_n_s8(0), a.vect_s8, (16 - imm8));
+ result.vect_s8 = VEXTQ_S8(vdupq_n_s8(0), a.vect_s8, (16 - imm8));
return result;
}
@@ -219,13 +225,13 @@ static really_inline m128 load_m128_from_u64a(const u64a *p) {
/*The x86 platform does not perform the lower 2 bit operation.
If the value of imm exceeds 2 bit, a compilation error occurs.*/
static really_inline u32 extract32from128(m128 a, int imm) {
- return vgetq_lane_s32(a.vect_s32, imm & 0x0003);
+ return VGETQ_LANE_S32(a.vect_s32, imm & 0x0003);
}
/*The x86 platform does not perform the lower 1 bit operation.
If the value of imm exceeds 1 bit, a compilation error occurs.*/
static really_inline u64a extract64from128(m128 a, int imm) {
- return vgetq_lane_s64(a.vect_s64, imm & 0x0001);
+ return VGETQ_LANE_S64(a.vect_s64, imm & 0x0001);
}
#define extractlow64from256(a) movq(a.lo)
@@ -234,14 +240,14 @@ static really_inline u64a extract64from128(m128 a, int imm) {
/*The x86 platform does not perform the lower 2 bit operation.
If the value of imm exceeds 2 bit, a compilation error occurs.*/
static really_inline u32 extract32from256(m256 a, int imm) {
- return vgetq_lane_s32((imm >> 2) ? a.hi.vect_s32 : a.lo.vect_s32,
+ return VGETQ_LANE_S32((imm >> 2) ? a.hi.vect_s32 : a.lo.vect_s32,
imm & 0x0003);
}
/*The x86 platform does not perform the lower 1 bit operation.
If the value of imm exceeds 1 bit, a compilation error occurs.*/
static really_inline u64a extract64from256(m256 a, int imm) {
- return vgetq_lane_s64((imm >> 1) ? a.hi.vect_s64 : a.lo.vect_s64,
+ return VGETQ_LANE_S64((imm >> 1) ? a.hi.vect_s64 : a.lo.vect_s64,
imm & 0x0001);
}
@@ -355,9 +361,9 @@ static really_inline m128 palignr(m128 a, m128 b, int count) {
m128 result;
count = count & 0xff;
if (likely(count < 16)) {
- result.vect_s8 = vextq_s8(b.vect_s8, a.vect_s8, count);
+ result.vect_s8 = VEXTQ_S8(b.vect_s8, a.vect_s8, count);
} else if (count < 32) {
- result.vect_s8 = vextq_s8(a.vect_s8, vdupq_n_s8(0x0), count - 16);
+ result.vect_s8 = VEXTQ_S8(a.vect_s8, vdupq_n_s8(0x0), count - 16);
} else {
result.vect_s32 = vdupq_n_s32(0);
}
--
2.28.0.windows.1