Date: Friday, October 31, 2014 @ 15:14:35 Author: schiv Revision: 225517
upgpkg: opencv 2.4.10-1 upstream release; also implement FS#41923 Added: opencv/trunk/x86_asmfix.patch Modified: opencv/trunk/PKGBUILD ------------------+ PKGBUILD | 20 ++++++++++++++------ x86_asmfix.patch | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 6 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2014-10-31 13:57:06 UTC (rev 225516) +++ PKGBUILD 2014-10-31 14:14:35 UTC (rev 225517) @@ -4,27 +4,31 @@ pkgbase=opencv pkgname=('opencv' 'opencv-samples') -pkgver=2.4.9 -pkgrel=5 +pkgver=2.4.10 +pkgrel=1 pkgdesc="Open Source Computer Vision Library" arch=('i686' 'x86_64') license=('BSD') url="http://opencv.org/" depends=('intel-tbb' 'openexr' 'xine-lib' 'libdc1394' 'gtkglext') -makedepends=('cmake' 'python2-numpy' 'mesa' 'eigen2') +makedepends=('cmake' 'python2-numpy' 'mesa' 'eigen2' 'vtk') optdepends=('opencv-samples' 'eigen2' 'libcl: For coding with OpenCL' + 'vtk: 3D visualization' 'python2-numpy: Python 2.x interface') source=("http://downloads.sourceforge.net/opencvlibrary/$pkgname-$pkgver.zip" 'pkgconfig.patch' - 'fsh.patch') -md5sums=('7f958389e71c77abdf5efe1da988b80c' + 'fsh.patch' + 'x86_asmfix.patch') +md5sums=('ec63952d3a3dff965d5fdde765926821' 'c7cea48ed7d4f729ebdb9673bac41bd3' - 'c597598d142dd34d0eb4af7d6e9779d8') + 'c597598d142dd34d0eb4af7d6e9779d8' + 'b937d3589a62666f17f6dc93e0109717') _cmakeopts=('-D WITH_OPENCL=ON' '-D WITH_OPENGL=ON' + '-D WITH_VTK=ON' '-D WITH_TBB=ON' '-D WITH_XINE=ON' '-D WITH_GSTREAMER=OFF' @@ -50,6 +54,10 @@ prepare() { cd "$srcdir/$pkgname-$pkgver" + msg2 "Applying backported fix for x86 ASM breakage" + # see https://github.com/Itseez/opencv/pull/3331 + patch -Np1 -i "$srcdir/x86_asmfix.patch" + msg2 "Fixing broken pkg-config (downstream)" # see https://bugs.archlinux.org/task/32430 # and http://code.opencv.org/issues/1925 Added: x86_asmfix.patch =================================================================== --- x86_asmfix.patch (rev 0) +++ x86_asmfix.patch 2014-10-31 14:14:35 UTC (rev 225517) @@ -0,0 +1,46 @@ +From ea50be0529c248961e1b66293f8a9e4b807294a6 Mon Sep 17 00:00:00 2001 +From: Samuel Martin <s.marti...@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.marti...@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" + );