[openib-general] [PATCH/RFC] libibverbs: Improve driver loading

Michael S. Tsirkin mst at mellanox.co.il
Tue Dec 26 00:51:44 PST 2006


> > (To get a list of drivers, libibverbs parses all the config files it
> > finds in $(sysconfdir)/libibverbs.d and also looks at the environment
> > variables RDMAV_DRIVERS and IBV_DRIVERS)
> > 
> > Then, instead of calling a specific entry point in the driver,
> > libibverbs assumes the driver will call ibv_register_driver() from an
> > __attribute__((constructor)) function.
> > 
> > This has a number of benefits:
> >  - multiple drivers can be linked statically into an executable
> >  - LD_LIBRARY_PATH can be used to manage which drivers to load
> >  - different versions of the driver can be selected automagically at
> >    runtime (eg i686/cmov on i386 distros)
> 

Wrt static linking: I see this warning when I link with -static:
: warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
And it actually crashes inside dlopen on some platforms.

Would it be possible to add a configuration option to avoid using dlopen
for static apps? Or, maybe, it makes more sense to make an empty stub for libdl,
and ask apps to link with that?




-- 
MST




More information about the general mailing list