How do I compile GCC to generate MIPS code ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I have recently started to study the MIPS architecture. For instance,
I wanted to have GCC compile C code into MIPS assembly and run it in
SPIM. (I have an Intel machine running Linux).

So I want to try something like this:

gcc -Wall -pedantic -S --march=mips1 test.c

in order to have it generate MIPS assembly.

It does not work. All I get is:

cc1: error: bad value (mips32) for -march= switch
cc1: error: bad value (mips32) for -mcpu= switch

Clearly, I need to recompile GCC so it has MIPS in its available
architectures. Remark, this is not cross-compiling, because I want GCC
to run on an i686 machine, it just generates MIPS code.

Can any one help me do this ?

Thank you
Leonel


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux