* mips gcc compile error : unrecognized opcode errors
@ 2004-03-26 10:29 Shantanu Gogate
2004-03-26 10:36 ` Maciej W. Rozycki
2004-03-26 10:59 ` Chris Dearman
0 siblings, 2 replies; 5+ messages in thread
From: Shantanu Gogate @ 2004-03-26 10:29 UTC (permalink / raw)
To: linux-mips
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mips gcc compile error : unrecognized opcode errors
2004-03-26 10:29 mips gcc compile error : unrecognized opcode errors Shantanu Gogate
@ 2004-03-26 10:36 ` Maciej W. Rozycki
2004-03-29 6:21 ` Shantanu Gogate
2004-03-26 10:59 ` Chris Dearman
1 sibling, 1 reply; 5+ messages in thread
From: Maciej W. Rozycki @ 2004-03-26 10:36 UTC (permalink / raw)
To: Shantanu Gogate; +Cc: linux-mips
On Fri, 26 Mar 2004, Shantanu Gogate wrote:
> 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.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mips gcc compile error : unrecognized opcode errors
2004-03-26 10:29 mips gcc compile error : unrecognized opcode errors Shantanu Gogate
2004-03-26 10:36 ` Maciej W. Rozycki
@ 2004-03-26 10:59 ` Chris Dearman
1 sibling, 0 replies; 5+ messages in thread
From: Chris Dearman @ 2004-03-26 10:59 UTC (permalink / raw)
To: Shantanu Gogate; +Cc: linux-mips
Shantanu Gogate wrote:
> 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.
> 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
--
Chris Dearman The Fruit Farm, Ely Road voice +44 1223 706206
MIPS Technologies (UK) Chittering, Cambs, CB5 9PH fax +44 1223 706250
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mips gcc compile error : unrecognized opcode errors
2004-03-26 10:36 ` Maciej W. Rozycki
@ 2004-03-29 6:21 ` Shantanu Gogate
2004-03-29 12:05 ` Maciej W. Rozycki
0 siblings, 1 reply; 5+ messages in thread
From: Shantanu Gogate @ 2004-03-29 6:21 UTC (permalink / raw)
To: Maciej W. Rozycki, Chris Dearman; +Cc: linux-mips
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.
--- "Maciej W. Rozycki" <macro@ds2.pg.gda.pl> wrote:
> On Fri, 26 Mar 2004, Shantanu Gogate wrote:
>
> > 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.
>
> --
> + Maciej W. Rozycki, Technical University of Gdansk, Poland +
> +--------------------------------------------------------------+
> + e-mail: macro@ds2.pg.gda.pl, PGP key available +
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: mips gcc compile error : unrecognized opcode errors
2004-03-29 6:21 ` Shantanu Gogate
@ 2004-03-29 12:05 ` Maciej W. Rozycki
0 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2004-03-29 12:05 UTC (permalink / raw)
To: Shantanu Gogate; +Cc: Chris Dearman, linux-mips
On Sun, 28 Mar 2004, Shantanu Gogate wrote:
> 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.
> 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.
> 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.
> 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.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-03-29 12:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-26 10:29 mips gcc compile error : unrecognized opcode errors Shantanu Gogate
2004-03-26 10:36 ` Maciej W. Rozycki
2004-03-29 6:21 ` Shantanu Gogate
2004-03-29 12:05 ` Maciej W. Rozycki
2004-03-26 10:59 ` Chris Dearman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox