[zookeeper/f21] Update to enable arm again

tstclair tstclair at fedoraproject.org
Wed Oct 22 21:05:54 UTC 2014


commit ddc2a441e357609e8d73a3c4529303374b3c314d
Author: Timothy St. Clair <tstclair at redhat.com>
Date:   Wed Oct 22 16:05:34 2014 -0500

    Update to enable arm again

 mt_adaptor.c.patch |   32 ++++++++++++++++++++++++++++++++
 zookeeper.spec     |    5 ++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/mt_adaptor.c.patch b/mt_adaptor.c.patch
new file mode 100644
index 0000000..6d7563f
--- /dev/null
+++ b/mt_adaptor.c.patch
@@ -0,0 +1,32 @@
+Index: src/c/src/mt_adaptor.c
+===================================================================
+--- src/c/src/mt_adaptor.c	(revision 1447974)
++++ src/c/src/mt_adaptor.c	(working copy)
+@@ -484,25 +484,9 @@
+ int32_t fetch_and_add(volatile int32_t* operand, int incr)
+ {
+ #ifndef WIN32
+-    int32_t result;
+-    asm __volatile__(
+-         "lock xaddl %0,%1\n"
+-         : "=r"(result), "=m"(*(int *)operand)
+-         : "0"(incr)
+-         : "memory");
+-   return result;
++    return __sync_fetch_and_add(operand, incr);
+ #else
+-    volatile int32_t result;
+-    _asm
+-    {
+-        mov eax, operand; //eax = v;
+-       mov ebx, incr; // ebx = i;
+-        mov ecx, 0x0; // ecx = 0;
+-        lock xadd dword ptr [eax], ecx; 
+-       lock xadd dword ptr [eax], ebx; 
+-        mov result, ecx; // result = ebx;        
+-     }
+-     return result;    
++    return InterlockedExchangeAdd(operand, incr);
+ #endif
+ }
+ 
diff --git a/zookeeper.spec b/zookeeper.spec
index 948e129..20fdccc 100644
--- a/zookeeper.spec
+++ b/zookeeper.spec
@@ -17,9 +17,11 @@ Source3:       zkEnv.sh
 Patch1:        %{name}-3.4.5-zktreeutil-gcc.patch
 Patch2:        %{name}-3.4.6-ivy-build.patch
 Patch3:        %{name}-3.4.6-server.patch
+# patch accepted in 3.5.0
+Patch4:        https://issues.apache.org/jira/secure/attachment/12570030/mt_adaptor.c.patch
 
 # The native bits don't compile on ARM
-ExcludeArch:   %{arm}
+##ExcludeArch:   %%{arm}
 
 BuildRequires: autoconf
 BuildRequires: automake
@@ -115,6 +117,7 @@ The python-%{name} package contains Python bindings for %{name}.
 %patch1 -p0
 %patch2 -p1
 %patch3 -p1
+%patch4 -p0 -F2
 
 iconv -f iso8859-1 -t utf-8 src/c/ChangeLog > src/c/ChangeLog.conv && mv -f src/c/ChangeLog.conv src/c/ChangeLog
 sed -i 's/\r//' src/c/ChangeLog


More information about the scm-commits mailing list