[zarafa] Added patch to build Zarafa on armv5tel and armv7hl
Robert Scheck
robert at fedoraproject.org
Mon Jun 25 23:35:55 UTC 2012
commit e14f982e66a7e57d8435127fcc89e41bbf15f724
Author: Robert Scheck <robert at fedoraproject.org>
Date: Tue Jun 26 01:35:25 2012 +0200
Added patch to build Zarafa on armv5tel and armv7hl
zarafa-7.0.8-va_list.patch | 44 ++++++++++++++++++++++++++++++++++++++++++++
zarafa.spec | 2 ++
2 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/zarafa-7.0.8-va_list.patch b/zarafa-7.0.8-va_list.patch
new file mode 100644
index 0000000..1e7430f
--- /dev/null
+++ b/zarafa-7.0.8-va_list.patch
@@ -0,0 +1,44 @@
+Patch by Robert Scheck <robert at fedoraproject.org> for zarafa >= 7.0.8, which works
+around the insane written C/C++ code. I am not a C/C++ developer, but you only can
+use four macros for handling va_list at all: va_start, va_arg, va_copy and va_end.
+
+As a developer you should not assume that va_list is always internally typed as an
+integer because it is case on i?86 and x86_64 for example. Architectures like ARM
+handle va_list not as an integer and thus fail during compiling like this:
+
+Trace.cpp:129:16: error: invalid operands of types 'va_list {aka __va_list}' and
+ 'int' to binary 'operator!='
+Trace.cpp:142:16: error: invalid operands of types 'va_list {aka __va_list}' and
+ 'int' to binary 'operator!='
+
+As it is unfortunately not safe to assume that format does not contain attributes
+while va is empty this workaround is only applied on the affected ARM architecture
+for now. The only real solution is a clean rewrite of the code that should happen
+upstream.
+
+--- zarafa-7.0.8/common/Trace.cpp 2012-06-18 18:55:29.000000000 +0200
++++ zarafa-7.0.8/common/Trace.cpp.va_list 2012-06-20 01:20:06.000000000 +0200
+@@ -126,7 +126,11 @@
+
+ len = pos + 3;
+
++#if defined __ARM_EABI__
++ if (format) {
++#else
+ if (format && va) {
++#endif
+ va_copy(va_lentest, va);
+ len += _vsnprintf(NULL, 0, format, va_lentest);
+ va_end(va_lentest);
+@@ -139,7 +143,11 @@
+
+ memcpy(buffer, debug, pos);
+
++#if defined __ARM_EABI__
++ if (format)
++#else
+ if (format && va)
++#endif
+ pos = _vsnprintf(buffer+pos, len-pos, format, va);
+
+ if(pos == -1) {
diff --git a/zarafa.spec b/zarafa.spec
index 1eb63c9..d740365 100644
--- a/zarafa.spec
+++ b/zarafa.spec
@@ -44,6 +44,7 @@ Source3: %{name}-webaccess.conf
Patch0: zarafa-6.40.5-rpath.patch
Patch1: zarafa-7.0.8-zlib127.patch
+Patch2: zarafa-7.0.8-va_list.patch
BuildRequires: bison
BuildRequires: gcc-c++
@@ -372,6 +373,7 @@ to interact with Zarafa.
%patch0 -p1 -b .rpath
touch -c -r aclocal.m4.rpath aclocal.m4
%patch1 -p1 -b .zlib127
+%patch2 -p1 -b .va_list
%build
%if 0%{?rhel}%{?fedora} < 6
More information about the scm-commits
mailing list