[Xcb] new library for pthread stub functions

Jamey Sharp jamey at minilop.net
Wed Nov 22 02:53:39 PST 2006

Bart points out that I could just have suppressed gcc's warning about
unused static functions.

Josh and I came up with a different, and I think dramatically better,
solution. Take a look at:
The source here is essentially Diego's patch turned into it's own
autotooled blob... plus magic. (BTW, Diego, I think I've addressed my
own concerns now. But you should test that the above repo works for

On a glibc system, the only file the above tree installs is a pkg-config
file like this:


Name: pthread stubs
Description: Stubs missing from libc for standard pthread functions
Version: 0.1

This means you can have an unconditional pkg-config dependency on
'pthread-stubs', and it will be a no-op in your compile flags if you
don't need any stubs. It should generate a shared library if one is
needed, however, and provide correct linker flags in the pkg-config file.

This work can, of course, be shared by multiple projects, including XCB,
Xlib, and Mesa. If I correctly understood something that Eric Anholt
told me, keeping the stubs in a separate library is actually the only
way to make them work on versions of FreeBSD before 4.10 or something

An open question is what to do about static linking. What does it mean
to ask for pthread stub functions in a statically linked program?

Another open question is, does a package with 141 lines of source code
that compiles to a few bytes really need a 300kB gzipped dist tarball?
It's just possible that autoconf might not be a win here.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20061122/07fb1a1c/attachment.pgp

More information about the Xcb mailing list