Bug 71851

Summary: libwayland-server.so: error: undefined reference to 'pthread_key_create' (and more)
Product: Wayland Reporter: Michał Górny <mgorny>
Component: waylandAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Build log

Description Michał Górny 2013-11-20 20:14:01 UTC
Created attachment 89547 [details]
Build log

Recently the git master for wayland stopped building with pthread-related errors:

../src/.libs/libwayland-server.so: error: undefined reference to 'pthread_key_create'
../src/.libs/libwayland-server.so: error: undefined reference to 'pthread_getspecific'
../src/.libs/libwayland-server.so: error: undefined reference to 'pthread_once'
../src/.libs/libwayland-server.so: error: undefined reference to 'pthread_setspecific'

Looking at the build system, I think it is completely missing the code necessary to detect and set proper flags for pthread support. As suspected, passing 'LIBS=-pthread' to configure results in the build succeeding.

Attaching our build log.
Comment 1 Kristian Høgsberg 2013-11-24 01:08:23 UTC
commit 5a019e38a1316a31072a9cb6de8da4377f3cfad5
Author: Kristian Høgsberg <krh@bitplanet.net>
Date:   Sat Nov 23 12:24:26 2013 -0800

    Add -pthread to AM_CFLAGS to do the right thing when using threads

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.