Update to lastest bugfix release.

- Upstream patch makes native spinlocks faster than TBB. TBB no longer needed.
This commit is contained in:
Richard M. Shaw 2013-07-01 10:59:06 -05:00
commit d9e76f50bd
2 changed files with 28 additions and 23 deletions

View File

@ -16,6 +16,7 @@ Patch0: oiio-ppc.patch
Patch1: oiio-spinlocks.patch
Patch2: oiio-arm.patch
Patch3: oiio-s390.patch
Patch4: OpenImageIO-ppc.patch
BuildRequires: cmake txt2man
BuildRequires: qt4-devel
@ -81,12 +82,10 @@ Development files for package %{name}
%prep
%setup -q -n oiio-Release-%{version}
%ifarch ppc ppc64
%patch0 -p1 -b .ppc
%endif
%patch1 -p1 -b .spinlocks
%patch2 -p1 -b .arm
%patch3 -p1 -b .s390
%patch4 -p1 -b .ppc
# Install FindTBB.cmake
install %{SOURCE101} src/cmake/modules/
@ -167,6 +166,12 @@ cp -a doc/*.1 %{buildroot}%{_mandir}/man1
- Update to lastest bugfix release.
- Upstream patch makes native spinlocks faster than TBB. TBB no longer needed.
* Mon May 27 2013 Karsten Hopp <karsten@redhat.com> 1.1.10-4
- modify ppc patch for current release
* Fri May 24 2013 Petr Machata <pmachata@redhat.com> - 1.1.10-3
- Rebuild for TBB memory barrier bug
* Mon May 20 2013 Dan Horák <dan[at]danny.cz> - 1.1.10-2
- fix build on s390(x)

View File

@ -1,20 +1,20 @@
diff -up oiio-Release-1.1.3/src/include/thread.h.ppc oiio-Release-1.1.3/src/include/thread.h
--- oiio-Release-1.1.3/src/include/thread.h.ppc 2013-01-10 02:13:37.000000000 +0100
+++ oiio-Release-1.1.3/src/include/thread.h 2013-01-28 15:07:23.190624263 +0100
@@ -98,7 +98,7 @@
diff -up oiio-Release-1.1.10/src/include/thread.h.ppc oiio-Release-1.1.10/src/include/thread.h
--- oiio-Release-1.1.10/src/include/thread.h.ppc 2013-05-27 16:16:38.902025786 +0200
+++ oiio-Release-1.1.10/src/include/thread.h 2013-05-27 17:00:19.856167856 +0200
@@ -112,7 +112,7 @@ InterlockedExchangeAdd64 (volatile long
#endif
#if defined(__GNUC__) && (defined(_GLIBCXX_ATOMIC_BUILTINS) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 401))
-#if !defined(__FreeBSD__) || defined(__x86_64__)
+#if !defined(__FreeBSD__) && !defined(__PPC__) || defined(__x86_64__)
+#if !defined(__FreeBSD__) && !defined(__powerpc__) || defined(__x86_64__)
#define USE_GCC_ATOMICS
#endif
#endif
@@ -224,6 +224,11 @@ atomic_exchange_and_add (volatile int *a
@@ -235,6 +235,11 @@ atomic_exchange_and_add (volatile int *a
#elif defined(_MSC_VER)
// Windows
return _InterlockedExchangeAdd ((volatile LONG *)at, x);
+#elif defined (__PPC__)
+#elif defined (__powerpc__)
+ long long r;
+ r = *at;
+ *at += x;
@ -22,11 +22,11 @@ diff -up oiio-Release-1.1.3/src/include/thread.h.ppc oiio-Release-1.1.3/src/incl
#else
# error No atomics on this platform.
#endif
@@ -249,6 +254,11 @@ atomic_exchange_and_add (volatile long l
@@ -257,6 +262,11 @@ atomic_exchange_and_add (volatile long l
# else
return InterlockedExchangeAdd64 ((volatile LONGLONG *)at, x);
# endif
+#elif defined (__PPC__)
+#elif defined (__powerpc__)
+ long long r;
+ r = *at;
+ *at += x;
@ -34,17 +34,17 @@ diff -up oiio-Release-1.1.3/src/include/thread.h.ppc oiio-Release-1.1.3/src/incl
#else
# error No atomics on this platform.
#endif
@@ -274,6 +284,8 @@ atomic_compare_and_exchange (volatile in
return OSAtomicCompareAndSwap32Barrier (compareval, newval, at);
@@ -280,6 +290,8 @@ atomic_compare_and_exchange (volatile in
return a->compare_and_swap (newval, compareval) == newval;
#elif defined(_MSC_VER)
return (_InterlockedCompareExchange ((volatile LONG *)at, newval, compareval) == compareval);
+#elif defined(__PPC__)
+#elif defined(__powerpc__)
+ return ((*at == compareval) ? (*at = newval), 1 : 0);
#else
# error No atomics on this platform.
#endif
@@ -293,6 +305,8 @@ atomic_compare_and_exchange (volatile lo
return OSAtomicCompareAndSwap64Barrier (compareval, newval, at);
@@ -297,6 +309,8 @@ atomic_compare_and_exchange (volatile lo
return a->compare_and_swap (newval, compareval) == newval;
#elif defined(_MSC_VER)
return (_InterlockedCompareExchange64 ((volatile LONGLONG *)at, newval, compareval) == compareval);
+#elif defined(__PPC__)
@ -52,12 +52,12 @@ diff -up oiio-Release-1.1.3/src/include/thread.h.ppc oiio-Release-1.1.3/src/incl
#else
# error No atomics on this platform.
#endif
@@ -324,7 +338,7 @@ pause (int delay)
@@ -326,7 +340,7 @@ pause (int delay)
{
#if USE_TBB
__TBB_Pause(delay);
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && !defined (__PPC__)
#if defined(__GNUC__)
for (int i = 0; i < delay; ++i) {
-#if defined __arm__ || defined __s390__
+#if defined __arm__ || defined __s390__ || defined __powerpc__
__asm__ __volatile__("NOP;");
#else
__asm__ __volatile__("pause;");
}