summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmy Liffey <amynka@gentoo.org>2019-03-31 16:47:51 +0200
committerAmy Liffey <amynka@gentoo.org>2019-03-31 20:52:08 +0200
commit42ffb447e4f3a045a9613c9c8b85f55b9dfbab7e (patch)
tree03e5fe17f644f3a26dbee7b4272ed0528624df51 /media-libs/opencv
parentmail-filter/spamassassin: remove "unused" spamassassin-3.4.2-r5.ebuild. (diff)
downloadgentoo-42ffb447e4f3a045a9613c9c8b85f55b9dfbab7e.tar.gz
gentoo-42ffb447e4f3a045a9613c9c8b85f55b9dfbab7e.tar.bz2
gentoo-42ffb447e4f3a045a9613c9c8b85f55b9dfbab7e.zip
media-libs/opencv: fix build on x86
- Add upstream patch found by kensington to fix build on x86 Closes: https://bugs.gentoo.org/682104 Signed-off-by: Amy Liffey <amynka@gentoo.org> Package-Manager: Portage-2.3.62, Repoman-2.3.11
Diffstat (limited to 'media-libs/opencv')
-rw-r--r--media-libs/opencv/files/opencv-3.4.1-fix-on-x86.patch27
-rw-r--r--media-libs/opencv/opencv-3.4.1-r5.ebuild1
2 files changed, 28 insertions, 0 deletions
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
new file mode 100644
index 000000000000..f36d643cf731
--- /dev/null
+++ b/media-libs/opencv/files/opencv-3.4.1-fix-on-x86.patch
@@ -0,0 +1,27 @@
+From 7dc162cb4252ccf461f1c63650abde3c8807b79c Mon Sep 17 00:00:00 2001
+From: Alexander Alekhin <alexander.alekhin@intel.com>
+Date: Mon, 9 Apr 2018 18:25:51 +0300
+Subject: [PATCH] core: fix mm_pause() for non-SSE i386 builds
+
+replaced to safe binary compatible 'rep; nop' asm instruction
+---
+ modules/core/src/parallel_impl.cpp | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/modules/core/src/parallel_impl.cpp b/modules/core/src/parallel_impl.cpp
+index 78d9eb63694..bc64fce7a81 100644
+--- a/modules/core/src/parallel_impl.cpp
++++ b/modules/core/src/parallel_impl.cpp
+@@ -49,7 +49,11 @@ DECLARE_CV_YIELD
+ DECLARE_CV_PAUSE
+ #endif
+ #ifndef CV_PAUSE
+-#if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
++# if defined __GNUC__ && (defined __i386__ || defined __x86_64__)
++# if !defined(__SSE__)
++ static inline void cv_non_sse_mm_pause() { __asm__ __volatile__ ("rep; nop"); }
++# define _mm_pause cv_non_sse_mm_pause
++# endif
+ # define CV_PAUSE(v) do { for (int __delay = (v); __delay > 0; --__delay) { _mm_pause(); } } while (0)
+ # elif defined __GNUC__ && defined __aarch64__
+ # define CV_PAUSE(v) do { for (int __delay = (v); __delay > 0; --__delay) { asm volatile("yield" ::: "memory"); } } while (0)
diff --git a/media-libs/opencv/opencv-3.4.1-r5.ebuild b/media-libs/opencv/opencv-3.4.1-r5.ebuild
index 092e2a0d7ebc..cb9bc604ea9e 100644
--- a/media-libs/opencv/opencv-3.4.1-r5.ebuild
+++ b/media-libs/opencv/opencv-3.4.1-r5.ebuild
@@ -234,6 +234,7 @@ PATCHES=(
"${FILESDIR}/${P}-remove-git-autodetect.patch"
"${FILESDIR}/${P}-fix-build-with-va.patch" # bug https://bugs.gentoo.org/656576
"${FILESDIR}/${P}-popcnt.patch" # https://bugs.gentoo.org/633900
+ "${FILESDIR}/${P}-fix-on-x86.patch" # https://bugs.gentoo.org/682104
)
pkg_pretend() {