C++ problems

Joel Sherrill joel.sherrill at oarcorp.com
Fri Mar 2 12:18:39 UTC 2007


John Tilp wrote:
> Leon Pollak wrote:
>   
>> On Wednesday 28 February 2007, John Tilp wrote:
>>     
>>> Leon,
>>>
>>> Confirm that gcc is being invoked with -specs bsp_specs and the -qrtems
>>> option and that your bsp's startfile spec in "bsp_specs" file includes
>>> crtbegin.o
>>>
>>> For more ideas see:
>>> http://www.rtems.org/wiki/index.php/Using_C_Plus_Plus
>>> http://www.rtems.com/ml/rtems-users/2005/february/msg00029.html
>>>       
>> Thank you very much, John. 
>>
>> I see now the problem and I hope I understand in general what should be done.
>> But I am a bit doubting, because:
>> 1. I scanned all the powerpc bsps and was not able to find one that follows 
>> the recommendations you pointed out, except ../shared/start/start.S. I also 
>> understand that this ../shared/start/start.S is for example purpose only. So, 
>> where I can find some working example of this story to check that my 
>> understanding is correct?
>>
>>     
>
>   
powerpc/shared/start/start.S is NOT an example -- it is working code for 
at least
the motorola_powerpc BSP.
> It's safe to assume that all the test and sample code can be built and 
> run successfully. I would look at any of the ppc bsps that have had 
> recent updates.
>
> Review your files libbsp/powerpc/*your_bsp*/bsp_specs and 
> libbsp/powerpc/*your_bsp*/startup/linkcmds and compare them to the ones 
> in the working bsps
>
>   
psim appears runs cdtest correctly for me on the CVS head.  There is 
some required
magic in the bsp_specs and linkcmds to make all of this work.
>> 2. The cdtest seems never worked as it has global constructors and has no 
>> traces of the directions you mentioned. How can it be?
>>
>>     
>
> You say here "it has global constructors" but in your first post you 
> said "CTORS are not called at all (I mean global constructors)."
>
> When you disassemble your cdtest.exe do you find _init() in the .init 
> section? Does it have a bl to __do_global_ctors_aux? If not then 
> something went wrong in the linking process. Note the last line of the 
> Wiki page: "Your gcc configuration, linkcmds and bsp_specs must harmonize"
>
>   
That's a very concise way of saying it.  But unfortunately, the BSP has 
an impact
on whether C++ works or not as expected.
>> So, if you can give me a link of a code example treating theissue, this will 
>> be really great.
>>
>> Best Regards
>>     
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list