From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16668 invoked by alias); 2 Nov 2012 14:52:11 -0000 Received: (qmail 16620 invoked by uid 55); 2 Nov 2012 14:51:51 -0000 From: "adivilceanu at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54791] AIX-only: Constructors are not called in main program. Date: Fri, 02 Nov 2012 14:52:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: adivilceanu at yahoo dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg00156.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D54791 --- Comment #4 from Adi 2012-11-02 14:51:50 = UTC --- my attachment as text did not work so I have done it via word doc. ________________________________ From: "adivilceanu@yahoo.com" To: dje at gcc dot gnu.org =20 Sent: Friday, November 2, 2012 4:48 PM Subject: Re: [Bug target/54791] AIX-only: Constructors are not called in ma= in program. After more investigation I saw that I managed to get the constructors calle= d by removing the "inline" keyword from just one constructor of a class that res= ides in my master header. >>From my -Wl,-debug linker options I see that this particular constructor n= ame 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?=C2=A0=C2=A0=20 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 vario= us 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).=20 Now after I did this I am still having some other problems. Some object see= med are not initialized properly.=C2=A0 I am still suspecting the other inlines= might be the culprit. Any ideas/suggestions would be appreciated. ________________________________ From: dje at gcc dot gnu.org To: adivilceanu@yahoo.com=20 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=3D54791 --- Comment #2 from David Edelsohn 2012-10-03 13:4= 6:44 UTC --- Constructors are working because they work without your big header.=C2=A0 I= would try using divide and conquer techniques to reduce the big header and find o= ut what is interfering with constructors.=C2=A0 It gives all appearances that = it is due to the user code. Static constructors and destructors are run by functions generated at link time.=C2=A0 A programmer wrapper around AIX ld called "collect2" scans obje= ct files and libraries for constructors and generates functions that are invoked by = AIX linker -binitfini feature.=C2=A0 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 a= nd destructors so that they do not use the standard pattern?=C2=A0 Or insertin= g some illegal character like dollar sign ($)?