Created attachment 136079 [details] Helgrind code patch Changes to Helgrind code. Another fairly small patch. Adding defined(VGO_freebsd) Add wraps for sem functions in libc
Created attachment 141837 [details] code diff in helgrind
This patch looks good as is. It compiles fine on Fedora amd64. Same question as with the drd change, could the LIBC_FUNC define be replaced with some PTH_FUNC macro magic? I assume not, since some wrappers already fo use PTH_FUNC instead of the new LIBC_FUNC. Just wondering why.
O, one nitpick, it does: mode change 100644 => 100755 helgrind/hg_intercepts.c which is wrong IMHO.
Fixed the file rights change. No idea where that came from.
For the PTH_FUNC and LIBC_FUNC, it's all a fairly big mess. On Soilaris, libpthread contains stubs and the real implementations are in libc. Nothing much works on macOS. On Linux glibc, functions seem to be fairly randomly in either libc or libpthread or both. For muslc there is no lib libpthread and everything is in libc. On FreeBSD the pthread functions have stubs in libc but the implementation is in libpthread. The exception is the semaphore functions which are only in libc. As a rule it is safe to have multiple filenames and patterns for these redirs, as long as a match is made and not to the stub. The duplicates will then do nothing. When there is a stub we mustn't look for them - which is why Solaris only looks in libc and FreeBSD only looks in libpthread for PTH_FUNC. I don't know of any way to achieve this with macros, or at least not in a way that is not worse than the current code.
Code committed as commit e2073121004fa969961c056594fcbf327cb57217 (but with a slightly wrong commit message FreeBSD support, patch 5 which should be patch 6)