http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54791
--- Comment #4 from Adi <adivilceanu at yahoo dot com> 2012-11-02 14:51:50 UTC --- my attachment as text did not work so I have done it via word doc. ________________________________ From: "adivilce...@yahoo.com" <adivilce...@yahoo.com> To: dje at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> Sent: Friday, November 2, 2012 4:48 PM Subject: Re: [Bug target/54791] AIX-only: Constructors are not called in main program. After more investigation I saw that I managed to get the constructors called by removing the "inline" keyword from just one constructor of a class that resides in my master header. >From my -Wl,-debug linker options I see that this particular constructor name is used to generate the dynamic initialization in almost every object file. See debug.txt attached for more details. Look for "_GLOBAL__I_65535_0__ZN5TraceD2Ev". Do you know why would that be? Is this a bug ? Do you know why on Linux with the same compiler version and same code is not happening? I have around 1000 member functions that are declared "inline" across various classes. Do you know if there are any know issues with inline and constructors? Any compiler options I should be aware of? I am not using any optimization (yet .. I am planning to). Now after I did this I am still having some other problems. Some object seemed are not initialized properly. I am still suspecting the other inlines might be the culprit. Any ideas/suggestions would be appreciated. ________________________________ From: dje at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org> To: adivilce...@yahoo.com Sent: Wednesday, October 3, 2012 4:46 PM Subject: [Bug target/54791] AIX-only: Constructors are not called in main program. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54791 --- Comment #2 from David Edelsohn <dje at gcc dot gnu.org> 2012-10-03 13:46:44 UTC --- Constructors are working because they work without your big header. I would try using divide and conquer techniques to reduce the big header and find out what is interfering with constructors. It gives all appearances that it is due to the user code. Static constructors and destructors are run by functions generated at link time. A programmer wrapper around AIX ld called "collect2" scans object files and libraries for constructors and generates functions that are invoked by AIX linker -binitfini feature. You can add -Wl,-debug to the link line to see the way the AIX linker is invoked and see the helper function. Is something in the big header changing the mangled names of constructors and destructors so that they do not use the standard pattern? Or inserting some illegal character like dollar sign ($)?