In the last episode (Sep 06), Xavier Beaudouin said:
After thinking *why* coredump generated was getting both libraries libpthreads and libc_r... I have tested pikefarm with forcing library...using --with-thread-library flag.
Now it is working right on freebsd.home.oav.net so we can easyly guess the autoconf is b0rken with freebsd > 5.0 about thread support.
Since CVS access is not working, can someone patch autoconf to *avoid* -lc_r and -lpthread and/or -lthr on FreeBSD.
Defaut that should be used :
- FreeBSD < 5.0 : -lc_r (this is the _only_ thread library that exist)
- FreeBSD >= 5.0 < 5.3 : -lc_r (but -lkse, -lthr and -lpthread
exists. note that -lpthread is -lc_r on these version)
- FreeBSD >= 5.4 : -lpthread (but -lc_r, -lthr still exists).
Actually, -pthread (not -lpthread) should be the first thing to test, since that uses gcc's specs magic to expand to whatever the right value is for the version of FreeBSD you have. I force this in my xenofarm builds by passing --with-thread-library=-pthread .
The FreeBSD people sort of dropped the ball when they introduced libpthread and libthr. They should have created libkse and libthr, and had a libpthread symlink pointing to one or the other. The default for a later FreeBSD may be libthr, since that developer has gotten his implementation to run faster than the one currently named "libpthread". So as it stands, gcc's -pthread flag is the most reliable way to ask for threads.