Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 28 Sep 2014 00:49:21 +0300
From:      Raphael Kubo da Costa <rakuco@FreeBSD.org>
To:        freebsd-threads@freebsd.org
Subject:   Re: Segfault from libthr.so.
Message-ID:  <86ppegg2e6.fsf@FreeBSD.org>
References:  <20140926150001.GF7885@Jetdail> <20140926164306.GE8870@kib.kiev.ua> <20140927065556.GH7885@Jetdail> <20140927083621.GJ8870@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov <kostikbel@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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86ppegg2e6.fsf>