LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cross compiling (https://www.linuxquestions.org/questions/linux-newbie-8/cross-compiling-916758/)

qwerty4061 12-02-2011 07:23 AM

Cross compiling
 
Hi,
i wanted to use glibc-gcc to cross compile from a ubuntu machine (2.6.35) to a mips32r2 platform. While checking the man pages for gcc I can see that there are options like -march which can be set to mips32r2. Does that mean that I dont need to download and build a cross compiler? Can I use the one installed in my machine to cross compile for mips. If this is possible can some one please type out the entire command to compile a simple hello world program for mips

Versions of my utilities are:
kernel : 2.6.35
gcc: 4.4.5.
glibc: 2.12.1
binutils: 2.20.51

Thanks

corp769 12-02-2011 09:30 PM

Have you heard of crosstool-ng before? http://crosstool-ng.org/
I have used this in the past, and worked very well for what I needed to do.

qwerty4061 12-03-2011 08:08 AM

I have heard of crosstool-ng, but that was not my doubt. What I wanted to know was if I want to cross compile for mips, using glibc-gcc do I need to build a cross compiler or can I use the one installed in my PC.

Thanks

theNbomr 12-03-2011 09:03 AM

You need a cross compiler. In fact, you need a cross toolchain, and to create one, I strongly recommend Crosstool-NG.

--- rod.

corp769 12-03-2011 12:35 PM

Quote:

Originally Posted by theNbomr (Post 4541000)
You need a cross compiler. In fact, you need a cross toolchain, and to create one, I strongly recommend Crosstool-NG.

--- rod.

Thanks for saying the same thing I did, in a nutshell ;)

qwerty4061 12-03-2011 01:30 PM

I think my language skills are worse than my linux :P. Let me try to rephrase my question. In the man page for gcc there is something called MIPS Options. What is it?


All times are GMT -5. The time now is 06:30 AM.