summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2015-05-23 19:50:32 +0000
committerAndreas K. Hüttel <dilfridge@gentoo.org>2015-05-23 19:50:32 +0000
commitd0cfbc2d37ea43b8044fa09dfb7c65b958b6583e (patch)
treef01dcbdcfe4042c19da5c71f45d7ef9d579aa47d /media-libs/opencv
parentIntroduce WPS suite (#547372), based on the work from gentoo-zh overlay. (diff)
downloadgentoo-2-d0cfbc2d37ea43b8044fa09dfb7c65b958b6583e.tar.gz
gentoo-2-d0cfbc2d37ea43b8044fa09dfb7c65b958b6583e.tar.bz2
gentoo-2-d0cfbc2d37ea43b8044fa09dfb7c65b958b6583e.zip
Add build fix for x86, bug 546508
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 0B08240A96F66571)
Diffstat (limited to 'media-libs/opencv')
-rw-r--r--media-libs/opencv/ChangeLog6
-rw-r--r--media-libs/opencv/files/opencv-2.4.10-pic-x86.patch49
-rw-r--r--media-libs/opencv/opencv-2.4.10.ebuild3
3 files changed, 56 insertions, 2 deletions
diff --git a/media-libs/opencv/ChangeLog b/media-libs/opencv/ChangeLog
index 0d97d34ffca7..a9197769fc52 100644
--- a/media-libs/opencv/ChangeLog
+++ b/media-libs/opencv/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for media-libs/opencv
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/opencv/ChangeLog,v 1.123 2015/05/05 08:28:32 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/opencv/ChangeLog,v 1.124 2015/05/23 19:50:32 dilfridge Exp $
+
+ 23 May 2015; Andreas K. Huettel <dilfridge@gentoo.org> opencv-2.4.10.ebuild,
+ +files/opencv-2.4.10-pic-x86.patch:
+ Add build fix for x86, bug 546508
05 May 2015; Jeroen Roovers <jer@gentoo.org> opencv-2.4.9.ebuild,
opencv-2.4.10.ebuild:
diff --git a/media-libs/opencv/files/opencv-2.4.10-pic-x86.patch b/media-libs/opencv/files/opencv-2.4.10-pic-x86.patch
new file mode 100644
index 000000000000..74b75016183b
--- /dev/null
+++ b/media-libs/opencv/files/opencv-2.4.10-pic-x86.patch
@@ -0,0 +1,49 @@
+From ea50be0529c248961e1b66293f8a9e4b807294a6 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <s.martin49@gmail.com>
+Date: Sun, 12 Oct 2014 10:17:23 +0200
+Subject: [PATCH] core: fix x86 PIC code compilation
+
+This bug was triggered by Buildroot autobuilders [1,2], causing this
+kind of failures [3,4]:
+
+ [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o
+ /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp: In function '(static initializers for /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp)':
+ /home/test/autobuild/instance-0/output/build/opencv-2.4.10/modules/core/src/system.cpp:280:10: error: inconsistent operand constraints in an 'asm'
+ make[3]: *** [modules/core/CMakeFiles/opencv_core.dir/src/system.cpp.o] Error 1
+
+[1] http://buildroot.org/
+[2] http://autobuild.buildroot.org/
+[3] http://autobuild.buildroot.org/?reason=opencv-2.4.10
+[4] http://autobuild.buildroot.org/results/483/4838285b25d6293a5cf0bb9eadd5040a7c75d766/build-end.log
+
+Signed-off-by: Samuel Martin <s.martin49@gmail.com>
+---
+ modules/core/src/system.cpp | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/modules/core/src/system.cpp b/modules/core/src/system.cpp
+index 5a970d5..e9ffdc7 100644
+--- a/modules/core/src/system.cpp
++++ b/modules/core/src/system.cpp
+@@ -267,14 +267,17 @@ struct HWFeatures
+ : "cc"
+ );
+ #else
++ // We need to preserve ebx since we are compiling PIC code.
++ // This means we cannot use "=b" for the 2nd output register.
+ asm volatile
+ (
+ "pushl %%ebx\n\t"
+ "movl $7,%%eax\n\t"
+ "movl $0,%%ecx\n\t"
+ "cpuid\n\t"
++ "movl %%ebx,%1\n\t"
+ "popl %%ebx\n\t"
+- : "=a"(cpuid_data[0]), "=b"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
++ : "=a"(cpuid_data[0]), "=r"(cpuid_data[1]), "=c"(cpuid_data[2]), "=d"(cpuid_data[3])
+ :
+ : "cc"
+ );
+--
+2.4.1
+
diff --git a/media-libs/opencv/opencv-2.4.10.ebuild b/media-libs/opencv/opencv-2.4.10.ebuild
index 9bb0a6c447aa..39fc01f2cecf 100644
--- a/media-libs/opencv/opencv-2.4.10.ebuild
+++ b/media-libs/opencv/opencv-2.4.10.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-libs/opencv/opencv-2.4.10.ebuild,v 1.3 2015/05/05 08:28:32 jer Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-libs/opencv/opencv-2.4.10.ebuild,v 1.4 2015/05/23 19:50:32 dilfridge Exp $
EAPI=5
PYTHON_COMPAT=( python2_7 )
@@ -80,6 +80,7 @@ PATCHES=(
"${FILESDIR}/${PN}-2.4.8-javamagic.patch"
"${FILESDIR}/${PN}-2.4.9-libav10.patch"
"${FILESDIR}/${PN}-2.4.9-cuda-pkg-config.patch"
+ "${FILESDIR}/${PN}-2.4.10-pic-x86.patch"
)
pkg_setup() {