OpenCores
First Prev 2/2 no use no use
RE: OpenRisc ToolChain & Simulator
by jeremybennett on Oct 29, 2010
jeremybennett
Posts: 718
Joined: May 29, 2008
Last seen: May 22, 2012

Hi Hardik

You're the second person this week to trip over this error. The application note doesn't make it clear that this is a section to add to a standard simulator config file, not the complete config file. Consequently no memory is being specified.

I've attached a config file you can use. This should be included in future releases.

HTH

Jeremy

simple.cfg (3 kb)
RE: OpenRisc ToolChain & Simulator
by jylai1982 on Feb 28, 2011
jylai1982
Posts: 10
Joined: Feb 21, 2011
Last seen: May 22, 2012
Hi, Jeremy,

I try to build the example models in Embecosm application note 1, and I have the same problem as Hardik.
libtool: link: or32-elf-gcc -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -T../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/default.ld -o hello hello.o ./.libs/libboot.a
./.libs/libboot.a(start.o): In function `_start':
start.s:(.boot-text+0x110): undefined reference to `_main'
collect2: ld returned 1 exit status
make[3]: *** [hello] Error 1
make[3]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build'
make: *** [all] Error 2

I use the or1ksim (svn ver. 2011-02-24) and its toolchain to build the example.
As you mentioned, the application note 1 should be built with or1ksim 0.4.0.
However, I have the same problem as the following page when building or1ksim 0.4.0.
http://opencores.org/bug,view,1815

Is there any solution?

Thanks a lot!
RE: OpenRisc ToolChain & Simulator
by jeremybennett on Feb 28, 2011
jeremybennett
Posts: 718
Joined: May 29, 2008
Last seen: May 22, 2012
Hi, Jeremy,

I try to build the example models in Embecosm application note 1, and I have the same problem as Hardik.
libtool: link: or32-elf-gcc -Wall -Werror -g -nostdlib -mhard-div -mhard-mul -T../../esp1-tlm2-or1ksim-examples-2.0/progs-or32/default.ld -o hello hello.o ./.libs/libboot.a
./.libs/libboot.a(start.o): In function `_start':
start.s:(.boot-text+0x110): undefined reference to `_main'
collect2: ld returned 1 exit status
make[3]: *** [hello] Error 1
make[3]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build/progs-or32'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/shah/projects/or1ksim/embecosm/build'
make: *** [all] Error 2

I use the or1ksim (svn ver. 2011-02-24) and its toolchain to build the example.
As you mentioned, the application note 1 should be built with or1ksim 0.4.0.
However, I have the same problem as the following page when building or1ksim 0.4.0.
http://opencores.org/bug,view,1815

Is there any solution?

Thanks a lot!

Hi jylai1982

Oh dear. The application note has not kept up with the changes to the OpenRISC tool chain. We made a major change late last year in the format of compiled code. Global C symbols used to be prefixed by '_'. In line with most modern compilers, we've dropped this, but it means any legacy assembler code which calls into the C code will break.

This includes the examples in this application note. Your solution is to find the assembler source files, and where they call C functions, with '_' prefixed, remove the '_'.

I shall update this application note later in the year to bring it in line with the latest compiler, and also to make it work with Or1ksim 0.5.0.

Hope this allows you to make progress.

Best wishes,

Jeremy

--
Tel: +44 (1590) 610184
Cell: +44 (7970) 676050
SkypeID: jeremybennett
Email: jeremy.bennett@embecosm.com
Web: www.embecosm.com

First Prev 2/2 no use no use
© copyright 1999-2012 OpenCores.org, equivalent to ORSoC AB, all rights reserved. OpenCores®, registered trademark.