backport fix from upstream, fix build problem with gcc 4.4.7 on s390x

This commit is contained in:
Than Ngo 2016-01-25 17:17:15 +01:00
parent e97249b62d
commit 79ae75a2b3
2 changed files with 25 additions and 13 deletions

View File

@ -1,17 +1,26 @@
diff -up mono-4.2.2/mono/metadata/icall.c.than mono-4.2.2/mono/metadata/icall.c
--- mono-4.2.2/mono/metadata/icall.c.than 2016-01-22 07:19:14.752781004 -0500
+++ mono-4.2.2/mono/metadata/icall.c 2016-01-22 07:20:47.642781004 -0500
@@ -825,10 +825,10 @@ ves_icall_System_Runtime_CompilerService
#define SWAP(n) {\
guint ## n *data = (guint ## n *) mono_array_addr (array, char, 0); \
guint ## n *src = (guint ## n *) field_data; \
diff -up mono-4.2.1/mono/metadata/icall.c.than mono-4.2.1/mono/metadata/icall.c
--- mono-4.2.1/mono/metadata/icall.c.than 2015-11-12 10:00:29.000000000 +0100
+++ mono-4.2.1/mono/metadata/icall.c 2016-01-25 16:36:24.479028169 +0100
@@ -822,14 +822,14 @@ ves_icall_System_Runtime_CompilerService
}
#if G_BYTE_ORDER != G_LITTLE_ENDIAN
-#define SWAP(n) {\
- guint ## n *data = (guint ## n *) mono_array_addr (array, char, 0); \
- guint ## n *src = (guint ## n *) field_data; \
- guint ## n *end = (guint ## n *)((char*)src + size); \
+ int i; \
\
-\
- for (; src < end; data++, src++) { \
- *data = read ## n (src); \
+ for (i = 0; i < (size / sizeof(guint ## n)); i++) { \
+ data[i] = read ## n (&src[i]); \
} \
- } \
+#define SWAP(n) { \
+ guint ## n *data = (guint ## n *) mono_array_addr (array, char, 0); \
+ guint ## n *src = (guint ## n *) field_data; \
+ int i, nEnt = (size / sizeof(guint ## n)); \
+ \
+ for (i = 0; i < nEnt; i++) { \
+ data[i] = read ## n (&src[i]); \
+ } \
}
/* printf ("Initialize array with elements of %s type\n", klass->element_class->name); */

View File

@ -17,7 +17,7 @@
Name: mono
Version: 4.2.1
Release: 8%{?dist}
Release: 9%{?dist}
Summary: Cross-platform, Open Source, .NET development framework
Group: Development/Languages
@ -747,6 +747,9 @@ mkdir -p %{buildroot}%{_datadir}/gdb/auto-load%{_bindir}
%{_libdir}/pkgconfig/monodoc.pc
%changelog
* Mon Jan 25 2016 Than Ngo <than@redhat.com> - 4.2.1-9
- backport fix from upstream, fix build problem with gcc 4.4.7 on s390x
* Fri Jan 22 2016 Than Ngo <than@redhat.com> - 4.2.1-8
- fix build failure on s390, thanks to <Neale Ferguson>