This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: embedded MIPS multilib selection or isa level setting error
- To: Ian Lance Taylor <ian at zembu dot com>
- Subject: Re: embedded MIPS multilib selection or isa level setting error
- From: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- Date: Mon, 17 Apr 2000 12:14:04 -0500
- CC: gcc-bugs at gcc dot gnu dot org, binutils at sourceware dot cygnus dot com
- Organization: OAR Corporation
- References: <38FB0F8F.4585530D@OARcorp.com> <20000417160606.7802.qmail@daffy.airs.com>
Ian Lance Taylor wrote:
>
> Date: Mon, 17 Apr 2000 08:20:15 -0500
> From: Joel Sherrill <joel.sherrill@OARcorp.com>
>
> bash-2.03$ mips64orion-rtems-gcc -mcpu=4600 main.c -lc
> /opt/rtems/mips64orion-rtems/bin/ld: warning:
> cannot find entry symbol _start; defaulting to 0000000000400000
>
> But when you change the cpu option to -mcpu=4650 or -m4650, this
> gives an ISA mismatch on the ld.
>
> bash-2.03$ mips64orion-rtems-gcc -mcpu=4650 main.c -lc
> /opt/rtems/mips64orion-rtems/bin/ld: /tmp/ccqIhepE.o:
> ISA mismatch (-mips3) with previous modules (-mips1)
> Bad value: failed to merge target specific data of file /tmp/ccqIhepE.o
> /opt/rtems/mips64orion-rtems/bin/ld: warning:
> cannot find entry symbol _start; defaulting to 0000000000400000
> collect2: ld returned 1 exit status
>
> I take this to mean that main.c->main.o is somehow compiled for
> ISA level 1 and is being linked against an ISA level 3 library.
>
> It's the other way around. main.c was compiled -mips3, but some
> previous object file was compiled -mips1. Since you are getting the
> error when the linker sees main.c, and the linker will normally see
> that before any library, this most likely indicates that some startup
> file is compiled -mips1.
OK. So main.o is correctly -mips3, then this is strictly a matter
of picking up the wrong multilib variant library.
> But to make matters worse, specifying -m4650 and -mcpu=4650 do
> not result in the same multilib variant being selected.
>
> -m4650 selects "single"
> -mcpu=4650 selects "default"
>
> Without knowing the expected behavior here, all I can do is say that
> something is wrong with the current behavior. :)
>
> This is documented. The -mcpu option affects only scheduling, not
> code generation.
So when targetting the 4650, do I need to specify both "-m4650"
and "-mcpu=4650"? Somehow this does not make sense to me.
Besides it still is giving the same result. I can compile
main.c separately (-c) and the error changes to:
/opt/rtems/mips64orion-rtems/bin/ld: main.o:
ISA mismatch (-mips3) with previous modules (-mips1)
So that proves you correct. So is the object in single/ incorrectly
isa level 1? When I do a file on it I see:
$ file /opt/rtems/mips64orion-rtems/lib/single/*.[oa]
/opt/rtems/mips64orion-rtems/lib/single/crt0.o: ELF 32-bit MSB
relocatable,
MIPS R3000_BE, version 1 MathCoPro/FPU/MAU Required
which is different from:
$ file /opt/rtems/mips64orion-rtems/lib/single/*.[oa]
/opt/rtems/mips64orion-rtems/lib/single/crt0.o: ELF 32-bit MSB
relocatable,
MIPS R3000_BE, version 1 MathCoPro/FPU/MAU Required
What stupid thing is going on that I am missing?
--joel
> Ian