Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/openexr/files/
Date: Tue, 01 Aug 2017 12:33:55
Message-Id: 1501590827.7ae1540f67fcd915fb3b5753c7a33a23c8467e09.aballier@gentoo
1 commit: 7ae1540f67fcd915fb3b5753c7a33a23c8467e09
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 1 12:33:36 2017 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 1 12:33:47 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ae1540f
7
8 media-libs/openexr: Update openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch to netbsd one, current one causes build failures on non x86 arches. Bug #626760
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.3
11
12 .../openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch | 60 +++++++++++++---------
13 1 file changed, 36 insertions(+), 24 deletions(-)
14
15 diff --git a/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch b/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch
16 index 4aa7b065a63..1dc13c72407 100644
17 --- a/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch
18 +++ b/media-libs/openexr/files/openexr-2.2.0-fix-cpuid-on-abi_x86_32.patch
19 @@ -1,38 +1,50 @@
20 -diff -Naur a/IlmImf/ImfSystemSpecific.cpp b/IlmImf/ImfSystemSpecific.cpp
21 ---- a/IlmImf/ImfSystemSpecific.cpp 2016-06-14 01:19:15.070511555 +0930
22 -+++ b/IlmImf/ImfSystemSpecific.cpp 2016-06-14 01:36:08.776496862 +0930
23 -@@ -35,6 +35,7 @@
24 - #include "ImfSystemSpecific.h"
25 - #include "ImfNamespace.h"
26 - #include "OpenEXRConfig.h"
27 -+#include <cpuid.h>
28 -
29 - OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER
30 -
31 -@@ -42,19 +43,15 @@
32 - #if defined(IMF_HAVE_SSE2) && defined(__GNUC__)
33 +$NetBSD: patch-IlmImf_ImfSystemSpecific.cpp,v 1.2 2014/08/19 13:34:42 joerg Exp $
34 +
35 +Rework cpuid function to use gnuc __get_cpuid (requiring at least gcc 4.3)
36 +This get's over issues such as encountered with PIC builds.
37 +Upstream issue : https://github.com/openexr/openexr/issues/128
38 +
39 +https://raw.githubusercontent.com/jsonn/pkgsrc/trunk/graphics/openexr/patches/patch-IlmImf_ImfSystemSpecific.cpp
40 +https://github.com/jsonn/pkgsrc/commit/5158af44e65b6d7b9f1a8aca2eb24cb87d003724
41 +https://bugs.gentoo.org/show_bug.cgi?id=626760
42 +
43 +--- a/IlmImf/ImfSystemSpecific.cpp.orig 2014-08-10 04:23:57.000000000 +0000
44 ++++ b/IlmImf/ImfSystemSpecific.cpp
45 +@@ -40,21 +40,30 @@ OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EN
46
47 + namespace {
48 + #if defined(IMF_HAVE_SSE2) && defined(__GNUC__)
49 +-
50 // Helper functions for gcc + SSE enabled
51 - void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
52 -+ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, unsigned int &ecx, unsigned int &edx)
53 ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
54 ++ unsigned int &ecx, unsigned int &edx)
55 {
56 -- __asm__ __volatile__ (
57 -- "cpuid"
58 -- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
59 -- : /* Input */ "a"(n)
60 -- : /* Clobber */);
61 -+ __get_cpuid(n, &eax, &ebx, &ecx, &edx );
62 ++#ifdef __i386__
63 ++ __asm__ __volatile__ (
64 ++ "pushl %%ebx; cpuid; movl %%ebx, %0; popl %%ebx"
65 ++ : /* Output */ "=m"(ebx), "=a"(eax), "=c"(ecx), "=d"(edx)
66 ++ : /* Input */ "a"(n)
67 ++ : /* Clobber */);
68 ++#else
69 + __asm__ __volatile__ (
70 + "cpuid"
71 + : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx)
72 + : /* Input */ "a"(n)
73 + : /* Clobber */);
74 ++#endif
75 }
76
77 #else // IMF_HAVE_SSE2 && __GNUC__
78
79 // Helper functions for generic compiler - all disabled
80 - void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx)
81 -+ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, unsigned int &ecx, unsigned int &edx)
82 ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx,
83 ++ unsigned int &ecx, unsigned int &edx)
84 {
85 eax = ebx = ecx = edx = 0;
86 }
87 -@@ -64,7 +61,7 @@
88 +@@ -64,7 +73,7 @@ namespace {
89
90 #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
91
92 @@ -41,7 +53,7 @@ diff -Naur a/IlmImf/ImfSystemSpecific.cpp b/IlmImf/ImfSystemSpecific.cpp
93 {
94 __asm__ __volatile__ (
95 "xgetbv"
96 -@@ -75,7 +72,7 @@
97 +@@ -75,7 +84,7 @@ namespace {
98
99 #else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
100
101 @@ -50,7 +62,7 @@ diff -Naur a/IlmImf/ImfSystemSpecific.cpp b/IlmImf/ImfSystemSpecific.cpp
102 {
103 eax = edx = 0;
104 }
105 -@@ -94,8 +91,8 @@
106 +@@ -94,8 +103,8 @@ CpuId::CpuId():
107 f16c(false)
108 {
109 bool osxsave = false;