Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
749 views
in Technique[技术] by (71.8m points)

embedded - Cross-compiling mono for proprietary ARM device

Currently at work, we are developing software for some arm-elf little endian devices. We are currently doing this in plain C, which is a pain. Luckily for us the company who creates the devices provide c++ support, unfortunatly that same company has messed up the c++ libraries so the project fails at linker-stage of compilation, yay!

So lately i've been looking at alternatives, and the most interesting alternative is mono. I can see that compiling mono for arm is mostly done in scratchbox, and this seems like a good alternative. But i can also see that i need to setup rootfs that resembles my device... However, i have no way of finding out what the rootfs is on my device, becouse i cannot connect to it in any way. Will this make it impossible to compile mono using scratchbox? If so, is there another way i can compile mono?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can cross-compile with the usual configure support, something like this:

CC=arm-linux-yourabi-gcc CFLAGS="-march=armv7-a -mfloat-abi=softfp" -DARM_FPU_VFP=1 ./configure --host=arm-linux-yourabi --disable-mcs-build

Of course you need to adjust for your device ABI and floating point support. --disable-mcs-build is needed because you can't run the cross-compiled mono on your system: you can build the class libraries and C# code in a separate tree on your devel box and just copy them to the target.

Also, contrary to what IanNorton writes in the comments, the mono runtime in written in C (there is only a very small binding to llvm in C++, which is not essential, not in the default build and definitely not useful for your setup).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...