[tbb] 62/64: Imported Debian patch 4.3~20150611-1~exp3

Graham Inggs ginggs at moszumanska.debian.org
Mon Jul 3 12:28:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

ginggs pushed a commit to branch master
in repository tbb.

commit e609fa609446996524b1a3f2995e1c02d8af1aae
Author: Steve Capper <steven.capper at gmail.com>
Date:   Fri Jul 3 20:20:34 2015 +0100

    Imported Debian patch 4.3~20150611-1~exp3
---
 debian/changelog                   |  9 +++++++
 debian/control                     |  8 +++---
 debian/patches/atomic-rework.patch | 53 +++++++++++++++++++++++++++++++++++---
 debian/patches/ppc32_atomics.patch | 28 ++++++++++++++++++++
 debian/patches/series              |  1 +
 5 files changed, 92 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 63d26f3..e2f5758 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tbb (4.3~20150611-1~exp3) experimental; urgency=medium
+
+  * Put Mathieu's ppc32 gcc atomic disable patch back in (it shouldn't
+      have been removed).
+  * Switch target architecture to linux-any.
+  * Go full atomic, move all __sync to __atomic.
+
+ -- Steve Capper <steven.capper at gmail.com>  Fri, 03 Jul 2015 20:20:34 +0100
+
 tbb (4.3~20150611-1~exp2) experimental; urgency=medium
 
   * Replace __sync_val_compare_and_swap with __atomic_compare_exchange_n for
diff --git a/debian/control b/debian/control
index 86682cb..2a2aac1 100644
--- a/debian/control
+++ b/debian/control
@@ -8,7 +8,7 @@ Homepage: http://threadingbuildingblocks.org/
 
 Package: libtbb-dev
 Section: libdevel
-Architecture: amd64 arm64 armhf hppa i386 powerpc ppc64el
+Architecture: linux-any
 Depends: libtbb2 (= ${binary:Version}), ${misc:Depends}
 Suggests: tbb-examples, libtbb-doc
 Description: parallelism library for C++ - development files
@@ -24,7 +24,7 @@ Description: parallelism library for C++ - development files
  This package includes the TBB development files.
 
 Package: libtbb2
-Architecture: amd64 arm64 armhf hppa i386 powerpc ppc64el
+Architecture: linux-any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: parallelism library for C++ - runtime files
  TBB is a library that helps you leverage multi-core processor
@@ -40,7 +40,7 @@ Description: parallelism library for C++ - runtime files
 
 Package: libtbb2-dbg
 Section: debug
-Architecture: amd64 arm64 armhf hppa i386 powerpc ppc64el
+Architecture: linux-any
 Depends: libtbb2 (= ${binary:Version}), ${misc:Depends}
 Description: parallelism library for C++ - debugging symbols
  TBB is a library that helps you leverage multi-core processor
@@ -69,7 +69,7 @@ Description: parallelism library for C++ - documentation
 
 Package: tbb-examples
 Section: doc
-Architecture: amd64 arm64 armhf hppa i386 powerpc ppc64el
+Architecture: linux-any
 Depends: ${misc:Depends}
 Recommends: libtbb-dev, libtbb-doc
 Description: parallelism library for C++ - example files
diff --git a/debian/patches/atomic-rework.patch b/debian/patches/atomic-rework.patch
index 539fdb2..267ba18 100644
--- a/debian/patches/atomic-rework.patch
+++ b/debian/patches/atomic-rework.patch
@@ -1,12 +1,23 @@
-Description: Use gcc __atomic instead of __sync for compswp
+Description: Use gcc __atomic instead of __sync
 Author: Original author Mathieu Malaterre <malat at debian.org>
-        Promoted to gcc_generic.h and hacked with by Steve Capper <steven.capper at gmail.com>
+        Promoted to gcc_generic.h and extended by Steve Capper <steven.capper at gmail.com>
 
 Index: tbb-4.3~20150611/include/tbb/machine/gcc_generic.h
 ===================================================================
 --- tbb-4.3~20150611.orig/include/tbb/machine/gcc_generic.h
 +++ tbb-4.3~20150611/include/tbb/machine/gcc_generic.h
