Porting cmake: undefined references to "pthread_barrier" functions

Joel Valenciano joelv1907 at gmail.com
Fri Sep 24 08:58:51 CEST 2021

I was trying to build cmake, as I figured it would be useful for
self-hosting, but in the link phase, it fails with an undefined
reference to pthread_barrier_destroy(), along with a few other BSD

The "pthread_barrier" functions are used by libuv, not cmake directly,
so I made port files for each, as well as a custom target.mk, but I'm
not sure what to do about these BSD features.

Specifically, here's what I've seen is missing:
-pthread_barrier init(), wait(), and destroy()
-some BSD sysctl() items related to resource usage info
-a sysctl() to access the program's executable binary from itself

Most of the calls are in "src/unix/freebsd.c" and "src/unix/kqueue.c".

I wrote an implementation of the pthread_barrier functions that uses
Genode::Blockade as a barrier, and I think the resource sysctl()'s can
be implemented with Pd_session's ram quota functions, but I figured I
should ask.

More information about the users mailing list