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

Michael S. Tsirkin mst at mellanox.co.il
Thu Jan 4 14:51:15 PST 2007


>  > 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.
> 
> Which platform?  Is it crashing in dlopen(NULL) (my heuristic for
> detecting a static application).

SLES10.

>  > 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?
> 
> The ideal solution would be to build the library twice, once for
> static and once for dynamic, and pass in a different preprocessor flag
> so we can only use dlopen() when it has a chance at working.  But it's
> hard to do that with libtool/automake, and I don't feel like
> hand-crafting a build system right now.
> 
> OTOH static linking is such a corner case that I don't want to waste
> too much time on it.

I can think of some other solutions to this. For example have a stub
libdl.a implementation.
Interested in a patch? I might give it a try.

-- 
MST




More information about the general mailing list