[Xcb] Patches to build X11 w/ XCB on Sol
jamey at minilop.net
Sun May 15 10:31:04 PDT 2005
On Sat, 2005-05-14 at 23:30 -0700, Travis Spencer wrote:
> On Sun, Apr 03, 2005 at 12:52:01PM -0700, Jamey Sharp wrote:
> > If it hangs, we'll have to do something else. You
> > need to make sure libpthread is linked in or the test won't be valid;
> > the command I used is:
> > gcc -Wall -lX11 -lpthread rec-lock.c -o rec-lock
> I didn't need libpthread but I needed libnsl and libsocket for some
Um... libpthread needs to be linked in by something, either when
compiling libX11 or when compiling the test program, or else I wouldn't
expect the test to be valid. You might want to run `ldd rec-lock` and
ensure that libpthread appears somewhere in the output.
As for libnsl and libsocket, XCB should have been linked against those
already, so shared library dependencies should have taken care of it.
Either you're building statically, or XCB's configure script isn't
working the way I meant it to, or I don't understand something.
> What was that function that you were talken about last Wednesday that
> can be used to determine at runtime if a program is linked against a
> libpthread? Was it dlopen(3DL)?
I could have sworn there was a standard POSIX threads function that
would tell you whether threads were in use, but I can't find it now.
(The dlopen thing was if it turned out that threads *were* in use, you
could dlopen libpthread.so and dlsym the pthread_mutexattr functions, to
avoid having to link against libpthread.so for apps that didn't need
> Should I make a bug report on freedesktop or will you or someone else
> around here review and commit it?
No, I've reviewed and committed it. Unfortunately I just discovered I
didn't review it carefully enough (__GLIBC__ isn't defined unless
features.h is included -- d'oh) so I'll be committing another patch
shortly to restore glibc support. (I did test your patch before
committing, but with a threaded app; it doesn't work for non-threaded
apps on glibc.)
More information about the xcb