Skip to content

Fix pthreads flags on FreeBSD.

This is a fix for the pthreads flags on the FreeBSD build.

Currently, it builds libGLdispatch.so without linking against pthreads. As an optimization, libglvnd tries to check at runtime whether pthreads is available and stubs out any pthreads calls if it isn't. That works on Linux, where all of the pthreads functions are in a separate libpthread.so library, but on FreeBSD, it ends up finding stub functions that just fail with ENOSYS.

For the Meson build, this change adds a dependency on pthreads for non-Linux builds, and adds a headers-only dependency for Linux builds.

For autotools, this just adds $(PTHREAD_CFLAGS) to CFLAGS when it builds libGLdispatch.so, just like it does with EGL and GLX.

Merge request reports