From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11009 invoked by alias); 7 Nov 2012 01:27:15 -0000 Received: (qmail 10969 invoked by uid 48); 7 Nov 2012 01:27:01 -0000 From: "dje at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/54791] AIX-only: Constructors are not called in main program. Date: Wed, 07 Nov 2012 01:27: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: dje at gcc dot gnu.org X-Bugzilla-Status: NEW 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" 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/msg00537.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54791 --- Comment #16 from David Edelsohn 2012-11-07 01:27:00 UTC --- G++ should create one specially named _GLOBAL__I_NNNNN_XXXXX function per constructor. collect2 sorts the constructors based on the NNNNN priority number encoded in the name. If G++ is not creating separate constructors, then that is a general G++ question and not AIX-specific. As far as the problem with shared libs, this is a known, general deficiency in AIX. This is what I referenced in comment #13. AIX runs initializers breadth-first, not depth-first. There is another GCC Bugzilla PR open about this problem.