On Sat, May 26, 2012 at 12:21 PM, R. Diez <[email protected]> wrote:
> Hi OpenRISC gurus:

Hi Ruben,

>
> What's the status of C++ support for the bare (non-Linux) toolchain? Is the 
> GCC / newlib / libgloss support ready?

My understanding is that it works and actually passes the regression
test with only 4 failures in the most recent version:

http://opencores.org/or1k/Newlib_tool_chain_test_results#C.2B.2B_compiler_2

>
>
> I'm trying to write a simple test case in C++ and I'm having trouble. I have 
> a little experience with linker script files and start-up code, but it's not 
> enough and I haven't been able to figure it out yet. I found no mention of 
> C++ in the OpenRISC ABI.
>
>
> The Test Suite does not use newlib at the moment, and I'm not trying to 
> support the full C++ library, just the basic language features. I guess I'll 
> have to write something like this in the linker script file:
>
>         PROVIDE (__CTOR_LIST__ = .);
>   .ctors      : { *(.ctors) }  /* maybe with SORT(...) */
>         PROVIDE (__CTOR_END__ = .);
>
>
> I'm guessing the OpenRISC port of GCC generates that kind of pointer table, 
> as I think there are other ways. I will also have to write some code that 
> goes through the list of pointerts and calls all the functions.
>
> I suspect supporting C++ exceptions will be harder. I learnt some time ago 
> that GCC is able to generate two types of exception information. With the 
> first type, the code sorts the exception tables itself the first time one is 
> thrown, which can be problematic if you have multiple threads. Therefore, you 
> also have to write support for critical sections and the like in your OS, in 
> a way that the GCC support libraries can use it. There's also the sorting 
> penalty on the first touch.

Unfortunately I can't help you here as I don't understand enough about
the C++ parts of the tool chain, or really how it all works. I'd say
your best bet would be to go with newlib for the C++ stuff. Have you
stuck with custom-made bare-metal libraries for all the other tests
(based on the ORPSoC one or or1ksim or something?)

Cheers

Julius
_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to