[Mono-dev] Build failure on ARMv6/Raspberry Pi with Raspbian/armhf

Fabian Pietsch fabian at canvon.de
Fri Apr 17 15:08:25 UTC 2015


* Jo Shields (Thu, 16 Apr 2015 13:07:06 +0100):
> 
> On 15/04/15 14:21, Fabian Pietsch wrote:
> > Hi,
> >
> > I'm trying to compile Mono GIT mono-3.12.0-branch on the Raspberry
> > Pi (ARMv6), on Raspbian/armhf (Mono 3.2.8), with monolite-111-latest
> > 3.6.1.0 as bootstrap compiler.
> >
> > I'm building like this:
> >
> > mono $ ./autogen.sh --prefix=/usr/local EXTERNAL_MCS="/home/pi/build/mono/mono/mcs/class/lib/monolite/gmcs.exe"
> > [...]
> > mono $ SKIP_AOT=true make EXTERNAL_MCS="/home/pi/build/mono/mono/mcs/class/lib/monolite/gmcs.exe" V=1
> > [...]
> > make[8]: Entering directory '/home/pi/build/mono/mono/mcs/class/corlib'
> > /bin/sh ./../../mkinstalldirs ../../class/lib/build/
> > touch ../../class/lib/build//.stamp
> > MONO_PATH="./../../class/lib/basic:$MONO_PATH" /home/pi/build/mono/mono/runtime/mono-wrapper  ./../../class/lib/basic/basic.exe /codepage:65001 -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC  -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:./../../class/lib/build  -optimize  /noconfig -resource:resources/collation.core.bin -resource:resources/collation.tailoring.bin -resource:resources/collation.cjkCHS.bin -resource:resources/collation.cjkCHT.bin -resource:resources/collation.cjkJA.bin -resource:resources/collation.cjkKO.bin -resource:resources/collation.cjkKOlv2.bin --runtime:v4 -target:library -out:../../class/lib/build/mscorlib.dll  @corlib.dll.sources
> >
> > Unhandled Exception:
> > System.TypeLoadException: Could not load type 'Mono.CSharp.CommandLineParser' from assembly 'basic, Version=3.12.1.0, Culture=neutral, PublicKeyToken=null'.
> > [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: Could not load type 'Mono.CSharp.CommandLineParser' from assembly 'basic, Version=3.12.1.0, Culture=neutral, PublicKeyToken=null'.
> > ../../build/library.make:275: recipe for target '../../class/lib/build/mscorlib.dll' failed
> > make[8]: *** [../../class/lib/build/mscorlib.dll] Error 1
> > [...]
> 
> Don't specify EXTERNAL_MCS.

[...]

> If EXTERNAL_MCS does not exist, and "mcs" does not exist in $PATH, then
> the build system will use mcs.exe from monolite/ using the just-built
> mono in mono/mini - this is the scenario you want.

That worked.  I'd suggest the README.md would be updated, though, as it
specifically says to use monolite with EXTERNAL_MCS for bootstrapping
(under "If you don't have a working Mono installation"). It should say to
remove any existing gmcs from the $PATH, instead.

So, what I did: I cloned the cloned mono repos (to have a fresh start
without losing my previous build results if I should still need them),
then removed all of Raspbian's mono packages from the system.

Then I built like this:

mono_ $ ./autogen.sh --prefix=/usr/local
[...]
mono_ $ make V=1
[...]
make[6]: Entering directory '/home/pi/build/mono/mono_/mcs'
gmcs /warn:0 /out:build/deps/basic-profile-check.exe build/common/basic-profile-check.cs
make[6]: gmcs: Command not found
build/profiles/basic.make:92: recipe for target 'build/deps/basic-profile-check.exe' failed
make[6]: *** [build/deps/basic-profile-check.exe] Error 127
make[6]: Leaving directory '/home/pi/build/mono/mono_/mcs'
*** The compiler 'gmcs' doesn't appear to be usable.
*** You need Mono version 2.10 or better installed to build MCS
*** Check mono README for information on how to bootstrap a Mono installation.
build/profiles/basic.make:60: recipe for target 'do-profile-check' failed
make[5]: *** [do-profile-check] Error 1
[...]

Then:

mono_ $ make get-monolite-latest
[...]
mono_ $ make V=1
[...]
make[6]: Entering directory '/home/pi/build/mono/mono_/mcs'
gmcs /warn:0 /out:build/deps/basic-profile-check.exe build/common/basic-profile-check.cs
make[6]: gmcs: Command not found
build/profiles/basic.make:92: recipe for target 'build/deps/basic-profile-check.exe' failed
make[6]: *** [build/deps/basic-profile-check.exe] Error 127
make[6]: Leaving directory '/home/pi/build/mono/mono_/mcs'
make[6]: Entering directory '/home/pi/build/mono/mono_/mcs'
*** The compiler 'gmcs' doesn't appear to be usable.
*** Trying the 'monolite' directory.
make[7]: Entering directory '/home/pi/build/mono/mono_/mcs'
make[8]: Entering directory '/home/pi/build/mono/mono_/mcs'
Bootstrap compiler: Mono C# compiler version 3.6.1.0
[...]

After that, the build went through without problems.

Now I finally have a Mono that does not crash on WinForms TextBox (or
derived) controls. Adding the Visual Basic support was quite easy
in comparison, with a build time of at most 20 minutes, and without
any problems.

Our Visual Basic WinForms application is finally running on the
Raspberry Pi 1, too[1], now!

[1] (It already ran fine on the Pi 2 with Xamarin Mono 3.12.1 packages
    from mono-project.com Debian APT repository. The Pi 2 is ARMv7 and
    therefore fully supported by non-Raspbian armhf, so no own Mono build
    was necessary there. But on the Pi 1 those packages would only
    segfault. It would be nice if there was an official or semi-official
    "current Mono" repository for ARMv6 / Pi 1, too.)

Regards, Fabian


More information about the Mono-devel-list mailing list