Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Compile C into MIPS [duplicate]

I am trying to compile a file of C code into mips assembly. My OS is suse linux and I already have gcc and cross-mips-binutils installed - I simply don't know what commands to use to cross-compile into mips.

I already used:

gcc -S text.c -o text.s

and it compiled fine - just not into mips. I also looked through other posts here on stack overflow like: How to cross-compile for MIPS? but either they are not helpful or like this one, the helpful links don't work anymore.

I would appreciate any help! Thanks :)

like image 746
ec-m Avatar asked Oct 20 '22 08:10

ec-m


1 Answers

cross-mips-binutils is not sufficient for compilation, only linking, creating archives, etc. You need cross-mips-gcc in order to generate MIPS assembly.

like image 58
Brian Cain Avatar answered Oct 23 '22 02:10

Brian Cain