[packages/OpenImageIO] - more upstream fixes

arekm arekm at pld-linux.org
Wed Nov 6 09:09:16 CET 2013


commit 11a6b19587a8300a9405c8c1e9c5980963d8e027
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Wed Nov 6 09:09:13 2013 +0100

    - more upstream fixes

 0004-Fix_FTBFS_on_atomic_operations.patch | 48 -------------------
 OpenImageIO-build.patch                   | 78 +++++++++++++++++++++++++++++--
 OpenImageIO.spec                          |  2 -
 3 files changed, 75 insertions(+), 53 deletions(-)
---
diff --git a/OpenImageIO.spec b/OpenImageIO.spec
index e4e23d4..40e9d50 100644
--- a/OpenImageIO.spec
+++ b/OpenImageIO.spec
@@ -29,7 +29,6 @@ Patch6:		%{name}-system-libcineon.patch
 Patch7:		%{name}-werror.patch
 Patch8:		0002-Fix_IlmBase_issue.patch
 Patch9:		0003-Fix_multiarch_paths.patch
-Patch10:	0004-Fix_FTBFS_on_atomic_operations.patch
 URL:		https://sites.google.com/site/openimageio/home
 BuildRequires:	Field3D-devel
 %{?with_ocio:BuildRequires:	OpenColorIO-devel}
@@ -311,7 +310,6 @@ Wiązanie Pythona do biblioteki OpenImageIO.
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
-%patch10 -p1
 
 %{__rm} -r src/dds.imageio/squish src/ptex.imageio/ptex
 # when using system pugixml, don't use hacked headers
