Bug 87128 - /usr/include/pthread.h:368:11: note: previous declaration of '__libc_thr_self' was here
Summary: /usr/include/pthread.h:368:11: note: previous declaration of '__libc_thr_self...
Status: RESOLVED MOVED
Alias: None
Product: XCB
Classification: Unclassified
Component: Utils (show other bugs)
Version: 1.11
Hardware: x86-64 (AMD64) NetBSD
: medium normal
Assignee: xcb mailing list dummy
QA Contact: xcb mailing list dummy
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-09 00:49 UTC by Stephen Fisher
Modified: 2019-02-16 19:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Stephen Fisher 2014-12-09 00:49:33 UTC
When compiling libpthread-stubs-0.1 as a prerequisite for libxcb-1.11 on NetBSD 6.1.5, I encounter this compilation error after running the configure script:

stubs.c:33:5: error: conflicting types for '__libc_thr_self'
/usr/include/pthread.h:368:11: note: previous declaration of '__libc_thr_self' was here

Presumably, this is because none of NetBSD's pthread functions were found by the configure script even though they exist:

checking for pthread_self... no
checking for pthread_mutex_init... no
checking for pthread_mutex_destroy... no
checking for pthread_mutex_lock... no
checking for pthread_mutex_unlock... no
checking for pthread_cond_init... no
checking for pthread_cond_destroy... no
checking for pthread_cond_wait... no
checking for pthread_cond_signal... no
checking for pthread_cond_broadcast... no
checking for pthread_equal... no

The man page for pthread_self() says it is included in pthread.h and the libpthread library.  I work around this problem by passing -lpthread to the configure script with LDFLAGS on the command line.
Comment 1 Alan Coopersmith 2014-12-09 01:06:34 UTC
As explained in the README, configure intentionally doesn't check libpthread,
only the default libraries such as libc, so it can determine if it needs to
provide stubs for programs which don't want to link with threads libraries.

BTW, libpthread-stubs 0.3 is the current version, not 0.1 - I don't know if
that matters for this issue though, or if NetBSD simply never had anyone
contribute support for it yet.
Comment 2 Stephen Fisher 2014-12-24 21:26:26 UTC
(In reply to Alan Coopersmith from comment #1)
> As explained in the README, configure intentionally doesn't check libpthread,
> only the default libraries such as libc, so it can determine if it needs to
> provide stubs for programs which don't want to link with threads libraries.

Would it make sense then to remove the #include <pthread.h> since it isn't trying to link to libpthread by default?
 
> BTW, libpthread-stubs 0.3 is the current version, not 0.1 - I don't know if
> that matters for this issue though, or if NetBSD simply never had anyone
> contribute support for it yet.

Thanks for catching that.  I've updated to libpthread-stubs 0.3 and have the same issue.
Comment 3 GitLab Migration User 2019-02-16 19:44:29 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/lib/libxcb-cursor/issues/6.


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.