[Pkg-mono-svn-commits] [SCM] moon branch, master, updated. upstream/2.3-47-g8f32d36

Jo Shields directhex at apebox.org
Fri Nov 5 00:59:24 UTC 2010


The following commit has been merged in the master branch:
commit b5a56e0a2a56d16482fad944cc49271891a3dc2e
Author: Jo Shields <directhex at apebox.org>
Date:   Fri Nov 5 00:23:46 2010 +0000

    Import Ubuntu upload 2.3-0ubuntu3

diff --git a/debian/changelog b/debian/changelog
index e500ae0..ee6a947 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,13 @@
+moon (2.3-0ubuntu3) maverick; urgency=low
+
+  * Fix the check for GC_test_and_set and GC_clear on armel. The sync
+    primitives are backported to the gcc-4.4 package. Fixes the
+    build failure on armel in thumb mode. LP: #635406.
+  * Apply arm related patches from the mono package.
+  * Configure with --build= --host=.
+
+ -- Matthias Klose <doko at ubuntu.com>  Sun, 19 Sep 2010 18:30:15 +0200
+
 moon (2.3-0ubuntu2) maverick; urgency=low
 
   * mono-2.6/libgc/include/private/gc_locks.h: For __ARM_EABI__ define
diff --git a/debian/patches/arm_changes_from_mono_package.patch b/debian/patches/arm_changes_from_mono_package.patch
new file mode 100644
index 0000000..403b2f8
--- /dev/null
+++ b/debian/patches/arm_changes_from_mono_package.patch
@@ -0,0 +1,263 @@
+Description: Upstream changes introduced in version 2.3-0ubuntu3
+ This patch has been created by dpkg-source during the package build.
+ Here's the last changelog entry, hopefully it gives details on why
+ those changes were made:
+ .
+ moon (2.3-0ubuntu3) maverick; urgency=low
+ .
+    * Fix the check for GC_test_and_set and GC_clear on armel. The sync
+      primitives are backported to the gcc-4.4 package. Fixes the
+      build failure on armel in thumb mode. LP: #635406.
+ .
+ The person named in the Author field signed this changelog entry.
+Author: Matthias Klose <doko at ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/635406
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: http://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: <YYYY-MM-DD>
+
+--- moon-2.3.orig/mono-2-6/configure.in
++++ moon-2.3/mono-2-6/configure.in
+@@ -2297,15 +2297,24 @@ if test "x$with_tls" = "x__thread"; then
+ 	])
+ fi
+ 
+-if test ${TARGET} = ARM && test x$cross_compiling = xno && test x$enable_mcs_build != xno; then
++AC_ARG_WITH(fpu, [ --with-fpu=FPA,VFP,NONE    Select fpu to use on arm],[fpu=$withval])
++
++if test ${TARGET} = ARM; then
+ 	dnl ******************************************
+ 	dnl *** Check to see what FPU is available ***
+ 	dnl ******************************************
+ 	AC_MSG_CHECKING(which FPU to use)
+ 
+-	AC_TRY_COMPILE([], [
+-		__asm__ ("ldfd f0, [r0]");
+-		], fpu=FPA, fpu=NONE)
++	if test "x$fpu" = "x"; then
++
++		AC_TRY_COMPILE([], [
++			__asm__ ("ldfd f0, [r0]");
++		], fpu=FPA, [
++				AC_TRY_COMPILE([], [
++					__asm__ ("fldd d0, [r0]");
++				], fpu=VFP, fpu=NONE)
++		])
++	fi
+ 
+ 	AC_MSG_RESULT($fpu)
+ 	CPPFLAGS="$CPPFLAGS -DARM_FPU_$fpu=1"
+--- moon-2.3.orig/mono-2-6/mono/mini/mini-arm.c
++++ moon-2.3/mono-2-6/mono/mini/mini-arm.c
+@@ -36,9 +36,13 @@ static gint lmf_addr_tls_offset = -1;
+ #define mono_mini_arch_unlock() LeaveCriticalSection (&mini_arch_mutex)
+ static CRITICAL_SECTION mini_arch_mutex;
+ 
+-static int v5_supported = 0;
+-static int v7_supported = 0;
+-static int thumb_supported = 0;
++#define MAYBE 2
++
++/* Assume v5 and Thumb are supported unless cpuinfo says otherwise (ARMv4
++ * without Thumb) */
++static int v5_supported = MAYBE;
++static int v7_supported = MAYBE;
++static int thumb_supported = MAYBE;
+ 
+ /*
+  * The code generated for sequence points reads from this location, which is
+@@ -175,11 +179,11 @@ emit_memcpy (guint8 *code, int size, int
+ static guint8*
+ emit_call_reg (guint8 *code, int reg)
+ {
+-	if (v5_supported) {
++	if (v5_supported != FALSE) {
+ 		ARM_BLX_REG (code, reg);
+ 	} else {
+ 		ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
+-		if (thumb_supported)
++		if (thumb_supported != FALSE)
+ 			ARM_BX (code, reg);
+ 		else
+ 			ARM_MOV_REG_REG (code, ARMREG_PC, reg);
+@@ -539,20 +543,36 @@ mono_arch_cpu_optimizazions (guint32 *ex
+ 		while ((line = fgets (buf, 512, file))) {
+ 			if (strncmp (line, "Processor", 9) == 0) {
+ 				char *ver = strstr (line, "(v");
+-				if (ver && (ver [2] == '5' || ver [2] == '6' || ver [2] == '7'))
+-					v5_supported = TRUE;
++				if (!ver) {
++					/* invalid cpuinfo; perhaps running withing qemu-arm; skip */
++					break;
++				}
++				v7_supported = FALSE;
+ 				if (ver && (ver [2] == '7'))
+ 					v7_supported = TRUE;
+-				continue;
++				if (ver [2] == '5' || ver [2] == '6' || ver [2] == '7') {
++					v5_supported = TRUE;
++					/* present since ARMv5 for mono's practical purposes */
++					thumb_supported = TRUE;
++					break;
++				} else if (ver [2] == '4') {
++					v5_supported = FALSE;
++					/* continue scanning for Features */
++					continue;
++				}
++				/* new or very old ARM architecture? */
++				g_assert_not_reached ();
+ 			}
+ 			if (strncmp (line, "Features", 8) == 0) {
++				/* Assume we already parsed Processor and it was v4 */
++				g_assert (v5_supported == FALSE);
+ 				char *th = strstr (line, "thumb");
+ 				if (th) {
+ 					thumb_supported = TRUE;
+-					if (v5_supported)
+-						break;
++				} else {
++					thumb_supported = FALSE;
+ 				}
+-				continue;
++				break;
+ 			}
+ 		}
+ 		fclose (file);
+@@ -2469,7 +2489,7 @@ search_thunk_slot (void *data, int csize
+ 				 */
+ 				code = (guchar*)thunks;
+ 				ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 0);
+-				if (thumb_supported)
++				if (thumb_supported != FALSE)
+ 					ARM_BX (code, ARMREG_IP);
+ 				else
+ 					ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_IP);
+@@ -2534,7 +2554,7 @@ arm_patch_general (MonoDomain *domain, g
+ 		gint tmask = 0xffffffff;
+ 		if (tval & 1) { /* entering thumb mode */
+ 			diff = target - 1 - code - 8;
+-			g_assert (thumb_supported);
++			g_assert (thumb_supported != FALSE);
+ 			tbits = 0xf << 28; /* bl->blx bit pattern */
+ 			g_assert ((ins & (1 << 24))); /* it must be a bl, not b instruction */
+ 			/* this low bit of the displacement is moved to bit 24 in the instruction encoding */
+--- moon-2.3.orig/mono-2-6/mono/io-layer/atomic.h
++++ moon-2.3/mono-2-6/mono/io-layer/atomic.h
+@@ -746,6 +746,9 @@ static inline gint32 InterlockedExchange
+ 
+ static inline gint32 InterlockedCompareExchange(volatile gint32 *dest, gint32 exch, gint32 comp)
+ {
++#ifdef __thumb__
++	return __sync_val_compare_and_swap (dest, comp, exch);
++#else
+ 	int a, b;
+ 
+ 	__asm__ __volatile__ (    "0:\n\t"
+@@ -763,10 +766,14 @@ static inline gint32 InterlockedCompareE
+ 				  : "cc", "memory");
+ 
+ 	return a;
++#endif /* !__thumb__ */
+ }
+ 
+ static inline gpointer InterlockedCompareExchangePointer(volatile gpointer *dest, gpointer exch, gpointer comp)
+ {
++#ifdef __thumb__
++	return __sync_val_compare_and_swap (dest, comp, exch);
++#else
+ 	gpointer a, b;
+ 
+ 	__asm__ __volatile__ (    "0:\n\t"
+@@ -784,10 +791,14 @@ static inline gpointer InterlockedCompar
+ 				  : "cc", "memory");
+ 
+ 	return a;
++#endif
+ }
+ 
+ static inline gint32 InterlockedIncrement(volatile gint32 *dest)
+ {
++#ifdef __thumb__
++	return __sync_add_and_fetch (dest, 1);
++#else
+ 	int a, b, c;
+ 
+ 	__asm__ __volatile__ (  "0:\n\t"
+@@ -802,10 +813,14 @@ static inline gint32 InterlockedIncremen
+ 				: "cc", "memory");
+ 
+ 	return b;
++#endif
+ }
+ 
+ static inline gint32 InterlockedDecrement(volatile gint32 *dest)
+ {
++#ifdef __thumb__
++	return __sync_sub_and_fetch (dest, 1);
++#else
+ 	int a, b, c;
+ 
+ 	__asm__ __volatile__ (  "0:\n\t"
+@@ -820,10 +835,14 @@ static inline gint32 InterlockedDecremen
+ 				: "cc", "memory");
+ 
+ 	return b;
++#endif
+ }
+ 
+ static inline gint32 InterlockedExchange(volatile gint32 *dest, gint32 exch)
+ {
++#ifdef __thumb__
++	return __sync_lock_test_and_set (dest, exch);
++#else
+ 	int a;
+ 
+ 	__asm__ __volatile__ (  "swp %0, %2, [%1]"
+@@ -831,10 +850,14 @@ static inline gint32 InterlockedExchange
+ 				: "r" (dest), "r" (exch));
+ 
+ 	return a;
++#endif
+ }
+ 
+ static inline gpointer InterlockedExchangePointer(volatile gpointer *dest, gpointer exch)
+ {
++#ifdef __thumb__
++	return __sync_lock_test_and_set (dest, exch);
++#else
+ 	gpointer a;
+ 
+ 	__asm__ __volatile__ (	"swp %0, %2, [%1]"
+@@ -842,10 +865,14 @@ static inline gpointer InterlockedExchan
+ 				: "r" (dest), "r" (exch));
+ 
+ 	return a;
++#endif
+ }
+ 
+ static inline gint32 InterlockedExchangeAdd(volatile gint32 *dest, gint32 add)
+ {
++#ifdef __thumb__
++	return __sync_fetch_and_add (dest, add);
++#else
+ 	int a, b, c;
+ 
+ 	__asm__ __volatile__ (  "0:\n\t"
+@@ -860,6 +887,7 @@ static inline gint32 InterlockedExchange
+ 				: "cc", "memory");
+ 
+ 	return a;
++#endif
+ }
+ 
+ #elif defined(__ia64__)
diff --git a/debian/patches/series b/debian/patches/series
index 4eafbfc..1db2aea 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ use_AC_PATH_PROGS_to_satisfy_chromium_search.patch
 use_bundled_mono_runtime_for_smcs.patch
 include_config.h_in_all_files.patch
 use_atomic_builtins_on_armel.patch
+arm_changes_from_mono_package.patch
diff --git a/debian/patches/use_atomic_builtins_on_armel.patch b/debian/patches/use_atomic_builtins_on_armel.patch
index e6979f5..f37c39d 100644
--- a/debian/patches/use_atomic_builtins_on_armel.patch
+++ b/debian/patches/use_atomic_builtins_on_armel.patch
@@ -5,7 +5,7 @@
  #    endif /* ALPHA */
  #    ifdef ARM32
 +#     define GC_TEST_AND_SET_DEFINED
-+#     if (__GNUC__>4)||((__GNUC__==4)&&(__GNUC_MINOR__>=5)) && defined(__ARM_EABI__)
++#     if (__GNUC__>4)||((__GNUC__==4)&&(__GNUC_MINOR__>=4)) && defined(__ARM_EABI__)
 +#       define GC_CLEAR_DEFINED
 +#       define GC_test_and_set(addr) __sync_lock_test_and_set (addr, 1)
 +#       define GC_clear(addr) __sync_lock_release (addr)
diff --git a/debian/rules b/debian/rules
index 43fae40..8977271 100644
--- a/debian/rules
+++ b/debian/rules
@@ -12,6 +12,14 @@ DEB_VERSION = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Vers
 DEB_SOURCE_NAME = $(shell dpkg-parsechangelog -l$(DEBIAN_DIR)/changelog | grep ^Source | cut -d" " -f2)
 VERSION = $(shell echo $(DEB_VERSION) | cut -d"-" -f1 | sed 's/+dfsg.*//')
 
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+DEB_HOST_ARCH  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+arch_config_args = --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE)
+ifeq ($(DEB_HOST_ARCH),armel)
+  arch_config_args += --with-fpu=VFP
+endif
+
 include /usr/share/cli-common/cli.make
 
 clean:
@@ -97,7 +105,7 @@ mono-build-stamp: mono-configure-stamp
 	touch mono-build-stamp
 
 mono-configure-stamp:
-	cd mono-2-6 && ./configure --prefix=$(MONO_SHARED_DIR)/monoprefix
+	cd mono-2-6 && ./configure --prefix=$(MONO_SHARED_DIR)/monoprefix $(arch_config_args)
 	touch mono-configure-stamp
 
 moonlight-build-stamp: moonlight-configure-stamp
@@ -106,7 +114,7 @@ moonlight-build-stamp: moonlight-configure-stamp
 
 moonlight-configure-stamp: mono-install-stamp
 	autoreconf
-	PKG_CONFIG_PATH=$(MONO_SHARED_DIR)/monoprefix/lib/pkgconfig ./configure --with-mcspath=$(MONO_SHARED_DIR)/mono-2-6/mcs --with-mono-basic-path=$(MONO_SHARED_DIR)/mono-basic-2-6 --with-cairo=system --with-ff3=yes --prefix=/usr --with-curl=system
+	PKG_CONFIG_PATH=$(MONO_SHARED_DIR)/monoprefix/lib/pkgconfig ./configure --with-mcspath=$(MONO_SHARED_DIR)/mono-2-6/mcs --with-mono-basic-path=$(MONO_SHARED_DIR)/mono-basic-2-6 --with-cairo=system --with-ff3=yes --prefix=/usr --with-curl=system $(arch_config_args)
 	touch moonlight-configure-stamp
 
 get-orig-source:

-- 
moon



More information about the Pkg-mono-svn-commits mailing list