-@@ -62,7 +62,11 @@
+@@ -55,18 +55,22 @@
+     fence usages where a more lightweight synchronization means (or none at all)
+     could suffice. Thus if you use this header to enable TBB on a new platform,
+     consider forking it and relaxing below helpers as appropriate. **/
+-#define __TBB_acquire_consistency_helper()  __sync_synchronize()
+-#define __TBB_release_consistency_helper()  __sync_synchronize()
+-#define __TBB_full_memory_fence()           __sync_synchronize()
+-#define __TBB_control_consistency_helper()  __sync_synchronize()
++#define __TBB_acquire_consistency_helper()  __atomic_thread_fence(__ATOMIC_SEQ_CST)
++#define __TBB_release_consistency_helper()  __atomic_thread_fence(__ATOMIC_SEQ_CST)
++#define __TBB_full_memory_fence()           __atomic_thread_fence(__ATOMIC_SEQ_CST)
++#define __TBB_control_consistency_helper()  __atomic_thread_fence(__ATOMIC_SEQ_CST)
  
  #define __TBB_MACHINE_DEFINE_ATOMICS(S,T)                                                         \
  inline T __TBB_machine_cmpswp##S( volatile void *ptr, T value, T comparand ) {                    \
@@ -19,3 +30,39 @@ Index: tbb-4.3~20150611/include/tbb/machine/gcc_generic.h
  }                                                                                                 \
                                                                                                    \
  inline T __TBB_machine_fetchadd##S( volatile void *ptr, T value ) {                               \
+-    return __sync_fetch_and_add(reinterpret_cast<volatile T *>(ptr),value);                       \
++    return __atomic_fetch_add(reinterpret_cast<volatile T *>(ptr), value, __ATOMIC_SEQ_CST);      \
+ }                                                                                                 \
+ 
+ __TBB_MACHINE_DEFINE_ATOMICS(1,int8_t)
+@@ -87,24 +91,25 @@ static inline intptr_t __TBB_machine_lg(
+ }
+ 
+ static inline void __TBB_machine_or( volatile void *ptr, uintptr_t addend ) {
+-    __sync_fetch_and_or(reinterpret_cast<volatile uintptr_t *>(ptr),addend);
++    __atomic_fetch_or(reinterpret_cast<volatile uintptr_t *>(ptr), addend,
++                         __ATOMIC_SEQ_CST);
+ }
+ 
+ static inline void __TBB_machine_and( volatile void *ptr, uintptr_t addend ) {
+-    __sync_fetch_and_and(reinterpret_cast<volatile uintptr_t *>(ptr),addend);
++    __atomic_fetch_and(reinterpret_cast<volatile uintptr_t *>(ptr), addend,
++                         __ATOMIC_SEQ_CST);
+ }
+ 
+-
+ typedef unsigned char __TBB_Flag;
+ 
+ typedef __TBB_atomic __TBB_Flag __TBB_atomic_flag;
+ 
+ inline bool __TBB_machine_try_lock_byte( __TBB_atomic_flag &flag ) {
+-    return __sync_lock_test_and_set(&flag,1)==0;
++    return !__atomic_test_and_set(&flag, __ATOMIC_ACQUIRE);
+ }
+ 
+ inline void __TBB_machine_unlock_byte( __TBB_atomic_flag &flag ) {
+-    __sync_lock_release(&flag);
++    __atomic_clear(&flag, __ATOMIC_RELEASE);
+ }
+ 
+ // Machine specific atomic operations
diff --git a/debian/patches/ppc32_atomics.patch b/debian/patches/ppc32_atomics.patch
new file mode 100644
index 0000000..41e5aab
--- /dev/null
+++ b/debian/patches/ppc32_atomics.patch
@@ -0,0 +1,28 @@
+Description: Make the test suite compile on ppc32
+ where atomics implementation are missing
+ The code simply check ppc32 vs ppc64, the macros are defined on gcc 4.9.1
+Author: Mathieu Malaterre <malat at debian.org>
+Bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63368
+Bug-Debian: http://bugs.debian.org/762656
+
+Index: tbb-4.3~20150611/include/tbb/tbb_config.h
+===================================================================
+--- tbb-4.3~20150611.orig/include/tbb/tbb_config.h
++++ tbb-4.3~20150611/include/tbb/tbb_config.h
+@@ -268,7 +268,16 @@
+ /* TODO: change the version back to 4.1.2 once macro __TBB_WORD_SIZE become optional */
+ #if __TBB_GCC_VERSION >= 40306 || __INTEL_COMPILER >= 1200
+     /** built-in atomics available in GCC since 4.1.2 **/
++#if __PPC__ 
++#if __PPC64__ 
+     #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
++#else
++    // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63368
++    #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 0
++#endif
++#else
++    #define __TBB_GCC_BUILTIN_ATOMICS_PRESENT 1
++#endif
+ #endif
+ 
+ #if __INTEL_COMPILER >= 1200
diff --git a/debian/patches/series b/debian/patches/series
index 07acd07..d05c4a3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,4 +4,5 @@ failonbadtests.patch
 buildi386.patch
 linuxreleasedetect.patch
 tally-unit-test-fails.patch
+ppc32_atomics.patch
 atomic-rework.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/tbb.git



More information about the debian-science-commits mailing list