HailoRT starts a background thread in a static initializer, breaking sigwait()-style graceful shutdown

Hi,

we are integrating HailoRT into our application ( Release v4.21.0 · hailo-ai/hailort · GitHub , tho the version is irrelevant for this case).

We use the standard POSIX pattern for clean shutdown: block SIGINT/SIGTERM in all threads, then handle them in a dedicated sigwait() thread. This is responsible for clean shutdown of our application.

As soon as we link HailoRT, a background thread is created before main() (via a static initializer), so it inherits an unblocked mask. In turn SIGTERM can hit that thread and terminate the process, without our shutdown logic running. Hence no clean shutdown.

Why does this happen?
HailoRT registers a load-time initializer (COMPAT__INITIALIZER(hailort__initialize_logger)) that constructs the logger and calls spdlog::flush_every(…). That starts a periodic flush thread during library load, before the application can set its signal mask.
Any unmasked thread is a valid target for process-directed signals.

Our current workaround is to move signal blocking into the executable’s .preinit_array. This works but forces application-level startup / linking surgery just to integrate HailoRT along with standard signal handling.
Could HailoRT avoid spawning threads in static initializers, or make it opt-in?