diff --git a/0004-Fix_FTBFS_on_atomic_operations.patch b/0004-Fix_FTBFS_on_atomic_operations.patch
deleted file mode 100644
index 9831d71..0000000
--- a/0004-Fix_FTBFS_on_atomic_operations.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Roland Stigge <stigge at antcom.de>
-Date: Tue, 21 May 2013 15:09:00 +0200
-Subject: Fix_FTBFS_on_atomic_operations
-
----
- src/include/thread.h | 8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
-diff --git a/src/include/thread.h b/src/include/thread.h
-index e389ebb..4735796 100644
---- a/src/include/thread.h
-+++ b/src/include/thread.h
-@@ -220,7 +220,7 @@ inline int
- atomic_exchange_and_add (volatile int *at, int x)
- {
- #ifdef USE_GCC_ATOMICS
--    return __sync_fetch_and_add ((int *)at, x);
-+    return __atomic_fetch_add ((int *)at, x, __ATOMIC_SEQ_CST);
- #elif USE_TBB
-     atomic<int> *a = (atomic<int> *)at;
-     return a->fetch_and_add (x);
-@@ -238,7 +238,7 @@ inline long long
- atomic_exchange_and_add (volatile long long *at, long long x)
- {
- #ifdef USE_GCC_ATOMICS
--    return __sync_fetch_and_add (at, x);
-+    return __atomic_fetch_add (at, x, __ATOMIC_SEQ_CST);
- #elif USE_TBB
-     atomic<long long> *a = (atomic<long long> *)at;
-     return a->fetch_and_add (x);
-@@ -266,7 +266,7 @@ inline bool
- atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
- {
- #ifdef USE_GCC_ATOMICS
--    return __sync_bool_compare_and_swap (at, compareval, newval);
-+    return __atomic_compare_exchange_n (at, &compareval, newval, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
- #elif USE_TBB
-     atomic<int> *a = (atomic<int> *)at;
-     return a->compare_and_swap (newval, compareval) == newval;
-@@ -283,7 +283,7 @@ inline bool
- atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
- {
- #ifdef USE_GCC_ATOMICS
--    return __sync_bool_compare_and_swap (at, compareval, newval);
-+    return __atomic_compare_exchange_n (at, &compareval, newval, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
- #elif USE_TBB
-     atomic<long long> *a = (atomic<long long> *)at;
-     return a->compare_and_swap (newval, compareval) == newval;
diff --git a/OpenImageIO-build.patch b/OpenImageIO-build.patch
index 9ae91ac..2b72b1b 100644
--- a/OpenImageIO-build.patch
+++ b/OpenImageIO-build.patch
@@ -7,9 +7,21 @@
      include_directories (${FIELD3D_INCLUDES})
      add_oiio_plugin (field3dinput.cpp field3doutput.cpp
                       LINK_LIBRARIES ${FIELD3D_LIBRARY}
---- OpenImageIO-oiio-bcdad81/src/include/thread.h~	2013-11-01 18:03:46.000000000 +0100
-+++ OpenImageIO-oiio-bcdad81/src/include/thread.h	2013-11-06 06:22:43.859550166 +0100
-@@ -128,6 +128,7 @@
+
+From 77fd2276e12791dc17cb20526cd371d66140e416 Mon Sep 17 00:00:00 2001
+From: Larry Gritz <lg at larrygritz.com>
+Date: Tue, 5 Nov 2013 16:05:43 -0800
+Subject: [PATCH] Make cleaner threads.h compile for the NOTHREADS case
+
+---
+ src/include/thread.h | 27 ++++++++++++++++++++++-----
+ 1 file changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/src/include/thread.h b/src/include/thread.h
+index e389ebb..ecf3e66 100644
+--- a/src/include/thread.h
++++ b/src/include/thread.h
+@@ -128,6 +128,7 @@ class null_mutex {
      void unlock () { }
      void lock_shared () { }
      void unlock_shared () { }
@@ -17,3 +29,63 @@
  };
  
  /// Null lock that can be substituted for a real one to test how much
+@@ -219,7 +220,9 @@ class thread_specific_ptr {
+ inline int
+ atomic_exchange_and_add (volatile int *at, int x)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++    int r = *at;  *at += x;  return r;
++#elif defined(USE_GCC_ATOMICS)
+     return __sync_fetch_and_add ((int *)at, x);
+ #elif USE_TBB
+     atomic<int> *a = (atomic<int> *)at;
+@@ -237,7 +240,9 @@ class thread_specific_ptr {
+ inline long long
+ atomic_exchange_and_add (volatile long long *at, long long x)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++    long long r = *at;  *at += x;  return r;
++#elif defined(USE_GCC_ATOMICS)
+     return __sync_fetch_and_add (at, x);
+ #elif USE_TBB
+     atomic<long long> *a = (atomic<long long> *)at;
+@@ -261,11 +266,17 @@ class thread_specific_ptr {
+ ///        *at = newval;  return true;
+ ///    } else {
+ ///        return false;
+-///
++///    }
+ inline bool
+ atomic_compare_and_exchange (volatile int *at, int compareval, int newval)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++    if (*at == compareval) {
++        *at = newval;  return true;
++    } else {
++        return false;
++    }
++#elif defined(USE_GCC_ATOMICS)
+     return __sync_bool_compare_and_swap (at, compareval, newval);
+ #elif USE_TBB
+     atomic<int> *a = (atomic<int> *)at;
+@@ -282,7 +293,13 @@ class thread_specific_ptr {
+ inline bool
+ atomic_compare_and_exchange (volatile long long *at, long long compareval, long long newval)
+ {
+-#ifdef USE_GCC_ATOMICS
++#ifdef NOTHREADS
++    if (*at == compareval) {
++        *at = newval;  return true;
++    } else {
++        return false;
++    }
++#elif defined(USE_GCC_ATOMICS)
+     return __sync_bool_compare_and_swap (at, compareval, newval);
+ #elif USE_TBB
+     atomic<long long> *a = (atomic<long long> *)at;
+-- 
+1.8.4
+
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/OpenImageIO.git/commitdiff/11a6b19587a8300a9405c8c1e9c5980963d8e027



More information about the pld-cvs-commit mailing list