This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/33704] AIX runs c++ constructors in incorrect order
- From: "dje at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Oct 2007 21:10:08 -0000
- Subject: [Bug target/33704] AIX runs c++ constructors in incorrect order
- References: <bug-33704-8038@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #14 from dje at gcc dot gnu dot org 2007-10-09 21:10 -------
You seem to want to have the main program run the share library constructors.
That's a no-no. And decide at link-time. Double no-no. You essentially want
to behave like a static link.
If you look at the discussion from years ago, to solve this correctly one needs
to implement a solution at runtime, not link-edit time. At runtime, the
constructors need to register themselves instead of running, then the init
processing in the main program performs a global sort, and then actually runs
the constructors depth-first.
Please open the throw failure as a separate PR if it is a separate issue. I
cannot tell if you think it is a byproduct of AIX behavior or a separate issue.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33704