[mingw-glib2] Add a patch to fix alignment tests when cross compiling
Kalev Lember
kalev at fedoraproject.org
Wed Mar 28 10:24:46 UTC 2012
commit 2bc7b7c718c92569f1ca3c0d801185d8daab9565
Author: Kalev Lember <kalevlember at gmail.com>
Date: Wed Mar 28 13:21:49 2012 +0300
Add a patch to fix alignment tests when cross compiling
...-Fix-alignment-tests-when-cross-compiling.patch | 35 ++++++++++++++++++++
mingw-glib2.spec | 12 ++++++-
2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/0001-configure-Fix-alignment-tests-when-cross-compiling.patch b/0001-configure-Fix-alignment-tests-when-cross-compiling.patch
new file mode 100644
index 0000000..08b8df0
--- /dev/null
+++ b/0001-configure-Fix-alignment-tests-when-cross-compiling.patch
@@ -0,0 +1,35 @@
+From 8f8fc836709cff58bd666b87937542088cfc19db Mon Sep 17 00:00:00 2001
+From: Kalev Lember <kalevlember at gmail.com>
+Date: Wed, 28 Mar 2012 12:42:49 +0300
+Subject: [PATCH] configure: Fix alignment tests when cross compiling
+
+When inserting custom code to AC_CHECK_ALIGNOF, make sure to not replace
+the default includes, but instead append to them.
+
+This fixes ALIGNOF_GUINT32 and ALIGNOF_GUINT64 that were both 0 when cross
+compiling. The third 'unsigned long' test wasn't affected because the
+AC_CHECK_ALIGNOF call didn't specify the optional 2nd parameter.
+---
+ configure.ac | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0d30b3e..82d74c6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -3405,8 +3405,10 @@ $ac_cv_sizeof___int64)
+ ;;
+ esac
+
+-AC_CHECK_ALIGNOF([guint32], [typedef unsigned $gint32 guint32;])
+-AC_CHECK_ALIGNOF([guint64], typedef unsigned $gint64 guint64;)
++AC_CHECK_ALIGNOF([guint32], [AC_INCLUDES_DEFAULT
++typedef unsigned $gint32 guint32;])
++AC_CHECK_ALIGNOF([guint64], [AC_INCLUDES_DEFAULT
++typedef unsigned $gint64 guint64;])
+ AC_CHECK_ALIGNOF([unsigned long])
+
+ # Check for libdbus1 - Optional - is only used in the GDBus test cases
+--
+1.7.9.3
+
diff --git a/mingw-glib2.spec b/mingw-glib2.spec
index 4545ae7..4f7430b 100644
--- a/mingw-glib2.spec
+++ b/mingw-glib2.spec
@@ -2,7 +2,7 @@
Name: mingw-glib2
Version: 2.32.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: MinGW Windows GLib2 library
License: LGPLv2+
@@ -11,6 +11,8 @@ URL: http://www.gtk.org
# first two digits of version
%define release_version %(echo %{version} | awk -F. '{print $1"."$2}')
Source0: http://download.gnome.org/sources/glib/%{release_version}/glib-%{version}.tar.xz
+# Already upstreamed
+Patch0: 0001-configure-Fix-alignment-tests-when-cross-compiling.patch
BuildArch: noarch
@@ -35,6 +37,9 @@ BuildRequires: gettext
# Native version required for glib-genmarshal
BuildRequires: glib2-devel >= 2.31.20
+# Needed for the patch
+BuildRequires: autoconf automake libtool
+
%description
MinGW Windows Glib2 library.
@@ -74,6 +79,8 @@ Static version of the MinGW Windows GLib2 library.
%prep
%setup -q -n glib-%{version}
+%patch0 -p1 -b .alignof
+autoreconf -i --force
%build
@@ -252,6 +259,9 @@ find $RPM_BUILD_ROOT -name "*.la" -delete
%changelog
+* Wed Mar 28 2012 Kalev Lember <kalevlember at gmail.com> - 2.32.0-2
+- Add a patch to fix alignment tests when cross compiling
+
* Mon Mar 26 2012 Kalev Lember <kalevlember at gmail.com> - 2.32.0-1
- Update to 2.32.0
- Dropped upstreamed patch
More information about the mingw
mailing list