zfs icon indicating copy to clipboard operation
zfs copied to clipboard

libspl_assert: always link -lpthread on FreeBSD

Open robn opened this issue 1 year ago • 0 comments

Motivation and Context

Build failure on FreeBSD 13.

Description

The pthread_* functions are in -lpthread on FreeBSD. Some of them are implicitly linked through libc, but on FreeBSD 13 at least pthread_getname_np() is not. Just be explicit, since -lpthread is the documented interface anyway.

How Has This Been Tested?

Checked build on 13 & 14 with and without. 13 didn't build without previously, now does.

I suspect this made it past CI in #16140 because it found libunwind there, and that brought libpthread along. Can't confirm because the checks appear to be gone from that PR now, but it feels plausible.

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Performance enhancement (non-breaking change which improves efficiency)
  • [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • [ ] Documentation (a change to man pages or other documentation)

Checklist:

  • [x] My code follows the OpenZFS code style requirements.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the contributing document.
  • [ ] I have added tests to cover my changes.
  • [ ] I have run the ZFS Test Suite with this change applied.
  • [x] All commit messages are properly formatted and contain Signed-off-by.

robn avatar May 06 '24 06:05 robn