[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [openrisc] or32-uclinux, or32-uclibc and or1ksim



Hi Maunal,

First I will tell you, that you should build the tool chain like it is
described on
http://www.opencores.org/projects/or1k/GNU%20Toolchain%20Port. That
means that not only that you have to build and install binutils and gcc
package, but also uClibc (and because of that you will have to download
and at least configure uClinux). Please, follow the instructions
exactly. After that, you will get good compiler for compiling both,
stand-alone and uclinux applications and also, you will be able to
compile testbench and you will see that it works.

maunal moren wrote:
> Hi, Marko
>  
> I really thank you.
> I downloaded or1ksim from CVS again.
> But, the symptom is the same to previous one.
> It was built and installed without any error, but the testbench can't pass the configuration stage.
> I know that the issue related to compiler and testbench of or1ksim is revival.
> (The issue titled Re:Re:[openrisc] or32 compiler errors)
> I tried severals suggested by Damjan and Marko.
> But, unfortunately, I still can't make a simple file to be compiled.
> As pointed by Damjan and Marko, I built crt0.o and put it in "/opt/or32-uclinux/or32-uclinux/lib".
> After that I compiled two files manually. hereunder error messages generated by compiler:
> ##########################################################################
> [vmlinux:/home/maunal/WORK/or1k/or1ksim/testbench] or32-uclinux-gcc basic.s -o basic

Where did you get basic.s, in the testbench folder there is basic.S (gcc
will recognize *.S as assembler file but not *.s). But this will not
compile either, because you told the compiler to build executable for
its target (in that case uClinux). It will try to include all sorts of
things beside your code (initialization of stdio, preparation for start
and exit, ...). It tries to find this in the crt0.o and libc library,
but because you haven't installed it, will fail. You want to build
stand-alone application, so do like this (even if you don't have uClibc
installed, because you will tell the compiler exactly what to do, and it
will obey):

[simons@odin testbench]$ or32-uclinux-gcc -I./support -c basic.S -o
basic.o
[simons@odin testbench]$ or32-uclinux-gcc -nostdlib -o basic
-T.//default.ld basic.o

Try to run it on the simulator:

[simons@odin testbench]$ or32-uclinux-sim -f default.cfg basic

> basic.s: Assembler messages:
> basic.s:31: Error: too many operands: (0)
> basic.s:31: Error: invalid operands
> basic.s:37: Error: too many operands: (0)
> basic.s:37: Error: invalid operands
> basic.s:51: Error: too many operands: (1)
> basic.s:51: Error: invalid operands
> basic.s:56: Error: too many operands: (1)
> basic.s:56: Error: invalid operands
> 
> [vmlinux:/home/maunal/WORK/or1k/or1ksim/testbench] or32-uclinux-gcc exit.c -o exit
> /opt/or32-uclinux/lib/gcc-lib/or32-uclinux/3.1/../../../../or32-uclinux/bin/ld: cannot find -lc
> collect2: ld returned 1 exit status
> ###########################################################################
> What does the messages mean?

It is serching for libc library, which you didn't install.

> (The first one seems that assmbler can't handle instructions just like  l.addi, r1, r1, MC_CRC(0)...)

*.S/*.s problem.

> Now, I suspect my system, RedHat7.3 (I tried the same work in RedHat7.2 also).
> Is there anyone who succeeded in building and testing compiler(or32-uclinux) system in RedHat 7.3(or RedHat7.2)?

Yes, there is me :)

> If Gil Gamliel see this message, could you tell me the status of your compiler system?
> Regards,
> maunal

Regards, Simon
--
To unsubscribe from openrisc mailing list please visit http://www.opencores.org/mailinglists.shtml