1 |
commit: 42ffb447e4f3a045a9613c9c8b85f55b9dfbab7e |
2 |
Author: Amy Liffey <amynka <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Mar 31 14:47:51 2019 +0000 |
4 |
Commit: Amy Liffey <amynka <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Mar 31 18:52:08 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=42ffb447 |
7 |
|
8 |
media-libs/opencv: fix build on x86 |
9 |
|
10 |
- Add upstream patch found by kensington to fix build on x86 |
11 |
|
12 |
Closes: https://bugs.gentoo.org/682104 |
13 |
Signed-off-by: Amy Liffey <amynka <AT> gentoo.org> |
14 |
Package-Manager: Portage-2.3.62, Repoman-2.3.11 |
15 |
|
16 |
.../opencv/files/opencv-3.4.1-fix-on-x86.patch | 27 ++++++++++++++++++++++ |
17 |
media-libs/opencv/opencv-3.4.1-r5.ebuild | 1 + |
18 |
2 files changed, 28 insertions(+) |
19 |
|
20 |
diff --git a/media-libs/opencv/files/opencv-3.4.1-fix-on-x86.patch b/media-libs/opencv/files/opencv-3.4.1-fix-on-x86.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..f36d643cf73 |
23 |
--- /dev/null |
24 |
+++ b/media-libs/opencv/files/opencv-3.4.1-fix-on-x86.patch |
25 |
@@ -0,0 +1,27 @@ |
26 |
+From 7dc162cb4252ccf461f1c63650abde3c8807b79c Mon Sep 17 00:00:00 2001 |
27 |
+From: Alexander Alekhin <alexander.alekhin@×××××.com> |
28 |
+Date: Mon, 9 Apr 2018 18:25:51 +0300 |
29 |
+Subject: [PATCH] core: fix mm_pause() for non-SSE i386 builds |
30 |
+ |
31 |
+replaced to safe binary compatible 'rep; nop' asm instruction |
32 |
+--- |
33 |
+ modules/core/src/parallel_impl.cpp | 6 +++++- |
34 |
+ 1 file changed, 5 insertions(+), 1 deletion(-) |
35 |
+ |
36 |
+diff --git a/modules/core/src/parallel_impl.cpp b/modules/core/src/parallel_impl.cpp |
37 |
+index 78d9eb63694..bc64fce7a81 100644 |
38 |
+--- a/modules/core/src/parallel_impl.cpp |
39 |
++++ b/modules/core/src/parallel_impl.cpp |
40 |
+@@ -49,7 +49,11 @@ DECLARE_CV_YIELD |
41 |
+ DECLARE_CV_PAUSE |
42 |
+ #endif |
43 |
+ #ifndef CV_PAUSE |
44 |
+-#if defined __GNUC__ && (defined __i386__ || defined __x86_64__) |
45 |
++# if defined __GNUC__ && (defined __i386__ || defined __x86_64__) |
46 |
++# if !defined(__SSE__) |
47 |
++ static inline void cv_non_sse_mm_pause() { __asm__ __volatile__ ("rep; nop"); } |
48 |
++# define _mm_pause cv_non_sse_mm_pause |
49 |
++# endif |
50 |
+ # define CV_PAUSE(v) do { for (int __delay = (v); __delay > 0; --__delay) { _mm_pause(); } } while (0) |
51 |
+ # elif defined __GNUC__ && defined __aarch64__ |
52 |
+ # define CV_PAUSE(v) do { for (int __delay = (v); __delay > 0; --__delay) { asm volatile("yield" ::: "memory"); } } while (0) |
53 |
|
54 |
diff --git a/media-libs/opencv/opencv-3.4.1-r5.ebuild b/media-libs/opencv/opencv-3.4.1-r5.ebuild |
55 |
index 092e2a0d7eb..cb9bc604ea9 100644 |
56 |
--- a/media-libs/opencv/opencv-3.4.1-r5.ebuild |
57 |
+++ b/media-libs/opencv/opencv-3.4.1-r5.ebuild |
58 |
@@ -234,6 +234,7 @@ PATCHES=( |
59 |
"${FILESDIR}/${P}-remove-git-autodetect.patch" |
60 |
"${FILESDIR}/${P}-fix-build-with-va.patch" # bug https://bugs.gentoo.org/656576 |
61 |
"${FILESDIR}/${P}-popcnt.patch" # https://bugs.gentoo.org/633900 |
62 |
+ "${FILESDIR}/${P}-fix-on-x86.patch" # https://bugs.gentoo.org/682104 |
63 |
) |
64 |
|
65 |
pkg_pretend() { |