]> git.ipfire.org Git - thirdparty/krb5.git/commit
Don't finalize libraries in static build
authorGreg Hudson <ghudson@mit.edu>
Tue, 11 Dec 2012 19:36:06 +0000 (14:36 -0500)
committerGreg Hudson <ghudson@mit.edu>
Wed, 12 Dec 2012 07:08:45 +0000 (02:08 -0500)
commit4538146e1452e0966164119cefb0804993ce6bbb
tree71597b3f1fa7c2bec6f24e441b77b4f5c3f681a7
parent26481ee22377a46badbbf4bbdd8ae04265057205
Don't finalize libraries in static build

In a build with static libraries, functions tagged with
__attribute__((destructor)) may be executed in any order, not in a
topologically sorted order as they are in shared libraries.  This
could result in libcom_err functions being invoked (from another
library's finalizer) after libcom_err has been finalized, which would
(at minimum) result in using a mutex after it is destroyed.  To
prevent this kind of problem, disable finalizers in the static build
regardless of whether we have compiler or linker support for them.
Reported by Mihai Serban <mihai.serban@gmail.com>.
src/include/k5-platform.h