Bug 72074

Summary: libpthread-stubs configure: FreeBSD support
Product: XCB Reporter: naota <naota>
Component: MiscAssignee: xcb mailing list dummy <xcb>
Status: RESOLVED MOVED QA Contact: xcb mailing list dummy <xcb>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: libpthread-stubs-0.3-freebsd.patch

Description naota@gentoo.org 2013-11-27 14:43:55 UTC
Created attachment 89902 [details]
libpthread-stubs-0.3-freebsd.patch

On FreeBSD, pthread_condattr_{init,destroy} is available in libthr.so, so current configure failed to detect them and cause to generate stubs for them.

The attached is a patch to add "-lthr" to LIBS so that it can properly detect pthread_condattr_{init,destroy}.
Comment 1 Uli Schlachter 2017-03-03 09:57:32 UTC
(This patch no longer applies to latest Git)

Also, I don't understand the patch. On any (other?) platform, pthread symbols are available in libpthread. Still, pthread-stubs does not just link to libpthread, but provides stubs instead. So, how is the case for libthr different?

Oh and: Doesn't this contradict the "new idea" from https://cgit.freedesktop.org/xcb/pthread-stubs/tree/README#n21?
After the latest rewrite, pthread-stubs does no longer provide a library, but only a pkg-config file. This pkg-config file "does nothing" if libc provides all the necessary stubs. Otherwise it causes a link against libpthread.
Comment 2 Matt Turner 2017-03-04 15:56:05 UTC
Naota originally filed this in Gentoo's bugzilla, and we asked him to file upstream.

The Gentoo bug report is here: https://bugs.gentoo.org/show_bug.cgi?id=491472 and contains more information.

Looks like FreeBSD carries a patch against pthread-stubs (https://svnweb.freebsd.org/ports/head/devel/libpthread-stubs/files/patch-stubs.c?view=log)

and there was discussion and a patch to add these two symbols to their libc in 2009: https://lists.freebsd.org/pipermail/freebsd-threads/2009-November/thread.html#4650

As far as I can tell the patch was never committed. I don't see any indication as to why.

I'm going to mail the freebsd-threads mailing list and marcus@, and then no one can't say I've tried...
Comment 3 GitLab Migration User 2019-02-16 19:41:30 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/proto/xcbproto/issues/14.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.