Global constructors innitialized twice?

support for the powerpc toolchain
Post Reply
andoma
Posts: 1
Joined: Wed Jun 16, 2010 2:56 pm

Global constructors innitialized twice?

Post by andoma » Wed Jun 16, 2010 3:07 pm

Hi

It seems to me as the global constructor list is traversed and invoked twice.

Once from __crtmain -> __init -> __do_global_ctors_aux (invoked from lwp code in libogc)
Secondly from main() -> __eabi -> __init -> __do_global_ctors_aux

It seems gcc inserts a call to __eabi in main(). Is this expected? Or am I missing some option to the compiler?

cdmac
Posts: 10
Joined: Tue Jul 13, 2010 8:00 pm

Re: Global constructors innitialized twice?

Post by cdmac » Fri Jul 16, 2010 1:37 am

I've noticed that my Game class (static object) has its constructor called twice. I couldn't work out what was going on as my Windows build only has it called once. Is this a known bug?

Thanks,
Aaron

WinterMute
Site Admin
Posts: 1862
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Global constructors innitialized twice?

Post by WinterMute » Wed Jul 28, 2010 1:14 pm

Yes, known bug, sorry. When I switched to the standard eabi target from the custom powerpc-gekko target I forgot about the insertion of the function to call constructors. I'm planning on another devkitPPC release fairly soon - I'm looking into some other reported issues that are proving to be troublesome to find a consistent testcase for.
Help keep devkitPro toolchains free, Donate today

Personal Blog

cdmac
Posts: 10
Joined: Tue Jul 13, 2010 8:00 pm

Re: Global constructors innitialized twice?

Post by cdmac » Wed Jul 28, 2010 10:01 pm

Cool, I look forward to the new release. I've got a work-around in the meantime so it's not a big deal, but it was quite puzzling!

Thanks,
Aaron

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest