OpenCores
no use no use 1/1 no use no use
compiling C++
by ag09 on Aug 24, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012
Hi all,

in the generated toolchain we the compiler or32-elf-g++ hat been generated I am trying to compile a simple HelloWord implemented in class data structure. The application hat been compiled well but I got the following error while executing.

are there any constrictions to compile C++ code?



./meta-test: cannot execute binary file

//helloworld.cpp ================== #include #include using namespace std; class test { public: test(); ~test(); void print(); }; test::test(){} test::~test(){} void test::print(){ cout
RE: compiling C++
by olof on Aug 24, 2011
olof
Posts: 218
Joined: Feb 10, 2010
Last seen: Dec 17, 2018
Are you running it under or1ksim or on a real FPGA board?
RE: compiling C++
by ag09 on Aug 24, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012
Are you running it under or1ksim or on a real FPGA board?


On Or1ksim
RE: compiling C++
by jeremybennett on Aug 24, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Hi ag09,

Can you post the commands you used to compile the program and the Or1ksim command line you used to run it, together with the full error message output. That doesn't look like an Or1ksim error message.

BTW, C++ for OR1K currently only supports statically linked libraries. Many C++ programs assume shared object libraries and dynamic loading are available.

HTH

Jeremy

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

RE: compiling C++
by ag09 on Aug 24, 2011
ag09
Posts: 38
Joined: Aug 22, 2010
Last seen: Jan 13, 2012

Hi ag09,

Can you post the commands you used to compile the program and the Or1ksim command line you used to run it, together with the full error message output. That doesn't look like an Or1ksim error message.



Sorry, I checked it again yet and it works fine. Apologize!!

BTW, C++ for OR1K currently only supports statically linked libraries. Many C++ programs assume shared object libraries and dynamic loading are available.



Which efforts can be needed to allow shared object libraries and dynamic loading to be linking on or1k?

Thanks for your support.

RE: compiling C++
by jeremybennett on Aug 25, 2011
jeremybennett
Posts: 815
Joined: May 29, 2008
Last seen: Jun 13, 2019

Which efforts can be needed to allow shared object libraries and dynamic loading to be linking on or1k?

Hi ag09,

Here are the major things:

  • Agree the PIC ABI for OpenRISC 1000 (there are candidate specs on the Wiki)
  • Completely rewrite binutils
  • Modify GCC to support PIC
  • Extend Linux kernel to support PIC and shared objects (this involves a new pthreads implementation)
  • Implement the dynamic linker/loader.
  • Extend uClibc to allow testing in embedded environments
  • Test

I have a full project plan worked out to do this. The time taken is completely dominated by testing.

One of the past problems with the OpenRISC tool chain is that it has been implemented, but not properly tested. There has also been a substantial amount of code that does not follow the GNU design and coding conventions, making for tools that break badly as you try to migrate them to new versions. It is also code that could never be committed to the mainline GNU tool chain distribution.

Over the past year or so, Joern Rennecke and I worked on GCC for C/C++ with static libraries, so it is now reasonably reliable and complies with the GNU design conventions, although the static pthreads library gets some things wrong. That work has revealed how very broken the binutils implementation is, although we have fixed some of the most egregious errors.

The uClibc implementation, which is used for all applications running on Linux is to all intents and purposes untested. The only tests which have been run are those which are consequent on running the GNU regression tests (which allowed us to fix some bugs). uClibc has a regression test suite, but until recently it was only capable of running with dynamic libraries and natively. We've fixed the test suite so it can handle static libraries. However we need to write a DejaGnu harness that will allow the tests to be run against a remote embedded target.

So a key OpenRISC objective for the future is that we only allow properly tested tools into the code base. It is not terribly useful to have the latest feature, if it brings with it several thousand regression test failures.

Hope this explains what is needed.

Jeremy

no use no use 1/1 no use no use
© copyright 1999-2026 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.