Python isn't adding pthread to LIBS correctly in it's Makefile for BSD. Whilst this isn't a problem for python itself - as it's correctly got the -pthread CFLAG, it is a problem for any application that query pythons Makefile to work out what libraries it needs to link to. The issue stems from a test for sem_init in which appears to be in pthread and in other libs on other OS's. The quick fix is to adjust the gentoo_obsd patch to include FreeBSD in the hardcoded test. However, I don't think this is the best approach. I think the best approach would be that if -pthread is in the CFLAGS or CC then it should be moved to LIBS as this should then satisfy any OS that uses -pthreads and any app can then link correctly.
Created attachment 105383 [details, diff] Link to -pthread Remember to eautoconf after patching :)
Fixed in 2.3.6-r1, 2.4.4-r1 and 2.5.1.