summaryrefslogtreecommitdiff
path: root/extra/mono
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2013-09-23 02:41:50 -0700
committerroot <root@rshg054.dnsready.net>2013-09-23 02:41:50 -0700
commit7960b4f8054657774cc0636aa8ddf2fa48570622 (patch)
treee3151a1379b8cc5a923f4284a6877f51f6d0ad48 /extra/mono
parentfbd9603c619db8a960bd9c091211a8abd16c9534 (diff)
Mon Sep 23 02:35:56 PDT 2013
Diffstat (limited to 'extra/mono')
-rw-r--r--extra/mono/PKGBUILD13
-rw-r--r--extra/mono/sgen_fix.patch112
2 files changed, 120 insertions, 5 deletions
diff --git a/extra/mono/PKGBUILD b/extra/mono/PKGBUILD
index 0f70626e5..b22cb8b88 100644
--- a/extra/mono/PKGBUILD
+++ b/extra/mono/PKGBUILD
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD 194343 2013-09-13 22:42:57Z daniel $
+# $Id: PKGBUILD 194705 2013-09-22 21:22:23Z daniel $
# Maintainer: Daniel Isenmann <daniel@archlinux.org>
# Contributor: Brice Carpentier <brice@dlfp.org>
pkgname=mono
-pkgver=3.2.1
+pkgver=3.2.3
pkgrel=1
pkgdesc="Free implementation of the .NET platform including runtime and compiler"
arch=(i686 x86_64)
@@ -17,13 +17,16 @@ conflicts=('monodoc')
install=mono.install
source=(http://download.mono-project.com/sources/mono/${pkgname}-${pkgver}.tar.bz2
mono.binfmt.d
- mono.install)
-md5sums=('bb613f9c93f57c29abcb7270f3215eb2'
+ mono.install
+ sgen_fix.patch)
+md5sums=('a66c6309fad071e21f77f4c6b67a0f10'
'b9ef8a65fea497acf176cca16c1e2402'
- 'ca1108e9638b01c26453ee663592a4e5')
+ 'ca1108e9638b01c26453ee663592a4e5'
+ '8a700b94bff7a913f920e95890d2fb4c')
build() {
cd "${srcdir}"/${pkgname}-${pkgver}
+ patch -p1 < ../sgen_fix.patch
# build mono
./configure --prefix=/usr --sysconfdir=/etc --bindir=/usr/bin --sbindir=/usr/bin
make
diff --git a/extra/mono/sgen_fix.patch b/extra/mono/sgen_fix.patch
new file mode 100644
index 000000000..40cb9fba7
--- /dev/null
+++ b/extra/mono/sgen_fix.patch
@@ -0,0 +1,112 @@
+From d2cc22580898df5d4a15e0f99ab513e1570a6082 Mon Sep 17 00:00:00 2001
+From: Zoltan Varga <vargaz@gmail.com>
+Date: Fri, 20 Sep 2013 19:06:34 +0200
+Subject: [PATCH] [sgen] Use __builtin_ctzl () in OBJ_BITMAP_FOREACH_PTR () on
+ 64 bit platforms. Fixes #14834.
+
+---
+ mono/metadata/sgen-descriptor.h | 28 +++++++++++++++++++++++++---
+ mono/tests/sgen-descriptors.cs | 15 +++++++++++++--
+ 2 files changed, 38 insertions(+), 5 deletions(-)
+
+diff --git a/mono/metadata/sgen-descriptor.h b/mono/metadata/sgen-descriptor.h
+index cd53a86..3a00589 100644
+--- a/mono/metadata/sgen-descriptor.h
++++ b/mono/metadata/sgen-descriptor.h
+@@ -170,21 +170,43 @@ enum {
+ } \
+ } while (0)
+
+-#ifdef __GNUC__
++#if defined(__GNUC__) && SIZEOF_VOID_P==4
++#define OBJ_BITMAP_FOREACH_PTR(desc,obj) do { \
++ /* there are pointers */ \
++ void **_objptr = (void**)(obj); \
++ gsize _bmap = (desc) >> 16; \
++ _objptr += OBJECT_HEADER_WORDS; \
++ { \
++ int _index = __builtin_ctz (_bmap); \
++ _objptr += _index; \
++ _bmap >>= (_index + 1); \
++ HANDLE_PTR (_objptr, (obj)); \
++ _objptr ++; \
++ } \
++ while (_bmap) { \
++ int _index = __builtin_ctz (_bmap); \
++ _objptr += _index; \
++ _bmap >>= (_index + 1); \
++ HANDLE_PTR (_objptr, (obj)); \
++ _objptr ++; \
++ } \
++ } while (0)
++#elif defined(__GNUC__) && SIZEOF_VOID_P==8
++/* Same as above, but use _builtin_ctzl () */
+ #define OBJ_BITMAP_FOREACH_PTR(desc,obj) do { \
+ /* there are pointers */ \
+ void **_objptr = (void**)(obj); \
+ gsize _bmap = (desc) >> 16; \
+ _objptr += OBJECT_HEADER_WORDS; \
+ { \
+- int _index = __builtin_ctz (_bmap); \
++ int _index = __builtin_ctzl (_bmap); \
+ _objptr += _index; \
+ _bmap >>= (_index + 1); \
+ HANDLE_PTR (_objptr, (obj)); \
+ _objptr ++; \
+ } \
+ while (_bmap) { \
+- int _index = __builtin_ctz (_bmap); \
++ int _index = __builtin_ctzl (_bmap); \
+ _objptr += _index; \
+ _bmap >>= (_index + 1); \
+ HANDLE_PTR (_objptr, (obj)); \
+diff --git a/mono/tests/sgen-descriptors.cs b/mono/tests/sgen-descriptors.cs
+index ae00084..246e5aa 100644
+--- a/mono/tests/sgen-descriptors.cs
++++ b/mono/tests/sgen-descriptors.cs
+@@ -1,4 +1,5 @@
+ using System;
++using System.Runtime.InteropServices;
+
+ public struct SmallMixed
+ {
+@@ -47,6 +48,13 @@ public class HugePtrFree {
+ public LargeStruct2 c;
+ }
+
++[StructLayout (LayoutKind.Sequential)]
++public class Non32bitBitmap {
++ public object o;
++ public long i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23, i24, i25, i26, i27, i28, i29, i30, i31, i32, i33, i34, i35;
++ public object o2;
++}
++
+ /*
+ This is a stress test for descriptors.
+ */
+@@ -54,10 +62,10 @@ class Driver {
+ static char[] FOO = new char[] { 'f', 'o', 'b' };
+
+ static void Fill (int cycles) {
+- object[] root = new object [12];
++ object[] root = new object [13];
+ object[] current = root;
+ for (int i = 0; i < cycles; ++i) {
+- current [0] = new object [12];
++ current [0] = new object [13];
+ current [1] = new int [6];
+ current [2] = new int [2,3];
+ current [3] = new string (FOO);
+@@ -72,6 +80,9 @@ class Driver {
+ current [10] = new HugePtrFree ();
+ if ((i % 10000) == 0)
+ current [11] = new LargeStruct2 [1];
++
++ /* Test for 64 bit bitmap descriptors (#14834) */
++ current [12] = new Non32bitBitmap () { o = new object (), i32 = 1, i33 = 1, i34 = 1, i35 = 1, o2 = new object () };
+
+ current = (object[])current [0];
+ }
+--
+1.8.4
+