[yocto] [meta-mono] [PATCH 1/1] mono-native: Modify build to eliminate dependency on on host system mscorlib.dll

Alex J Lennon ajlennon at dynamicdevices.co.uk
Sun Mar 2 13:39:12 PST 2014


Synopsis
========

mono-native builds fine with an Ubuntu 12.04 LTS host system, with or without mono installed from precise pangolin (i.e. Mono v2.x series).

If mono is upgraded to v3.x series using, say, ppa:directhex/monoxide then the build fails

@see http://stackoverflow.com/questions/13365158/installing-mono-3-x-3-0-x-and-or-3-2-x

Build messages includes a warning

../corlib/Mono/DataConverter.cs(759,25): warning CS0436: The type `Mono.DataConverter' conflicts with the imported type of same name'.
Ignoring the imported type definition
../../build/common/MonoTODOAttribute.cs(38,17): (Location of the symbol related to previous warning)
/usr/lib/mono/4.5/mscorlib.dll (Location of the symbol related to previous warning)

Then an error

MCS     [build] mscorlib.dll
Unhandled Exception:
System.TypeLoadException: Could not load type 'Mono.CSharp.CommandLineParser' from assembly 'basic, Version=3.2.8.0, Culture=neutral, PublicKeyToken=null'.
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'Mono.CSharp.CommandLineParser' from assembly 'basic, Version=3.2.8.0, Culture=neutral, PublicKeyToken=null'.
make[8]: *** [../../class/lib/build/tmp/mscorlib.dll] Error 1

This appears related to Mono building its 'basic' profile. The makefile for this profile appears not to correctly set the path to the correct mscorlib.dll which this patch attempts to fix.

Testing
=======

With this patch in place a build of a qemux86 image succeeds with Mono 3.2.8 on the
host and the mono-helloworld recipe files can be executed successfully

Signed-off-by: Alex J Lennon <ajlennon at dynamicdevices.co.uk>
---
 .../mono/mono-3.2.8/fix-basic-mscorlib-dep.patch   |   11 +++++++++++
 recipes-mono/mono/mono-native_3.2.8.bb             |    5 +++--
 2 files changed, 14 insertions(+), 2 deletions(-)
 create mode 100644 recipes-mono/mono/mono-3.2.8/fix-basic-mscorlib-dep.patch

diff --git a/recipes-mono/mono/mono-3.2.8/fix-basic-mscorlib-dep.patch b/recipes-mono/mono/mono-3.2.8/fix-basic-mscorlib-dep.patch
new file mode 100644
index 0000000..5759a86
--- /dev/null
+++ b/recipes-mono/mono/mono-3.2.8/fix-basic-mscorlib-dep.patch
@@ -0,0 +1,11 @@
+--- 3.2.8-r0/mcs/build/profiles/basic.make.org	2014-03-01 17:51:52.904670729 +0000
++++ 3.2.8-r0/mcs/build/profiles/basic.make	2014-03-01 17:46:50.476669939 +0000
+@@ -12,7 +12,7 @@
+ PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME)
+ BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(MONOLITE_MCS) -sdk:2
+ else
+-PROFILE_RUNTIME = $(EXTERNAL_RUNTIME)
++PROFILE_RUNTIME = ${with_mono_path) $(EXTERNAL_RUNTIME)
+ BOOTSTRAP_MCS = $(EXTERNAL_MCS)
+ endif
+ 
diff --git a/recipes-mono/mono/mono-native_3.2.8.bb b/recipes-mono/mono/mono-native_3.2.8.bb
index 93decd6..6ad4b04 100644
--- a/recipes-mono/mono/mono-native_3.2.8.bb
+++ b/recipes-mono/mono/mono-native_3.2.8.bb
@@ -4,11 +4,12 @@ inherit native
 
 EXTRA_OECONF += "mono_cv_uscore=no --with-sigaltstack=no --with-mcs-docs=no"
 
+SRC_URI += "file://fix-basic-mscorlib-dep.patch"
+
 do_configure_prepend() {
     ${S}/autogen.sh --verbose || bbnote "mono-native failed to autogen.sh"
 }
 
 do_compile() {
-    make get-monolite-latest
-    make EXTERNAL_MCS="${S}/mcs/class/lib/monolite/basic.exe"
+    make EXTERNAL_MCS="${S}/mcs/class/lib/monolite/basic.exe" 
 }
-- 
1.7.9.5




More information about the yocto mailing list