Make sure that plugins can lookup core symbols.
This is a sanity check to avoid lazy-lookup failures when libhwloc is loaded within a plugin, and later tries to load its own plugins. This may fail (and abort the program) if libhwloc symbols are in a private namespace.
- Returns
- 0 on success.
-
-1 if the plugin cannot be successfully loaded. The caller plugin init() callback should return a negative error code as well.
Plugins should call this function in their init() callback to avoid later crashes if lazy symbol resolution is used by the upper layer that loaded hwloc (e.g. OpenCL implementations using dlopen with RTLD_LAZY).
- Note
- The build system must define HWLOC_INSIDE_PLUGIN if and only if building the caller as a plugin.
-
This function should remain inline so plugins can call it even when they cannot find libhwloc symbols.