debian/patches/support_other_cpus (new; committed upstream too):
authorAaron M. Ucko <ucko@debian.org>
Thu, 9 Jun 2011 00:35:24 +0000 (00:35 +0000)
committerAaron M. Ucko <ucko@debian.org>
Thu, 9 Jun 2011 00:35:24 +0000 (00:35 +0000)
build correctly on architectures that wound up defining
NCBI_SLOW_ATOMIC_SWAP (spuriously in the case of powerpc,
whose detection the patch fixes as well).  [Also for #629656.]

debian/changelog
debian/patches/series
debian/patches/support_other_cpus [new file with mode: 0644]

index 786e33c96ae26d5a701e445148780bd9e841f1c0..dd9903624a2caaa8ba026326804f7c650732f4ec 100644 (file)
@@ -5,8 +5,12 @@ ncbi-blast+ (2.2.25-2) UNRELEASED; urgency=low
   * Fix several sources of build failures (per #629656):
     - debian/rules (override_dh_install): Correctly support building only
       architecture-dependent packages.
+    - debian/patches/support_other_cpus (new; committed upstream too):
+      build correctly on architectures that wound up defining
+      NCBI_SLOW_ATOMIC_SWAP (spuriously in the case of powerpc,
+      whose detection the patch fixes as well).
 
- -- Aaron M. Ucko <ucko@debian.org>  Wed, 08 Jun 2011 20:20:13 -0400
+ -- Aaron M. Ucko <ucko@debian.org>  Wed, 08 Jun 2011 20:35:16 -0400
 
 ncbi-blast+ (2.2.25-1) unstable; urgency=low
 
index 81229f6f4cdcf912039d58ce0939cedf938514aa..d6446b159aec5a5f8a7cd7b0475494230952f5e5 100644 (file)
@@ -1,3 +1,4 @@
 legacy_rename_rpsblast
 fix_checks
 fix_gcc46_errors
+support_other_cpus
diff --git a/debian/patches/support_other_cpus b/debian/patches/support_other_cpus
new file mode 100644 (file)
index 0000000..c84224c
--- /dev/null
@@ -0,0 +1,66 @@
+Index: b/c++/include/corelib/impl/ncbi_atomic_defs.h
+===================================================================
+--- a/c++/include/corelib/impl/ncbi_atomic_defs.h      2011-06-08 20:26:07.000000000 -0400
++++ b/c++/include/corelib/impl/ncbi_atomic_defs.h      2011-06-08 20:29:25.000000000 -0400
+@@ -259,7 +259,7 @@
+ #  endif
+ #endif
+-#if !defined(NCBI_SWAP_POINTERS)  &&  !defined(NCBI_SWAP_POINTERS_CONDITIONALLY)  &&  !defined(NCBI_NO_THREADS)  &&  (!defined(NCBI_COUNTER_ASM_OK)  ||  (!defined(__i386) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__sparc) && !defined(__x86_64)))
++#if !defined(NCBI_SWAP_POINTERS)  &&  !defined(NCBI_SWAP_POINTERS_CONDITIONALLY)  &&  !defined(NCBI_NO_THREADS)  &&  (!defined(NCBI_COUNTER_ASM_OK)  ||  (!defined(__i386) && !defined(__powerpc__) && !defined(__powerpc64__) && !defined(__ppc__) && !defined(__ppc64__) && !defined(__sparc) && !defined(__x86_64)))
+ #  define NCBI_SWAP_POINTERS_EXTERN 1
+ #  define NCBI_SLOW_ATOMIC_SWAP 1
+ #endif
+Index: b/c++/include/corelib/ncbiatomic.h
+===================================================================
+--- a/c++/include/corelib/ncbiatomic.h 2011-06-08 20:26:00.000000000 -0400
++++ b/c++/include/corelib/ncbiatomic.h 2011-06-08 20:30:34.000000000 -0400
+@@ -121,14 +121,14 @@
+     asm volatile("swap [%2], %1" : "=m" (*nv_loc), "=r" (old_value)
+                  : "r" (nv_loc), "1" (new_value), "m" (*nv_loc));
+     return old_value;
+-#    elif defined(__ppc__) ||  defined(__ppc64__)
++#    elif defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) ||  defined(__ppc64__)
+     void* old_value;
+     int   swapped = 0;
+     NCBI_SCHED_SPIN_INIT();
+     while ( !swapped ) {
+         swapped = 0;
+         asm volatile(
+-#ifdef __ppc64__
++#if defined(__powerpc64__)  ||  defined(__ppc64__)
+                      "ldarx %1,0,%4\n\tstdcx. %3,0,%4"
+ #else
+                      "lwarx %1,0,%4\n\tstwcx. %3,0,%4"
+Index: b/c++/src/objects/seq/seq_id_handle.cpp
+===================================================================
+--- a/c++/src/objects/seq/seq_id_handle.cpp    2011-06-08 20:26:34.000000000 -0400
++++ b/c++/src/objects/seq/seq_id_handle.cpp    2011-06-08 20:28:43.000000000 -0400
+@@ -47,11 +47,6 @@
+ // CSeq_id_Info
+ //
+-//#define NCBI_SLOW_ATOMIC_SWAP
+-#ifdef NCBI_SLOW_ATOMIC_SWAP
+-DEFINE_STATIC_FAST_MUTEX(sx_GetSeqIdMutex);
+-#endif
+-
+ CSeq_id_Info::CSeq_id_Info(CSeq_id::E_Choice type,
+                            CSeq_id_Mapper* mapper)
+Index: b/c++/src/objects/seq/seq_id_tree.cpp
+===================================================================
+--- a/c++/src/objects/seq/seq_id_tree.cpp      2011-06-08 20:26:34.000000000 -0400
++++ b/c++/src/objects/seq/seq_id_tree.cpp      2011-06-08 20:28:53.000000000 -0400
+@@ -42,6 +42,11 @@
+ BEGIN_NCBI_SCOPE
+ BEGIN_SCOPE(objects)
++//#define NCBI_SLOW_ATOMIC_SWAP
++#ifdef NCBI_SLOW_ATOMIC_SWAP
++DEFINE_STATIC_FAST_MUTEX(sx_GetSeqIdMutex);
++#endif
++
+ ////////////////////////////////////////////////////////////////////
+ //
+ //  CSeq_id_***_Tree::