[Xcb] Portable binaries and XCB dependencies

Uli Schlachter psychon at znc.in
Fri Oct 26 09:56:50 PDT 2012


Hi,

On 26.10.2012 14:32, Koehne Kai wrote:
> The upcoming Qt 5 framework will rely on xcb as the platform backend on X11, and I started to wonder what that will mean for moving binaries between distributions & versions ...
> 
> The questions I'm especially interested in are:
> - are there best practices when it comes to minimize breakages due to different xcb libraries + versions on most popular distributions?

I don't know about any kind of list for this. However, I also don't really know
best practices when it comes to any other library and not xcb.

> - Is linking all xcb libraries statically a solution?

I don't think so. This will likely explode when libX11 is linked against a
different version of libxcb.

> - can I link some libraries of xcb statically, some dynamically (and expect it to work)?

Well, I think that libxcb.so's ABI is quite static for a while. So anything that
just uses libxcb.so might work.

> - can I ship libxcb*libraries together with Qt/the application? What can go wrong here?

Again, as long as you don't include libX11, stuff might explode. Also, if
another program tries to use libX11 or libxcb directly (=links against it), you
end up with two versions of the libraries again.

[...]
> I also ran the lsb application checker, and it listed specifically libxcb-image.so.0, libxcb-icccm.so.4 and libxcb-keysyms.so.1 as problematic dependencies:

I guess that including libxcb-image.so and libxcb-icccm.so might work. No clue
about libxcb-keysyms.so, I didn't even know that library existed.

> http://tinypic.com/view.php?pic=w1pa4y&s=6

Wow. Ugly.

[...]
> The next idea I had was to link only some libxcb- plugins statically (the problematic ones), and leave the other ones linked dynamically.
> But is that a supported scenario?

What do you mean with "supported"? I cannot help you if stuff goes wrong due to
ABI incompatibilities, but libxcb's ABI seems to be relatively stable, so this
will likely work.

> E.g. will a statically linked libxcb-image.so.0 work fine with some future
libxcb.so.x ?

No, but it will work with some future version of libxcb.so.1. The SONAME is
supposed to be increased when incompatible changes happen. So if libxcb.so.2
ever exists, it does so because of backwards incompatible changes to libxcb.

Cheers,
Uli

-- 
- Buck, when, exactly, did you lose your mind?
- Three months ago. I woke up one morning married to a pineapple.
  An ugly pineapple... But I loved her.


More information about the Xcb mailing list