[Xcb] Portable binaries and XCB dependencies

Koehne Kai Kai.Koehne at digia.com
Fri Oct 26 05:32:12 PDT 2012


Hi,

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?
- Is linking all xcb libraries statically a solution?
- can I link some libraries of xcb statically, some dynamically (and expect it to work)?
- can I ship libxcb*libraries together with Qt/the application? What can go wrong here?

Full story:

Traditionally you could build Qt + your application on some stone-age distribution, add some configure switches to minimize library dependencies, and you had a good chance that the same binary will run on most recent ones (with some variants e.g. when it comes to libc versions). Now the dependencies to various xcb libraries makes things certainly more interesting. E.g. if you compile Qt 5 on Ubuntu 11.10, you'll have following dependencies:

libxcb-image.so.0
libxcb-shm.so.0
libxcb-keysyms.so.1
libxcb-icccm.so.4
libxcb-sync.so.0
libxcb-xfixes.so.0
libxcb-randr.so.0
libxcb.so.1
libX11-xcb.so.1
libX11-xcb.so.1
libXi.so.6
libxcb-shape.so.0
...

Which means that your application won't run on e.g. OpenSUSE 11.10, because only libxcb-iccm.so.1 is available there. 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:

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

The obvious idea to mitigate this is to link statically, which I've been looking into. One problem is that libxcb.so itself is a dependency of e.g. libX11 , which means that if we link it statically, it might be available two times in memory, even in different versions - I understand that this might cause quite some problems? 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? E.g. will a statically linked libxcb-image.so.0 work fine with some future libxcb.so.x ?

I've to say I only started looking into xcb a few days ago, and am also in no way a Linux packaging expert. So bear with me if I missed something obvious ...

Regards

Kai

PS: The original thread I started at the qt-development mailing list: http://www.mail-archive.com/development@qt-project.org/msg07300.html


--
Kai Koehne, Senior Software Engineer - Digia, Qt
Digia Germany GmbH, Rudower Chaussee 13, D-12489 Berlin
Geschäftsführer: Mika Pälsi, Juha Varelius, Anja Wasenius
Sitz der Gesellschaft: Berlin. 
Registergericht: Amtsgericht Charlottenburg, HRB 144331 B 




More information about the Xcb mailing list