¦^«H¡Gproblems with MIPS cross compiler

potatooo@sunplus.com.tw potatooo@sunplus.com.tw
Wed Mar 17 17:17:00 GMT 1999

> phase. I'm getting ISA mismatches between the code I compile and my
> libraries.
> My compile looks like this.
>    gcc -G 8 -c -mcpu=r4600 -mips3 foo.c
> When I do this objdump --file-headers gives the following output.
>    foo.o:     file format elf32-bigmips
>    architecture: mips:3000, flags 0x00000011:
>    start address 0x0000000000000000
> Notice the architecture line says mips:3000 and not mips:4000.

The problem (I guess) is because that the gcc didn't passed the
"-mcpu=r4600" to the assembler.  You might want to edit the gcc
specs to reflect the fact that r4600 is using mips:4000 inst.
GAS didn't know a r4600 target.

go to check your spec, it will contain lines like this
(may be asm_spec or asm):
%{mcpu=*} %{m4650} %{mmad:-m4650} %{m3900} %{v}
if you want to tell gas use mips3 when r4600, use:
%{mcpu=*} %{m4650} %{mcpu=r4600:-mips3} %{mmad:-m4650} %{m3900} %{v}

it might help.

> If I change the -mcpu type from r4600 to r4000 then objdump and ld
> are happy.
> I've done a little poking around in config/tc-mips.c and didn't see
> anything obvious in there. Does anyone have a clue as to how I can
> fix this? If this is just the way it is what does it mean other than
> a lot of broken makefiles?

New CrossGCC FAQ: http://www.objsw.com/CrossGCC
To remove yourself from the crossgcc list, send
mail to crossgcc-request@cygnus.com with the
text 'unsubscribe' (without the quotes) in the
body of the message.

More information about the crossgcc mailing list