Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Anybody cross compiled Mono for MIPS 64 using uClibc?

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.

like image 526
Dale Ragan Avatar asked Nov 05 '22 21:11

Dale Ragan


2 Answers

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.

like image 121
lothar Avatar answered Nov 11 '22 14:11

lothar


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.

like image 42
Dale Ragan Avatar answered Nov 11 '22 13:11

Dale Ragan