From: Aaron M. Ucko Date: Thu, 9 Jun 2011 00:35:24 +0000 (+0000) Subject: debian/patches/support_other_cpus (new; committed upstream too): X-Git-Tag: archive/raspbian/2.16.0+ds-7+rpi1~1^2~335 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3626cd91b573f8c1ecc5a062a1edbb015c2d5d94;p=ncbi-blast%2B.git 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). [Also for #629656.] --- diff --git a/debian/changelog b/debian/changelog index 786e33c9..dd990362 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Wed, 08 Jun 2011 20:20:13 -0400 + -- Aaron M. Ucko Wed, 08 Jun 2011 20:35:16 -0400 ncbi-blast+ (2.2.25-1) unstable; urgency=low diff --git a/debian/patches/series b/debian/patches/series index 81229f6f..d6446b15 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -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 index 00000000..c84224c6 --- /dev/null +++ b/debian/patches/support_other_cpus @@ -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::