[Mono-dev] Cross-compile mono to MIPS SOC w/CodeSourcery 3.93?

the mad mole madmole at gmail.com
Wed Apr 4 04:06:17 UTC 2012


Thanks for the tips... After some additional futzing, I've gotten very
close.  Everything compiles, but native links fail with messages like
"librt.so: could not read symbols: File in wrong format".  I determined
this is because the "-Wl,-EL" flags I specify for the compiles aren't being
passed on to libtool.  libtool is smart enough to pull in the little-endian
libraries, but without the link flag it generates this error because it
expects everything to be big endian.

When I manually extracted the actual link command line generated by libtool
(by removing the --quiet arg) to a script, and manually edited in "-Wl,-EL"
I was able to successfully create libmono-2.0.so.1.0.0.  So my question is,
anyone know how can I pass link flags into libtool?

TIA --- TMM

On Wed, Mar 28, 2012 at 4:21 PM, Autif Khan <autif.mlist at gmail.com> wrote:

> >> Hello---
> >>
> >> I'm trying to cross-compile mono 2.10.2 from the source tarball.  My
> build
> >> machine is an x86 Linux PC running Fedora (could use one of the other
> >> distros of that makes things easier).  The target is a SOC with a
> vanilla
> >> MIPS 24Kc core (little-endian, no FPU).
> >>
> >> I found some instructions for ARM (http://mono-project.com/Mono%3aARM &
> >> http://stackoverflow.com/questions/4955314/cross-compile-mono-for-arm)
> which
> >> I tried to adapt for MIPS, but have come up short.  I'll spare the error
> >> messages, but it dies in ./configure.  I believe the root cause is not
> >> setting the right combination of environment variables for confogure to
> >> properly use the CodeSourcery 3.93 toolchain.
> >>
> >> Specifically, I don't see (from looking at the output of ./configure
> --help)
> >> how to override the default x86 headers and libraries, which would be
> needed
> >> in addition to the compiler, linker, etc.  Does anyone have more
> detailed
> >> instructions on how I might accomplish this?  I am not a newbie, but am
> >> somewhat new to cross-compiling.  The tutorial information I've been
> able to
> >> find on automake, etc, is very general.
> >>
> >> If I get enough hints to pull this off I'll be happy to write up a
> detailed
> >> Wiki by way of compensation.
> >>
> >> Thx in advance---
> >>
> >> Maadmole
> >> ================
> >>
> >> _prefix=mips-linux-gnu
> >> export CC=$CSRC_ROOT/${_prefix}-gcc
> >> export CXX=$CSRC_ROOT/${_prefix}-g++
> >> export CPP=$CSRC_ROOT/${_prefix}-cpp
> >>
> >> ./configure --prefix=/usr/local --disable-mcs-build --host=mipsel
> >> --enable-minimal=profiler,debug,logging,soft_debug --without-mcs-docs
> >> --disable-mono-debugger
> >>
> >
> > See of the following config options work for you.
> >
> > I use them for my embedded mono (x86 and arm)
> >
> > --disable-mcs-build mono_cv_uscore=no --with-tls=pthread
> > --with-sigaltstack=no --with-mcs-docs=no
>
> Oh, I also had to apply a few patches - they are included below. The
> last one will not be required for 2.10.11
>
> --- mono-2.10.8.1.orig/Makefile.am      2012-01-25 14:24:43.564002232 -0500
> +++ mono-2.10.8.1/Makefile.am   2012-01-25 14:25:02.036002218 -0500
> @@ -4,10 +4,10 @@
>  MOONLIGHT_SUBDIRS = $(libgc_dir) eglib/src mono
>
>  if CROSS_COMPILING
> -SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) data runtime
> scripts man samples msvc $(docs_dir)
> +SUBDIRS = po $(libgc_dir) eglib mono $(ikvm_native_dir) support data
> runtime scripts man samples msvc $(docs_dir)
>  # Keep in sync with SUBDIRS
>  ## 'tools' is not normally built
> -DIST_SUBDIRS = po libgc eglib mono ikvm-native         data runtime
> scripts man samples tools msvc docs
> +DIST_SUBDIRS = po libgc eglib mono ikvm-native support data runtime
> scripts man samples tools msvc docs
>  else
>  if ONLY_MOONLIGHT
>  SUBDIRS = $(MOONLIGHT_SUBDIRS) runtime
>
> --- mono-2.10.8.1.orig/data/config.in   2012-01-27 09:29:07.072001924
> -0500
> +++ mono-2.10.8.1/data/config.in        2012-01-27 09:30:59.740001933
> -0500
> @@ -15,7 +15,7 @@
>        <dllmap dll="i:msvcrt.dll" target="@LIBC@" os="!windows"/>
>        <dllmap dll="sqlite" target="@SQLITE@" os="!windows"/>
>        <dllmap dll="sqlite3" target="@SQLITE3@" os="!windows"/>
> -       <dllmap dll="libX11" target="@X11@" os="!windows" />
> +       <dllmap dll="libX11" target="libX11.so.6" os="!windows" />
>        <dllmap dll="libcairo-2.dll" target="libcairo.so.2" os="!windows"/>
>        <dllmap dll="libcairo-2.dll" target="libcairo.2.dylib" os="osx"/>
>        <dllmap dll="libcups" target="libcups.so.2" os="!windows"/>
>
> --- mono-2.10.8.1.orig/mcs/class/Makefile       2012-01-27
> 16:20:36.319297999 -0500
> +++ mono-2.10.8.1/mcs/class/Makefile    2012-01-27 20:37:30.867593825 -0500
> @@ -55,10 +55,8 @@
>        Novell.Directory.Ldap           \
>        Mono.Security.Win32             \
>        System.DirectoryServices        \
> -       RabbitMQ.Client                 \
>        Mono.Messaging                  \
>        System.Messaging                \
> -       Mono.Messaging.RabbitMQ         \
>        System.ServiceProcess           \
>        System.Drawing.Design           \
>        System.Design                   \
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-devel-list/attachments/20120403/092939ec/attachment.html>


More information about the Mono-devel-list mailing list