I am trying to statically cross compile Mono for MIPS. I am able to compile Mono, but it is always dynamically linked with it's dependencies, even though I specify static to the compiler.
I wrote a test program and I am able to statically compile it with my toolchain and run it on the target platform. I am not sure if I am missing something or if it isn't possible. I built my toolchain using buildroot.
EDIT
To make things a little more clear, I would like to statically compile mono with it's dependencies. The dependencies that mono rely's on are: GLib, pkg-config, and gettext. I believe GLib is a direct dependency and GLib depends on pkg-config and gettext.
I can post my environment variables and configure command if needed.
In order to get a fully statically linked Mono you will have to build all it's dependencies (and their dependencies recursively) as static libraries first. Only then you can build a truly static Mono.
Well, it's been a while since I tried this, but I wanted to report what I learned. For one, I found out that the MIPS processor is 64-bit and not 32-bit like I was initially told for the embedded device that I was targeting. Second, when I was working on this, Mono didn't have MIPS 64-bit support yet. After a little research, I saw that a group at N-iX was porting Mono to support the MIPS 64-bit architecture based off the 32-bit port that was already done. The 64-bit port was being done for a company called SiCortex, Inc. and N-iX was trying to get their patches applied to the main Mono development trunk. You can check this forum thread out for more information. I posted stating I wanted to help with testing, but I never got a response.
As far as statically compiling Mono, I learned that Mono uses libtool for linking it's libraries together. I will need to learn more about this tool, before trying to statically compile. I stopped after learning that Mono didn't support MIPS 64-bit yet. I will also need to see if the 64-bit port patches ever got applied to Mono.
I hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With