Do not use SSE2 instructions on x86 CPUs without SSE2 support

Fedora < 29 supports i686 without SSE2
<https://fedoraproject.org/wiki/Changes/Update_i686_architectural_baseline_to_include_SSE2>.
This commit is contained in:
Petr Písař 2019-03-26 09:40:43 +01:00
parent adfdca64c3
commit ef87f65d7a
2 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 706a1c624c591e404a7739b49fd33830427ff2af Mon Sep 17 00:00:00 2001
From: zherczeg <zherczeg@6239d852-aaf2-0410-a92c-79f79f948069>
Date: Mon, 25 Mar 2019 14:10:24 +0000
Subject: [PATCH] Disable SSE2 JIT optimizations in x86 CPUs when SSE2 is not
available.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
git-svn-id: svn://vcs.exim.org/pcre2/code/trunk@1082 6239d852-aaf2-0410-a92c-79f79f948069
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
src/pcre2_jit_compile.c | 2 +-
diff --git a/src/pcre2_jit_compile.c b/src/pcre2_jit_compile.c
index 6519b4b..256356c 100644
--- a/src/pcre2_jit_compile.c
+++ b/src/pcre2_jit_compile.c
@@ -6268,7 +6268,7 @@ for (i = 0; i < max; i++)
}
#if (defined SLJIT_CONFIG_X86 && SLJIT_CONFIG_X86) && !(defined SUPPORT_VALGRIND) && !(defined _WIN64)
-if (check_fast_forward_char_pair_sse2(common, chars, max))
+if (sljit_has_cpu_feature(SLJIT_HAS_SSE2) && check_fast_forward_char_pair_sse2(common, chars, max))
return TRUE;
#endif
--
2.20.1

View File

@ -9,7 +9,7 @@
%global rcversion RC1 %global rcversion RC1
Name: pcre2 Name: pcre2
Version: 10.33 Version: 10.33
Release: %{?rcversion:0.}3%{?rcversion:.%rcversion}%{?dist} Release: %{?rcversion:0.}4%{?rcversion:.%rcversion}%{?dist}
%global myversion %{version}%{?rcversion:-%rcversion} %global myversion %{version}%{?rcversion:-%rcversion}
Summary: Perl-compatible regular expression library Summary: Perl-compatible regular expression library
# the library: BSD with exceptions # the library: BSD with exceptions
@ -52,6 +52,9 @@ Patch0: pcre2-10.10-Fix-multilib.patch
# Fix a crash in pcre2_substitute() function if mcontext argument is NULL, # Fix a crash in pcre2_substitute() function if mcontext argument is NULL,
# bug #1686434, upstream bug #2382, in upstream after 10.33-RC1 # bug #1686434, upstream bug #2382, in upstream after 10.33-RC1
Patch1: pcre2-10.33-RC1-Fix-crash-in-pcre2_substitute-with-NULL-match-contex.patch Patch1: pcre2-10.33-RC1-Fix-crash-in-pcre2_substitute-with-NULL-match-contex.patch
# Do not use SSE2 instructions on x86 CPUs without SSE2 support,
# upstream bug #2385, in upstream after 10.33-RC1
Patch2: pcre2-10.33-RC1-Disable-SSE2-JIT-optimizations-in-x86-CPUs-when-SSE2.patch
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: automake BuildRequires: automake
BuildRequires: coreutils BuildRequires: coreutils
@ -129,6 +132,7 @@ Utilities demonstrating PCRE2 capabilities like pcre2grep or pcre2test.
%setup -q -n %{name}-%{myversion} %setup -q -n %{name}-%{myversion}
%patch0 -p1 %patch0 -p1
%patch1 -p1 %patch1 -p1
%patch2 -p1
# Because of multilib patch # Because of multilib patch
libtoolize --copy --force libtoolize --copy --force
autoreconf -vif autoreconf -vif
@ -227,6 +231,10 @@ make %{?_smp_mflags} check VERBOSE=yes
%{_mandir}/man1/pcre2test.* %{_mandir}/man1/pcre2test.*
%changelog %changelog
* Tue Mar 26 2019 Petr Pisar <ppisar@redhat.com> - 10.33-0.4.RC1
- Do not use SSE2 instructions on x86 CPUs without SSE2 support
(upstream bug #2385)
* Wed Mar 13 2019 Petr Pisar <ppisar@redhat.com> - 10.33-0.3.RC1 * Wed Mar 13 2019 Petr Pisar <ppisar@redhat.com> - 10.33-0.3.RC1
- Use upstream fix for a crash in pcre2_substitute() function if mcontext - Use upstream fix for a crash in pcre2_substitute() function if mcontext
argument is NULL (bug #1686434) argument is NULL (bug #1686434)