Cross gcc Mailing List Archive

[Prev][Next][Index][Thread]

Re: RTEMS questions




> 2) what to I need to do to get C++ support going. I've turned on support in
> the .cfg file, the cdtest compiles, but bombs out straight away when 
> the program runs. I can run c++ programs OK stand-alone.

Assuming that gcc sets your global constructor's up to be called via
the __main() --> do_global_ctors() technique, then you need to verify
that __main() is being called before cdtest's main_task().  If gcc is
using some other method, then you might want to look at the posix
rtems-ctor.cc and define your own version of invoke_non_gnu_constructors().
The default one is empty.  We have to do this to support HP C++ in our
hppa rtems apps.

Another easy mistake to make here is to have your global constructors
called before malloc() is initialized.  Basically, you have to make sure
rtems_initialize_executive_early() is called and malloc is setup before
calling your global constructors.  This can be tricky to get all the
dependencies right.

Joel> I suspect you are not getting the global constructors run.
Joel> The cdtest does not use global constructors.

cdtest does use global constructors.  Its initial purpose in life was to
verify that we got global constructors & destructors working w/ rtems.

--tony

Follow-Ups:

Home | Subject Index | Thread Index