[packages/mono] - partial support for x32, builds but crashes on run

baggins baggins at pld-linux.org
Fri Mar 13 21:01:25 CET 2015


commit 291876902669ea51a9f5bd0eb6c11376e7db6666
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Mar 13 21:00:55 2015 +0100

    - partial support for x32, builds but crashes on run

 mono-x32.patch | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 mono.spec      |  4 ++-
 2 files changed, 98 insertions(+), 1 deletion(-)
---
diff --git a/mono.spec b/mono.spec
index 3ccdfdb..c970db1 100644
--- a/mono.spec
+++ b/mono.spec
@@ -25,6 +25,7 @@ Patch6:		%{name}-ARG_MAX.patch
 Patch7:		%{name}-fix-null-requirement.patch
 Patch8:		%{name}-docs-build.patch
 Patch9:		%{name}-format-security.patch
+Patch10:	%{name}-x32.patch
 URL:		http://www.mono-project.com/
 %if %(test -r /dev/random; echo $?)
 BuildRequires:	ACCESSIBLE_/dev/random
@@ -47,7 +48,7 @@ Suggests:	binfmt-detector
 # for System.Drawing
 Suggests:	libgdiplus >= 3.12
 Obsoletes:	mono-jscript
-ExclusiveArch:	%{ix86} %{x8664} arm aarch64 ia64 mips ppc ppc64 s390x sparc sparcv9 sparc64
+ExclusiveArch:	%{ix86} %{x8664} x32 arm aarch64 ia64 mips ppc ppc64 s390x sparc sparcv9 sparc64
 # plain i386 is not supported; mono uses cmpxchg/xadd which require i486
 ExcludeArch:	i386
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -219,6 +220,7 @@ oraz dotGNU.
 %patch7 -p1
 %patch8 -p1
 %patch9 -p1
+#patch10 -p1
 
 # for jay
 cat >> mcs/build/config-default.make <<'EOF'
