Unable to cross compile Mono for ARM

Over the past three days, I have been trying to cross-compile Mono 2.11.4 for a TechNexion Blizzard board (running an unknown version of Angstrom) using virtual Ubuntu (12.04) on my 32-bit Win7 machine and CodeSourcery Sourcery g ++ ARM toolchain, but with little success. I followed every training course on the Internet, but it just doesn't work.

The CodeSourcery Sourcery g ++ and Scratchbox2 software chain (compiled from the latest git sources) are installed and working. Scratchbox2 configured it using

sb2-init armv7 /home/dev/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc 

while in the correct directory (~ / CodeSourcery / Sourcery_g ++ _ Lite / arm-none-linux-gnueabi / libc).

I can compile a simple "Hello world" (cpp), compile and run it on the board. In Ubuntu:

 file hello hello: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped 

I downloaded the source for Mono 2.11.4 and followed one of the instructions. The first part (on a native machine) works well, no errors. However, when I run the second part (compilation for ARM) ./configure works as expected, but then crashes with "../lib/mini [some_file] incompatible with hand release" . the file in these files says that they are really Intel 80386 executables, but I don’t know why.

So, the next step was to run make clean and repeat the steps, but it still gave the same result.

Then I tried ./configure and do it all inside sb2 and it seems to work first. But then some errors failed:

 ./.libs/libmini.a(libmini_la-mini-arm.o): In function `mono_arch_init': /home/dev/source/host-mono/mono-2.11.4/mono/mini/mini-arm.c:689: undefined reference to `debugger_agent_single_step_from_context' /home/dev/source/host-mono/mono-2.11.4/mono/mini/mini-arm.c:689: undefined reference to `debugger_agent_breakpoint_from_context' /home/dev/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-ld: .libs/libmono-2.0.so.1.0.0: hidden symbol `debugger_agent_single_step_from_context' isn't defined /home/dev/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-ld: final link failed: Nonrepresentable section on output 

Any ideas on what I'm doing wrong, or any textbook tips I might have missed?

// Anders

+5
source share
2 answers

Better use ScratchBox to compile your own code.

 [sbox-ARMEL: ~] > mkdir cross [sbox-ARMEL: ~] > cd cross [sbox-ARMEL: ~] > tar xzf ../mono-x.xx.tar.gz [sbox-ARMEL: ~] > cd arm-mono-x.xx [sbox-ARMEL: ~] > ./configure --disable-mcs-build [sbox-ARMEL: ~] > make [sbox-ARMEL: ~] > make install DESTDIR=`pwd`/tmptree 

on the other hand, open a new terminal and create a managed code.

 $ mkdir host-mono $ cd host-mono $ tar xzf ../mono-1.xx.tar.gz $ cd mono-1.xx $ ./configure $ make $ make install DESTDIR=`pwd`/tmptree 
+1
source

You have to be very careful which headers and libraries you compile when you cross-compile, or you may run into bizarre and counter-intuitive runtime crashes caused by binary library incompatibilities. That being said, Linux ARM distributions play very safely with binary compatibility - usually at the expense of performance.

It is possible that you create against your headers and host libraries of developers' hosts, therefore, an architecture mismatch.

You can simply find that the pre-created opkg images work. Angstrom provides ready-made packages for you. It can be as simple as installing a network from the Angstrom package repository.

If you find that you need to create the source code, one simple solution to your problem would be to create a build environment for Angstrom and use it to create mono. The easiest way to do this is to get the finished image (and image for development) from the online image builder Angtrom . With any luck, there is one for your board.

0
source

All Articles