commit:     5e0c9066fc07252bc3286338af2951dfc03ff213
Author:     Ron MacNeil <macro <AT> hotmail <DOT> com>
AuthorDate: Sat Aug  1 09:48:20 2015 +0000
Commit:     Heather Cynede <cynede <AT> gentoo <DOT> org>
CommitDate: Sat Aug  1 09:48:20 2015 +0000
URL:        https://gitweb.gentoo.org/proj/dotnet.git/commit/?id=5e0c9066

mono-4.0.2.5: Add patch to fix build on big-endian machines

 ...mono-4.0.2.5-fix-decimal-ms-on-big-endian.patch | 22 ++++++++++++++++++++++
 dev-lang/mono/mono-4.0.2.5.ebuild                  |  4 ++++
 2 files changed, 26 insertions(+)

diff --git 
a/dev-lang/mono/files/mono-4.0.2.5-fix-decimal-ms-on-big-endian.patch 
b/dev-lang/mono/files/mono-4.0.2.5-fix-decimal-ms-on-big-endian.patch
new file mode 100644
index 0000000..c6349fe
--- /dev/null
+++ b/dev-lang/mono/files/mono-4.0.2.5-fix-decimal-ms-on-big-endian.patch
@@ -0,0 +1,22 @@
+diff -up mono/metadata/decimal-ms.c.than
+mono/metadata/decimal-ms.c
+--- mono/metadata/decimal-ms.c.than  2015-07-06 08:21:27.524461795
+-0400
++++ 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/dev-lang/mono/mono-4.0.2.5.ebuild 
b/dev-lang/mono/mono-4.0.2.5.ebuild
index b5aa9c9..3257f07 100644
--- a/dev-lang/mono/mono-4.0.2.5.ebuild
+++ b/dev-lang/mono/mono-4.0.2.5.ebuild
@@ -67,6 +67,10 @@ src_prepare() {
        #fix vb targets http://osdir.com/ml/general/2015-05/msg20808.html
        epatch "${FILESDIR}/add_missing_vb_portable_targets.patch"
 
+       # Fix build on big-endian machines
+       # https://bugzilla.xamarin.com/show_bug.cgi?id=31779
+       epatch "${FILESDIR}/${P}-fix-decimal-ms-on-big-endian.patch"
+
        autotools-utils_src_prepare
        epatch "${FILESDIR}/systemweb3.patch"
 }

Reply via email to