[Development] xcb-icccm dependency in Qt 5/libxcb

Koehne Kai Kai.Koehne at digia.com
Fri Oct 26 15:29:29 CEST 2012


> -----Original Message-----
> From: development-bounces+kai.koehne=digia.com at qt-project.org
> [mailto:development-bounces+kai.koehne=digia.com at qt-project.org] On
> Behalf Of Thiago Macieira
> Sent: Thursday, October 25, 2012 3:55 PM
> To: development at qt-project.org
> Subject: Re: [Development] xcb-icccm dependency in Qt 5/libxcb
> 
> On quinta-feira, 25 de outubro de 2012 09.00.40, Koehne Kai wrote:
> > https://codereview.qt-project.org/#change,38146

Actually the whole patch falls apart on Ubuntu 64 bit:

/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/libxcb-keysyms.a(libxcb_keysyms_la-keysyms.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

So, it seems the system libxcb-*.a files on Ubuntu 64 bit aren't actually PIC, after all :(

> > A couple of notes:
> >  - I'm trying to not only link libxcb-icccm statically, but all
> > libxcb-* libs.
> > - it still leaves a general libxcb.so dependency on Ubuntu 11.10 at
> > least, which libXext adds
> 
> Good. Don't try to use libxcb.a then, since we'd have two copies of it in
> memory.

Well, I started to wonder whether mixing different versions of libxcb (dynamically linked) and lixcb-* (statically linked) will really work. Isn't it the same as if one would try to run e.g. QtGui 4.4 (statically linked) against QtCore 4.7 (dynamically linked), or the other way round? I don't think we support that, so the question is if xcb does support it ...
 
> > - I'm (mis)using QMAKE_LIBS because entries in LIBS are resorted
> > alphabetically.
> > - It requires a gnu linker (-Wl,-Bstatic
> > etc)
> 
> Actually, it requires that you remove libxcb-*.so...

That would work too ... But it doesn't help the fact that linking will fail :(

> I also thought you could use:
> 	-static -lxcb-icccm -shared -lxcb
> 
> In any case, -Wl,-Bstatic is acceptable.
> 
> >  - It obviously requires .a files, which e.g. Ubuntu has, OpenSUSE
> > doesn't
> >  - It's fragile :( The alternative is importing the xcb libs into qt
> > itself (3rdparty), which might or might not be a lot of (maintenance)
> work...

So, in summary linking statically against system libxcb-* does only work on Ubuntu 32 bit so far, which obviously doesn't cut it. We could try to import xcb into src/3rdparty, and compile from there , but it's unclear to me whether mixing different versions of the libxcb libraries (which invariably will happen at runtime, because e.g. QtGui links against libX11, which links against libxcb ...) is in any way supported. So I'm not sure how to continue. I registered on the xcb mailing list and posted there too in the hope that they have advice:

http://lists.freedesktop.org/archives/xcb/2012-October/007928.html

Regards

Kai



More information about the Development mailing list