[dbus] Add patch to fix test-marshal on s390.
Colin Walters
walters at fedoraproject.org
Thu Jul 25 14:39:31 UTC 2013
commit e15c1bd04c930943ea559b8d4a1a57f11b21990b
Author: Colin Walters <walters at verbum.org>
Date: Wed Jul 24 17:09:56 2013 -0400
Add patch to fix test-marshal on s390.
...al-Ensure-we-use-suitably-aligned-buffers.patch | 64 ++++++++++++++++++++
dbus.spec | 7 ++-
2 files changed, 70 insertions(+), 1 deletions(-)
---
diff --git a/0001-test-marshal-Ensure-we-use-suitably-aligned-buffers.patch b/0001-test-marshal-Ensure-we-use-suitably-aligned-buffers.patch
new file mode 100644
index 0000000..d7cea52
--- /dev/null
+++ b/0001-test-marshal-Ensure-we-use-suitably-aligned-buffers.patch
@@ -0,0 +1,64 @@
+From 1a09d46b3cad370e4bd2c59ec6215fbf65351834 Mon Sep 17 00:00:00 2001
+From: Colin Walters <walters at verbum.org>
+Date: Wed, 24 Jul 2013 21:48:58 +0100
+Subject: [PATCH] test/marshal: Ensure we use suitably aligned buffers
+
+This test was failing on s390; though it could fail
+on other platforms too. Basically we need to be sure
+we're passing at least word-aligned buffers to the
+demarshalling code. malloc() will do that for us.
+---
+ test/marshal.c | 27 ++++++++++++++++++++++-----
+ 1 file changed, 22 insertions(+), 5 deletions(-)
+
+diff --git a/test/marshal.c b/test/marshal.c
+index e9ac7e3..e65ee7c 100644
+--- a/test/marshal.c
++++ b/test/marshal.c
+@@ -27,6 +27,7 @@
+ #include <config.h>
+
+ #include <glib.h>
++#include <string.h>
+
+ #include <dbus/dbus.h>
+ #include <dbus/dbus-glib-lowlevel.h>
+@@ -244,14 +245,30 @@ int
+ main (int argc,
+ char **argv)
+ {
++ int ret;
++ char *aligned_le_blob;
++ char *aligned_be_blob;
++
+ g_test_init (&argc, &argv, NULL);
+
+- g_test_add ("/demarshal/le", Fixture, le_blob, setup, test_endian, teardown);
+- g_test_add ("/demarshal/be", Fixture, be_blob, setup, test_endian, teardown);
+- g_test_add ("/demarshal/needed/le", Fixture, le_blob, setup, test_needed,
++ /* We have to pass in a buffer that's at least "default aligned",
++ * i.e. on GNU systems to 8 or 16. The linker may have only given
++ * us byte-alignment for the char[] static variables.
++ */
++ aligned_le_blob = g_malloc (sizeof (le_blob));
++ memcpy (aligned_le_blob, le_blob, sizeof (le_blob));
++ aligned_be_blob = g_malloc (sizeof (be_blob));
++ memcpy (aligned_be_blob, be_blob, sizeof (be_blob));
++
++ g_test_add ("/demarshal/le", Fixture, aligned_le_blob, setup, test_endian, teardown);
++ g_test_add ("/demarshal/be", Fixture, aligned_be_blob, setup, test_endian, teardown);
++ g_test_add ("/demarshal/needed/le", Fixture, aligned_le_blob, setup, test_needed,
+ teardown);
+- g_test_add ("/demarshal/needed/be", Fixture, be_blob, setup, test_needed,
++ g_test_add ("/demarshal/needed/be", Fixture, aligned_be_blob, setup, test_needed,
+ teardown);
+
+- return g_test_run ();
++ ret = g_test_run ();
++ g_free (aligned_le_blob);
++ g_free (aligned_be_blob);
++ return ret;
+ }
+--
+1.8.1.4
+
diff --git a/dbus.spec b/dbus.spec
index f28e640..530552b 100644
--- a/dbus.spec
+++ b/dbus.spec
@@ -13,7 +13,7 @@ Summary: D-BUS message bus
Name: dbus
Epoch: 1
Version: 1.6.12
-Release: 3%{?dist}
+Release: 4%{?dist}
URL: http://www.freedesktop.org/software/dbus/
#VCS: git:git://git.freedesktop.org/git/dbus/dbus
Source0: http://dbus.freedesktop.org/releases/dbus/%{name}-%{version}.tar.gz
@@ -51,6 +51,7 @@ BuildRequires: /usr/bin/Xvfb
# FIXME this should be upstreamed; need --daemon-bindir=/bin and --bindir=/usr/bin or something?
Patch0: bindir.patch
Patch1: 0001-name-test-Don-t-run-test-autolaunch-if-we-don-t-have.patch
+Patch2: 0001-test-marshal-Ensure-we-use-suitably-aligned-buffers.patch
%description
D-BUS is a system for sending messages between applications. It is
@@ -101,6 +102,7 @@ in this separate package so server systems need not install X.
%patch0 -p1 -b .bindir
%patch1 -p1
+%patch2 -p1
%build
if test -f autogen.sh; then env NOCONFIGURE=1 ./autogen.sh; else autoreconf -v -f -i; fi
@@ -244,6 +246,9 @@ fi
%{_includedir}/*
%changelog
+* Wed Jul 24 2013 Colin Walters <walters at verbum.org> - 1:1.6.12-4
+- Add patch to fix test-marshal on s390.
+
* Thu Jul 18 2013 Colin Walters <walters at verbum.org> - 1:1.6.12-3
- Find all logs automake has hidden and cat them for visibility
into the mock logs.
More information about the scm-commits
mailing list