[Bug c++/53068] collect2 breaks link order control

igodard at pacbell dot net gcc-bugzilla@gcc.gnu.org
Sun Apr 22 07:46:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53068

--- Comment #6 from Ivan Godard <igodard at pacbell dot net> 2012-04-22 07:46:20 UTC ---
Yes, but. Order is not defined, but order dependencies are inescapable in C++
which has a tendency to invoke constructors where you least expect them - when
you #include a file for example. The naive sometimes advocate lazy init, doing
dynamic initialization in each accessor; they have never had to deal with
thread convoying behind the lock in the accessor. Others advocate having an
init phase where explicit calls spread out from main() and allocate (and
initialize) whatever each module needs; they have never dealt with objects that
must be static because new() is unavailable for hardware reasons.

I'm not asking for the behavior to be defined; you are right that the language
does not demand that. But we mere users need to control the undefined behavior,
and so we need hooks to use for that control. Apparently a usable set of hooks
just gratuitously went away.

That sucks.



More information about the Gcc-bugs mailing list