1/1

|
or32 Link Problem
by mojtabaebrahimi85 on Mar 5, 2012 |
mojtabaebrahimi85
Posts: 11 Joined: Jan 15, 2012 Last seen: Mar 18, 2013 |
||
|
I want to compile the MiBench testbenches and run them on OpenRISC processor. When I am running testbenches located in test directory, everything is fine and I have desired outputs. However, when I want to compile a simple qsort program, I got some errors like
undefined reference to `strcmp' undefined reference to `qsort' It seems that there is a link problem in or32 compiler. Regards, Mojtaba |
|||
|
RE: or32 Link Problem
by julius on Mar 9, 2012 |
julius
Posts: 363 Joined: Jul 1, 2008 Last seen: May 17, 2021 |
||
|
You're going to need to give us more information. A log of everything you've done and a better explanation of how you're intending on compiling and running the benchmark software would be good.
You can attach the log of the compile to the post or put it on pastebin.com Thanks Julius |
|||
|
RE: or32 Link Problem
by mojtabaebrahimi85 on Mar 26, 2012 |
mojtabaebrahimi85
Posts: 11 Joined: Jan 15, 2012 Last seen: Mar 18, 2013 |
||
|
Thanks for your help.
Actually, I am trying to compile some benchmarks of Mibench. Since I don't know how to compile a benchmark with multiple files, I gather all source code in one file. It is compiled with gcc without any problem. But when I am trying to compile it using the following command: make rtl-test TEST=or1200-mibenchbasicmath I get the following massages: ### Compiling software ### make[1]: Entering directory `/home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim' /tmp/cccJeeMw.o: In function `SolveCubic': /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:77: undefined reference to `sqrt' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:77: undefined reference to `pow' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:69: undefined reference to `sqrt' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:69: undefined reference to `acos' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:70: undefined reference to `sqrt' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:70: undefined reference to `cos' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:71: undefined reference to `sqrt' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:71: undefined reference to `cos' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:72: undefined reference to `sqrt' /home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim/or1200-mibenchbasicmath.c:72: undefined reference to `cos' collect2: ld returned 1 exit status make[1]: *** [or1200-mibenchbasicmath.elf] Error 1 make[1]: Leaving directory `/home/ubuntu/Desktop/OpenRISC/orpsocv2/sw/tests/or1200/sim' make: *** [/home/ubuntu/Desktop/OpenRISC/orpsocv2/sim/run/../../sw/tests/or1200/sim/or1200-mibenchbasicmath.vmem] Error 2 or similarly when I am trying to compile quicksort benchmark, I got some messages that it cannot access the strcmp function, while I have already included the string.h It seems that I cannot use functions in some header files.
or1200-mibenchbasicmath.c (4 kb)
|
|||
|
RE: or32 Link Problem
by julius on Mar 27, 2012 |
julius
Posts: 363 Joined: Jul 1, 2008 Last seen: May 17, 2021 |
||
|
You're compiling against the ORPSoC C library, which is far from a complete C library.
You will probably want to compile against the newlib C library, which does have proper string and maths functions. |
|||
|
RE: or32 Link Problem
by mojtabaebrahimi85 on Mar 27, 2012 |
mojtabaebrahimi85
Posts: 11 Joined: Jan 15, 2012 Last seen: Mar 18, 2013 |
||
|
Thanks a lot for your answer.
But how I can compile against the newlib C library? |
|||
|
RE: or32 Link Problem
by julius on Mar 27, 2012 |
julius
Posts: 363 Joined: Jul 1, 2008 Last seen: May 17, 2021 |
||
|
If you compile a tool chain from the source in the SVN at the moment, you'll just need to run the or32-elf-gcc executable on the C file and it should compile and be executable in the simulator.
A relatively new tutorial on compiling and running C programs on bare metal can be found here: http://www.rte.se/blog/blogg-modesty-corex/writing-application-program |
|||
|
RE: or32 Link Problem
by julius on Mar 27, 2012 |
julius
Posts: 363 Joined: Jul 1, 2008 Last seen: May 17, 2021 |
||
|
If you compile a tool chain from the source in the SVN at the moment, you'll just need to run the or32-elf-gcc executable on the C file and it should compile and be executable in the simulator.
A relatively new tutorial on compiling and running C programs on bare metal can be found here: http://www.rte.se/blog/blogg-modesty-corex/writing-application-program |
|||
1/1