diff --git a/mono-x32.patch b/mono-x32.patch
new file mode 100644
index 0000000..d8e44b2
--- /dev/null
+++ b/mono-x32.patch
@@ -0,0 +1,95 @@
+diff -ur mono-3.12.0/libgc/include/private/gc_locks.h mono-3.12.0-x32/libgc/include/private/gc_locks.h
+--- mono-3.12.0/libgc/include/private/gc_locks.h	2014-10-30 23:11:01.000000000 +0100
++++ mono-3.12.0-x32/libgc/include/private/gc_locks.h	2015-03-13 19:53:30.391221738 +0100
+@@ -437,7 +437,7 @@
+ 						       GC_word new_val) 
+          {
+ 	   char result;
+-	   __asm__ __volatile__("lock; cmpxchgq %2, %0; setz %1"
++	   __asm__ __volatile__("lock; cmpxchg %2, %0; setz %1"
+ 	    	: "+m"(*(addr)), "=r"(result)
+ 		: "r" (new_val), "a"(old) : "memory");
+ 	   return (GC_bool) result;
+diff -ur mono-3.12.0/mono/metadata/decimal.c mono-3.12.0-x32-2/mono/metadata/decimal.c
+--- mono-3.12.0/mono/metadata/decimal.c	2014-12-03 12:25:48.000000000 +0100
++++ mono-3.12.0-x32-2/mono/metadata/decimal.c	2015-03-13 20:27:27.291292654 +0100
+@@ -566,7 +566,7 @@
+ 	__asm__("bsrl %1,%0\n\t"
+ 			: "=r" (r) : "rm" (mask));
+ 	return r;
+-#elif defined(__x86_64) && defined(__GNUC__)
++#elif defined(__x86_64) && defined(__GNUC__) && !defined(__ILP32__)
+ 	guint64 r;
+ 
+ 	__asm__("bsrq %1,%0\n\t"
+Only in mono-3.12.0-x32-2/mono/metadata: decimal.c~
+diff -ur mono-3.12.0/mono/metadata/sgen-cardtable.c mono-3.12.0-x32-2/mono/metadata/sgen-cardtable.c
+--- mono-3.12.0/mono/metadata/sgen-cardtable.c	2015-01-12 18:15:08.000000000 +0100
++++ mono-3.12.0-x32-2/mono/metadata/sgen-cardtable.c	2015-03-13 20:28:38.011295116 +0100
+@@ -506,7 +506,7 @@
+ /*XXX Use assembly as this generates some pretty bad code */
+ #if defined(__i386__) && defined(__GNUC__)
+ 	return  (__builtin_ffs (card) - 1) / 8;
+-#elif defined(__x86_64__) && defined(__GNUC__)
++#elif defined(__x86_64__) && defined(__GNUC__) && !defined(__ILP32__)
+ 	return (__builtin_ffsll (card) - 1) / 8;
+ #elif defined(__s390x__)
+ 	return (__builtin_ffsll (GUINT64_TO_LE(card)) - 1) / 8;
+Only in mono-3.12.0-x32-2/mono/metadata: sgen-cardtable.c~
+diff -ur mono-3.12.0/mono/metadata/sgen-marksweep.c mono-3.12.0-x32-2/mono/metadata/sgen-marksweep.c
+--- mono-3.12.0/mono/metadata/sgen-marksweep.c	2015-01-12 18:15:08.000000000 +0100
++++ mono-3.12.0-x32-2/mono/metadata/sgen-marksweep.c	2015-03-13 20:26:38.467957621 +0100
+@@ -1750,7 +1750,7 @@
+ 
+ #if defined(__i386__) && defined(__GNUC__)
+ 	return card_data + i * 4 +  (__builtin_ffs (card) - 1) / 8;
+-#elif defined(__x86_64__) && defined(__GNUC__)
++#elif defined(__x86_64__) && defined(__GNUC__) && !defined(__ILP32__)
+ 	return card_data + i * 8 +  (__builtin_ffsll (card) - 1) / 8;
+ #elif defined(__s390x__) && defined(__GNUC__)
+ 	return card_data + i * 8 +  (__builtin_ffsll (GUINT64_TO_LE(card)) - 1) / 8;
+Only in mono-3.12.0-x32-2/mono/metadata: sgen-marksweep.c~
+diff -ur mono-3.12.0/mono/mini/mini-codegen.c mono-3.12.0-x32-2/mono/mini/mini-codegen.c
+--- mono-3.12.0/mono/mini/mini-codegen.c	2015-01-12 18:15:08.000000000 +0100
++++ mono-3.12.0-x32-2/mono/mini/mini-codegen.c	2015-03-13 20:24:21.044619503 +0100
+@@ -164,7 +164,7 @@
+ {
+ 	regmask_t mask = allow & rs->ifree_mask;
+ 
+-#if defined(__x86_64__) && defined(__GNUC__)
++#if defined(__x86_64__) && defined(__GNUC__) && !defined(__ILP32__)
+  {
+ 	guint64 i;
+ 
+Only in mono-3.12.0-x32-2/mono/mini: mini-codegen.c~
+diff -ur mono-3.12.0/mono/mini/regalloc.h mono-3.12.0-x32-2/mono/mini/regalloc.h
+--- mono-3.12.0/mono/mini/regalloc.h	2014-10-30 23:11:02.000000000 +0100
++++ mono-3.12.0-x32-2/mono/mini/regalloc.h	2015-03-13 20:23:14.031283837 +0100
+@@ -1,4 +1,4 @@
+-#if defined(__native_client__) && defined(__x86_64__)
++#if defined(__native_client__) && defined(__x86_64__) && !defined(__ILP32__)
+ typedef guint64 regmask_t;
+ #else
+ typedef size_t regmask_t;
+Only in mono-3.12.0-x32-2/mono/mini: regalloc.h~
+diff -ur mono-3.12.0/mono/utils/monobitset.c mono-3.12.0-x32-2/mono/utils/monobitset.c
+--- mono-3.12.0/mono/utils/monobitset.c	2014-12-03 12:25:48.000000000 +0100
++++ mono-3.12.0-x32-2/mono/utils/monobitset.c	2015-03-13 20:31:41.054634822 +0100
+@@ -289,7 +289,7 @@
+ 			 : "=r" (r) : "g" (mask)); 
+ 	 return nth_bit + r;
+  }
+-#elif defined(__x86_64) && defined(__GNUC__)
++#elif defined(__x86_64) && defined(__GNUC__) && !defined(__ILP32__)
+  {
+ 	guint64 r;
+ 
+@@ -317,7 +317,7 @@
+ 	__asm__("bsfl %1,%0\n\t"
+ 			: "=r" (r) : "rm" (mask));
+ 	return r;
+-#elif defined(__x86_64) && defined(__GNUC__)
++#elif defined(__x86_64) && defined(__GNUC__) && !defined(__ILP32__)
+ 	guint64 r;
+ 
+ 	__asm__("bsfq %1,%0\n\t"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mono.git/commitdiff/291876902669ea51a9f5bd0eb6c11376e7db6666



More information about the pld-cvs-commit mailing list