Segfault from libthr.so.

Raphael Kubo da Costa rakuco at FreeBSD.org
Sat Sep 27 21:49:47 UTC 2014


Konstantin Belousov <kostikbel at gmail.com> writes:

>> In my app, i dont directly start any thread, lower libs do. So it
>> doesnt seem logical to add -lpthread before declaring the deps. So
>> should i just remove this m4 macro that seems to be use on quite some
>> projects, so it works on BSD ?
>>
>> What is the best way to do it, in your opinion ?
>
> Just put -lpthread last in the command line (automake variable) for linker.
> This should work portable on all systems I know.

Alternatively, you could pass -pthread instead of -lpthread: the
compiler should then take care of passing -lpthread in the right
position -- it's what we use in the ports tree, for example.



More information about the freebsd-threads mailing list