meson: drop pthread-stubs on BSDs
Drop pointless dependency poisoning build of every VAAPI and OpenCL driver. NetBSD already disables downstream by overriding PTHREADSTUBS_LIBS
.
libdrm doesn't install static libraries since 56b07338, so this mainly affects subprojects. However, any project that bundles likely uses old version and has broken BSD support.
Merge request reports
Activity
Reviewed-by: Emmanuel Vadot manu@FreeBSD.org
@jbeich I've read the MR & commit message and I'm not sure what it's trying
itto say. Keep in mind that I'm the person who madepthread-stub 0.4
ano-op
or-pthread
wrapperIn more detail: The
pthread-stub
is no-op on linux, yet this commit replaces it with-pthread
for no obvious (documented) reason.Based off the NetBSD link pthread-stub it a no-op there, yet this adds
-pthread
across the board...- if ['freebsd', 'dragonfly', 'netbsd'].contains(host_machine.system()) + if ['freebsd', 'dragonfly'].contains(host_machine.system()) dep_pthread_stubs = dependency('pthread-stubs', version : '>= 0.4')
Hence ^^ is what you want, yet this MR goes the opposite direction.
Edited by Emil VelikovNo! Everyone wait! :) Here:
- the whole point of
pthread-stubs
is that you always depend on it- and it depends on pthreads or doesn't depending on the platform
- if you conditionally depend on
pthread-stubs
based on the platform you're doing it wrong- because you're literally just replicating
pthread-stubs
's knowledge in your build system- and that knowledge is the only thing in
pthread-stubs
0.4
- and that knowledge is the only thing in
- so you might as well directly depend on
pthreads
conditionally!
- because you're literally just replicating
(UPD also, in that case not having stubs should be considered the "norm", they are the optional thing — so the listed platforms should be the one with the stubs in libc)
So it should either be something like
if ['linux', 'gnu', 'netbsd', 'sunos', 'cygwin', 'gnu/kfreebsd'].contains(host_machine.system()) dep_maybe_threads = [] else dep_maybe_threads = dependency('threads') endif dep_threads = dependency('threads')
Or
dep_pthread_stubs = dependency('pthread-stubs', version : '>= 0.4')
unconditionally.Based off the NetBSD link pthread-stub it a no-op there
Yeah, actually that seems true: https://github.com/NetBSD/src/tree/trunk/lib/libc/thread-stub
…anyway, does anyone actually benefit from this optimization? Are non-threaded high-performance graphical programs even a thing?
Edited by Val Packett- the whole point of
If we look at the pthread-stubs README, there is no such strictness
you always depend on it
, plus it has a decent list where it's a no-op and where it falls back to-pthread
Since it's a no-op in some cases, distributions (Linux or BSD) have chosen to patch it out, rather than provide a dummy package. As we want to work with distros, we removed where it made sense or we had feedback. So based on the NetBSD patch/feedback let's drop that.
If we have a similar patch/feedback for other platforms (say FreeBSD) we can do the same.
…anyway, does anyone actually benefit from this optimization? Are non-threaded high-performance graphical programs even a thing?
This is a good question, yet orthogonal. Each distro has specific use-cases/programs of interest, and in some cases different linker. As such they can make the call for themselves and let us know.
Edited by Emil Velikovwhere it falls back to
-pthread
FreeBSD deprecated
-pthread
in favor of-lpthread
sometime in 2015.https://cgit.freebsd.org/ports/log/?qt=grep&q=remove+%24PTHREAD_LIBS
https://cgit.freebsd.org/ports/commit/?id=c560a8562508Edited by Jan Beich
added 82 commits
-
9ef84bbc...83763622 - 81 commits from branch
mesa:main
- 7207431e - meson: drop pthread-stubs dependency on BSDs
-
9ef84bbc...83763622 - 81 commits from branch
See also xorg/lib/libxcb!37 (merged)
- Resolved by Emil Velikov
We have a
libpthread-stubs
within the .gitlab-ci.yml, for the freebsd variation. Can we drop that as well please?
added 1 commit
- 690f7437 - meson: drop pthread-stubs dependency on BSDs
added 84 commits
-
690f7437...c6d6dce9 - 83 commits from branch
mesa:main
- 332809f3 - meson: drop pthread-stubs dependency on BSDs
-
690f7437...c6d6dce9 - 83 commits from branch