Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>.
- Loading branch information