Re: RFC: SDL and X static extension libraries re-revisited
>>>>> "Jules" == Jules Bean <firstname.lastname@example.org> writes:
Jules> On Thu, Nov 01, 2001 at 11:50:19AM -0500, Branden Robinson
>> Hi folks,
>> There is still one more issue to tackle with SDL vis a vis the
>> static X extension libraries that it uses. Fortunately, this
>> one will be far less disruptive than the last, and will not
>> affect library interfaces in any way.
>> A quick recap:
>> 1) In XFree86 4.1.0, the extension libraries libXxf86dga,
>> libXxf86vm, and libXv are built only as static objects by
>> default. (In English, these represent the client-side
>> libraries for the DGA, VidMode, and XVideo extensions.)
>> 2) When you build something as a static object only, you don't
>> have to worry (at least not as much) about incompatible
>> interface changes because every client has its own copy of the
>> library, and is guaranteed to be able to resolve the library's
Jules> What happens if two different dynamic objects, destined to
Jules> be linked into the same runtime, are linked against
Jules> different versions of the library?
Jules> E.g. xfoo links libfoo and libbar, two graphics related
Jules> libraries. They both have the capability to use DGA, so
Jules> they both statically link the dga lib.
Jules> Is that a problem?
It depends on which symbols are exported by the libraries and on
whether you use dlopen or link against the application and on which
dlopen flags you use.
With most shared library architectures, you can go out of your weigh
to restrict the set of symbols you export to only those that your
application defines rather than those imported from libraries you use.
If you do this, then the situation described may even work in a
defined manner with _pic.a files or if versioned symbols are used. It
does require significant up-front effort and I forget how Elf works.
It may be worth the effort in the case of sdl.