Skip to contentSkip to conversation

mips gcc compile error : unrecognized opcode errors

DISCUSSION Shantanu Gogate 3 participants 5 messages Mar 26, 2004 – Mar 29, 2004 MIPS

lore
Share & tools
lore
#0 lore raw

Hi,
I am trying to cross compile a user mode application for mips and I am getting these error messages when trying to do that:

/tmp/ccgvdHuk.s: Assembler messages:
/tmp/ccgvdHuk.s:1270: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:1270: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode setcb $25'

These occur on a specific file always, other c files seem to compile just fine. I tried using 'sdelinuxeb-5.03.06-1' AND 'sdelinux-5.01-4eb' and both bail out in gcc with the same messages at the same location.
My CFLAGS look like this:
CFLAGS += $(shell $(CC)-print-search-dirs | sed -ne "s/install: *\(.*\)/-I\1include/gp") -I /work/GLIBC/usr/include/ -I /work/linux-2.4.25/include/ -Wa,-mips3 -mcpu=r4600 -mips2 -Wa,-32 -Wa,-march=r4600 -Wa,--trap

I was able to successfully cross compile the kernel and busybox using the same cross toolchain(although i needed to use 5.03 for busybox). I am running these on a redhat 7.3 box (alse tried on 9.0), although I doubt if that really matters and its just the sdelinux version that matters. My GLIBC for cross compile is from glibc-devel-2.2.5-42.1.mips.rpm.

Any pointers on the one (or many) thing(s) I could be doing wrong to get these error messages ? Is there a 'comprehensive' one stop location where i can download binaries/source for doing mipseb cross compile activities (i.e glibc + gcc+ binutils+ ...) and work.

All help would be appreciated:)

regards,
Shantanu.

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

#1 lore raw
Quoted 10 lines · Shantanu Gogate

I am trying to cross compile a user mode application for mips and I am getting these error messages when trying to do that:

/tmp/ccgvdHuk.s: Assembler messages:
/tmp/ccgvdHuk.s:1270: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:1270: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode setcb $25'

These are not MIPS instructions. Make sure the file is built with a
compiler for the MIPS target. There's likely a bug in your Makefile.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +
#4 lore raw
In reply to Shantanu Gogate
Quoted 11 lines · Shantanu Gogate

Hi,
I am trying to cross compile a user mode application for mips and I am getting these error messages when trying to do that:

/tmp/ccgvdHuk.s: Assembler messages:
/tmp/ccgvdHuk.s:1270: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:1270: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode setcb $25'

These aren't MIPS opcodes. If they've been generated by the compiler
then something is going badly wrong... Could you rebuild this file with the extra flags "-v --save-temps" and send me the compiler output and the .i file generated by the compiler.

Quoted 2 lines

I was able to successfully cross compile the kernel and busybox using the same cross toolchain(although i needed to use 5.03 for busybox). I am running these on a redhat 7.3 box (alse

What problems did you have building busybox with 5.06? Please send
me details of this as well.

Chris

Signature · 2 lines
Chris Dearman          The Fruit Farm, Ely Road    voice +44 1223 706206
MIPS Technologies (UK) Chittering, Cambs, CB5 9PH  fax   +44 1223 706250
#2 lore raw
In reply to Maciej W. Rozycki

Hi guys,
Thanks for your replies ! Sure enough, the problem I mentioned about unrecognized opcodes was caused by screwed up Makefiles(include from standard host includes was erroneously taking place). I am past that hurdle now but facing a different problem:

1. I started getting some pretty weird unresolved symbol messages, which i figured was happening because it was not taking in libc.a and libgcc.a. This was happening although I had placed the libc.a and libgcc.a dir in the libsearch dir using the '-L' flag to gcc.

2. So I gave the libc.a and libgcc.a path directly on the command prompt and it did build the binary file but gave warning that
'cannot find entry symbol __start; defaulting to 0000000000400090'
I guess this is because it cannot find crt1.o or the other crt*.o files ?
So, maybe even though I have got the binary file, it won run properly since it 'defaulted' the start address to something.

3. My situation is like this : I have got the 'usr' directory from 'glibc-devel-2.2.5-42.1.mips.rpm' placed in a directory called '/work/GLIBC/' and I have 'sdelinux 5.03eb installed' on my redhat 7.3 host machine. Can you guys tell me how I need to setup the Makefiles for that app so as to get a clean build ? If this is out of your domain can you point me to some resources (other than gcc man pages ;) ) which talks about setting up cross-compile environments ?

Chris:
as for your question about what problems I faced compiling busybox with sdelinux-5.01 (not 5.06 as u said):
there is some code (i forgot the location now) which uses flexible length arrays in a struct and there are 2 such arrays declared in a struct one after the other as the last two entries in that struct. gcc used to bail out here cribbing that 'flexible length array not at end of struct'. After going thru a few posts I stumbled upon your reply
(http://www.linux-mips.org/archives/linux-mips/2003-11/msg00015.html) where u said that it was fixed in updated version of compiler. (i was compiling busybox-1.00-pre4). using 5.03 i did not face this problem.

thanks in advance,
/shantanu.

Quoted 17 lines · --- "Maciej W. Rozycki
Quoted 10 lines · Shantanu Gogate

I am trying to cross compile a user mode application for mips and I am getting these error messages when trying to do that:

/tmp/ccgvdHuk.s: Assembler messages:
/tmp/ccgvdHuk.s:1270: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:1270: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3124: Error: unrecognized opcode setcb $25' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode btl $4,0($2)' /tmp/ccgvdHuk.s:3769: Error: unrecognized opcode setcb $25'

These are not MIPS instructions. Make sure the file is built with a
compiler for the MIPS target. There's likely a bug in your Makefile.

Review

Quoted 3 lines
(quoted diff) +3 -0
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html

#3 lore raw
Quoted 4 lines · Shantanu Gogate

1. I started getting some pretty weird unresolved symbol messages, which i figured was happening because it was not taking in libc.a and libgcc.a. This was happening although I had placed the libc.a and libgcc.a dir in the libsearch dir using the '-L' flag to gcc.

You should have your libgcc.a in the directory gcc installation put it.
And you should have libc.a and other libraries in a library directory recognized by gcc -- `gcc -print-search-dirs' should help. Other setups are possible, but this one should be the least troublesome.

Quoted 4 lines

2. So I gave the libc.a and libgcc.a path directly on the command prompt and it did build the binary file but gave warning that 'cannot find entry symbol __start; defaulting to 0000000000400090' I guess this is because it cannot find crt1.o or the other crt*.o files ?

The symbol is defined by crt1.o for normal programs. For MIPS this
startup file comes with glibc, so it should be in the same directory as libc.a.

Quoted 2 lines

So, maybe even though I have got the binary file, it won run properly since it 'defaulted' the start address to something.

It won't run as it misses startup code.

Quoted 7 lines

3. My situation is like this : I have got the 'usr' directory from 'glibc-devel-2.2.5-42.1.mips.rpm' placed in a directory called '/work/GLIBC/' and I have 'sdelinux 5.03eb installed' on my redhat 7.3 host machine. Can you guys tell me how I need to setup the Makefiles for that app so as to get a clean build ? If this is out of your domain can you point me to some resources (other than gcc man pages ;) ) which talks about setting up cross-compile environments ?

If the Makefiles are sane as well as your development environment, then
all you need to do is to define CC to your cross-compiler. This is especially true if the program uses autoconf -- but you need to set the host properly on the `./configure' invocation.

Signature · 3 lines
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email protected], PGP key available        +