C compilation for Mips architecture

I saw several ways to do this (and so far I have not tried a couple, but I want to isolate this for easier)

This is supposed to be a way to do this VIA gcc, and I would prefer that I just keep pounding the walls.

I use debian7 and can use what has ever been a different flavor (I currently want to avoid qemu casue, I want something less). I follow this example found here.

http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/

I was able to do everything, and during part of this I had to set libgmp3c2-dummy_1.0_all.deb to continue ti

only now I need to compile, and all I compile is the simple world of hello script, however when compiling I can not force libgmp.so.3 not to be in the / usr / lib / dir directory, however one in the / usr / folder lib / mips -linux-gnu-gcc. It seemed to me that I would copy it to see if it should be compiled, and I understand that this elf file is encoded in big-endian, which makes sense. but what am I missing to compile this file?

and I tried to compile this thing as a big endian. I think that I am either confused from libraries, or that I need to distinguish libgmp.so.3 ..

Also I tried apt-get install libgmp-dev libgmp3-dev too.

Thanks for the help, if you can! :), and if you know an easy way to do this that won’t take up a lot of space on my machine, then I’m open, but I would like to try with GCC and use the tool chain.

Thanks!

+4
source share
3 answers

Well, I managed to compile MIPS in Debian. Edit I want to improve this answer for usability for others ...

1. deb http://www.emdebian.org/debian stable main to /etc/apt/sources.list 2. apt-get update. 3. install libgmp3c2 from https://packages.debian.org/squeeze/libgmp3c2 4. apt-get install gcc-4.3-mips-linux-gnu libgmp3c2-mips-cross this worked 

then just mips-linux-gnu-gcc file .c -o executable

What is it.

PS, if you work with routers .... use the -static option when compiling. So in the end it looked like

 mips-linux-gnu-gcc -EB -march=34kc -static test.c -o test 

If you have problems with the public keyring, which is not recognized, use the emdebian-archive-keyring package, which can be installed using apt.

+6
source

Why not just install the free Mentor / Codesourcery gcc MIPS cross-compiler instead of trying to build it from scratch?

When you have the MIPS cross compiler installed, you must install the MIPS libraries in the appropriate directory for the cross compiler and not in the /usr/lib directory to install your Linux host. You cannot use apt-get to try installing MIPS libraries, since this tool can only install libraries for installing the Linux host.

+2
source

You can refer to this post Configuring the cross-compiler for MIPS-I version 1 , since this seems to be the easiest solution to your problem, because you just want to cross the -computer for MIPS (see also its answer to the question). Notice, I have not tested it.

I built GCC to show the source in the MIPS assembly from my ARM processor, but I can no longer find the manual. But you might also want to learn gcc for cross-compiling. I will update this post in a few days, as it intrigued me to write a simple HOWTO, configured MIPS cross-compiler.

0
source

Source: https://habr.com/ru/post/1485251/


All Articles