[Mono-list] "mscorlib.dll is an invalid CIL image"

Chris Plasun chrispl78 at yahoo.com
Tue Apr 28 22:28:50 EDT 2009


Hi Jon,

Jonathan Pryor wrote:
> On Tue, 2009-04-28 at 18:01 -0700, Chris Plasun wrote:
>> So the Mono build **does** create a MSCORLIB.DLL?
> 
> Yes.  The Mono build creates every assembly listed in mcs/class, e.g.
> mscorlib.dll, System.dll, System.Core.dll, System.Web.dll, etc.

Ah!

Well, that puts things in a new light.

>> I understand that the  *.dll/*.exe files are platform independent, but are 
>> they **architecture** independent? I'm using PowerPC.
> 
> Yes.

OK.

Now that my mind is a bit clearer, my concern about architecture doesn't 
make sense as I can run Mono itself, without running any app.

>> It looks like some of the paths are messed up as I can't run monodis
>> on the board. I'll have to fix that first.
>>
>> Monodis on SUSE doesn't report any mscorlib.dll corruption...
>>
>> I think I need to learn how to cross-build Mono myself, no?
>>
>> The build I have for this board doesn't have mscorlib.dll so I'm using 
>> the SUSE one; that's not doable?
> 
> This was discussed by Rodrigo: mscorlib.dll is tied to the runtime.  You
> can't mix and match it across Mono versions.

Yes, understood.

> So what you _can_ do is build e.g. Mono 2.4 on openSUSE, Mono 2.4 on
> Linux/PPC, and copy the mscorlib.dll from your openSUSE build to
> Linux/PPC, but you cannot e.g. take an mscorlib.dll from Mono 2.0
> (openSUSE packaged version) and run it against a Mono 2.4 runtime.  The
> versions *must* be the same (and this is checked at program startup).

Yes, but I did run the same version (or so I think) version of mscorlib.dll.

Is the problem to with the fact that I took mscorlib.dll for SUSE and 
tried to use it on the PowerPC board?

I matched the version numbers (the directory names?).

How can I concretely determine what version of mscorlib.dll I'm using? 
Lutz Reflector?

> I am wondering how you built and installed on Linux/PPC, as if you
> followed the normal build/install process you should have built (and
> installed) mscorlib.dll, which apparently you don't have.
> Did you configure your PPC/Linux Mono with --disable-mcs-build?  (That
> prevents the assemblies from being built -- very useful for CPU-limited
> platforms like ARM where building all assemblies would take an
> eternity.)


Actually, this was built by a contractor; very hard to get any time from 
him...

Apparently he cross built this as well.

Below are the steps he supposedly followed for the build:

=============================
export 
CC=/opt/freescale/usr/local/gcc-4.0.2-glibc-2.3.6-nptl-2/powerpc-e300c3-linux/bin/powerpc-e300c3-linux-gcc
export 
PATH=/opt/freescale/usr/local/gcc-4.0.2-glibc-2.3.6-nptl-2/powerpc-e300c3-linux/bin/:$PATH

mkdir mono
cd mono

# download mono-2.2.tar.bz2 and glib-2.18.4.tar.bz2

mkdir usr

tar xvfj ./glib-2.18.4.tar.bz2

mkdir bld-glib
cd bld-glib

echo "glib_cv_stack_grows=no" > config.cache
echo "glib_cv_uscore=yes" >> config.cache
echo "ac_cv_func_posix_getpwuid_r=yes" >> config.cache
echo "ac_cv_func_posix_getgrgid_r=no" >> config.cache

.../glib-2.18.4/configure  --host=powerpc-e300c3-linux 
--with-threads=posix --cache-file=config.cache --prefix=${PWD}/../usr

make
make install

cd ..


tar xvfj ./mono-2.2.tar.bz2


mkdir bld-mono
mkdir usr

cd bld-mono

export CFLAGS="-DG_DISABLE_ASSERT"

.../mono-2.2/configure --prefix=${PWD}/../usr/ 
--host=powerpc-e300c3-linux --target=powerpc-e300c3-linux 
--with-tls=pthread --without-sigaltstack --with-gnu-ld

make
make install
=============================

Thanks again Jon.

Chris Plasun


More information about the Mono-list mailing list