From b03cb1e329bdf134ac70266813f502d31f019ab5 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mon, 6 Jul 2015 22:37:27 +0200 Subject: [PATCH] backport from upstream to fix handling of lo64 on big endian systems --- mono-4.0.2-s390x.patch | 19 +++++++++++++++++++ mono.spec | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 mono-4.0.2-s390x.patch diff --git a/mono-4.0.2-s390x.patch b/mono-4.0.2-s390x.patch new file mode 100644 index 0000000..06b81bb --- /dev/null +++ b/mono-4.0.2-s390x.patch @@ -0,0 +1,19 @@ +diff -up mono-4.0.2/mono/metadata/decimal-ms.c.than mono-4.0.2/mono/metadata/decimal-ms.c +--- mono-4.0.2/mono/metadata/decimal-ms.c.than 2015-07-06 08:21:27.524461795 -0400 ++++ mono-4.0.2/mono/metadata/decimal-ms.c 2015-07-06 08:30:26.954461795 -0400 +@@ -55,8 +55,13 @@ static const uint32_t ten_to_ten_div_4 = + #define DECIMAL_LO32(dec) ((dec).v.v.Lo32) + #define DECIMAL_MID32(dec) ((dec).v.v.Mid32) + #define DECIMAL_HI32(dec) ((dec).Hi32) +-#define DECIMAL_LO64_GET(dec) ((dec).v.Lo64) +-#define DECIMAL_LO64_SET(dec,value) {(dec).v.Lo64 = value; } ++#if G_BYTE_ORDER != G_LITTLE_ENDIAN ++# define DECIMAL_LO64_GET(dec) (((uint64_t)((dec).v.v.Mid32) << 32) | (dec).v.v.Lo32) ++# define DECIMAL_LO64_SET(dec,value) {(dec).v.v.Lo32 = (value); (dec).v.v.Mid32 = ((value) >> 32); } ++#else ++# define DECIMAL_LO64_GET(dec) ((dec).v.Lo64) ++# define DECIMAL_LO64_SET(dec,value) {(dec).v.Lo64 = value; } ++#endif + + #define DECIMAL_SETZERO(dec) {DECIMAL_LO32(dec) = 0; DECIMAL_MID32(dec) = 0; DECIMAL_HI32(dec) = 0; DECIMAL_SIGNSCALE(dec) = 0;} + #define COPYDEC(dest, src) {DECIMAL_SIGNSCALE(dest) = DECIMAL_SIGNSCALE(src); DECIMAL_HI32(dest) = DECIMAL_HI32(src); \ diff --git a/mono.spec b/mono.spec index 45edb63..0e2aeb6 100644 --- a/mono.spec +++ b/mono.spec @@ -30,6 +30,7 @@ Source0: http://download.mono-project.com/sources/mono/mono-%{version}.5. # You should not regenerate this unless you have a really, really, really good reason. Source1: mono.snk Patch0: mono-4.0.0-ignore-reference-assemblies.patch +Patch1: mono-4.0.2-s390x.patch BuildRequires: bison BuildRequires: gcc-c++ @@ -296,6 +297,7 @@ Development file for monodoc %prep %setup -q -n %{name}-%{version} %patch0 -p1 +%patch1 -p1 # modifications for Mono 4 sed -i "s#mono/2.0#mono/4.5#g" data/mono-nunit.pc.in @@ -770,6 +772,9 @@ rm -rf %{buildroot}%{_mandir}/man?/mono-configuration-crypto* %{_libdir}/pkgconfig/monodoc.pc %changelog +* Mon Jul 06 2015 Than Ngo 4.0.2-3 +- backport from upstream to fix handling of lo64 on big endian systems + * Thu Jul 02 2015 Timotheus Pokorra - 4.0.2-2 - Update to 4.0.2.5 (4.0.2 SR 2)