Move the library init and shutdown to executables

Instead of relying on unreliable order of execution of the library
constructors and destructors, move them to individual binaries.  The
advantage is that the execution time and order will remain constant and
will not depend on the dynamic load dependency solver.

This requires more work, but that was mitigated by a simple requirement,
any executable using libisc and libdns, must include <isc/lib.h> and
<dns/lib.h> respectively (in this particular order).  In turn, these two
headers must not be included from within any library as they contain
inlined functions marked with constructor/destructor attributes.
This commit is contained in:
Ondřej Surý
2025-02-04 13:17:31 +01:00
parent 5d0c347e75
commit f5c204ac3e
163 changed files with 535 additions and 116 deletions

View File

@@ -17,6 +17,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <isc/lib.h>
#include <isc/log.h>
#include <isc/mem.h>
#include <isc/string.h>