On 03/04/2010 08:51 PM, Renato Botelho wrote:
> 2010/3/4 Török Edwin <edwinto...@gmail.com>:
>> On 03/04/2010 08:44 PM, Renato Botelho wrote:
>>> 2010/3/4 Török Edwin <edwinto...@gmail.com>:
>>>> On 03/04/2010 08:37 PM, Renato Botelho wrote:
>>>>> 2010/3/4 Török Edwin <edwinto...@gmail.com>:
>>>>>> On 03/04/2010 08:29 PM, Renato Botelho wrote:
>>>>>>> 2010/3/4 Török Edwin <edwinto...@gmail.com>:
>>>>>>>> On 03/04/2010 08:23 PM, Renato Botelho wrote:
>>>>>>>>> 2010/3/4 Török Edwin <edwinto...@gmail.com>:
>>>>>>>>>> On 03/04/2010 08:16 PM, Renato Botelho wrote:
>>>>>>>>>>> No -pthread around unit_tests
>>>>>>>>>> Please look in all .la files for pthread.
>>>>>>>>> No results
>>>>>>>> last chance, grep the Makefiles :)
>>>>>>> Result of this command:
>>>>>>>
>>>>>>> find ./ -type f | xargs fgrep -i -- -pthread
>>>>>>>
>>>>>>> here:
>>>>>>>
>>>>>>> http://pastebin.com/MHuScqae
>>>>>>>
>>>>>>>>> testegw# find ./ -type f -iname \*.la | xargs fgrep pthread
>>>>>>>> from clamav's source/build root, right?
>>>>>>> Yes.
>>>>>>>
>>>>>> Ok it seems that this:
>>>>>> -lthr
>>>>>> -L/usr/local/lib -lcheck -R/usr/local/lib
>>>>>>
>>>>>> got expanded to this:
>>>>>> -lthr usr/local/lib/libcheck.so -pthread -Wl,-rpath
>>>>>> -Wl,/usr/local/lib
>>>>>>
>>>>>> Is there a /usr/local/lib/libcheck.la, and does it have anything about
>>>>>> pthread in it?
>>>>> Bingo,
>>>>>
>>>>> # Linker flags that can not go in dependency_libs.
>>>>> inherited_linker_flags=' -pthread'
>>>>>
>>>> But why is that like so? Isn't -lthr FreeBSD's threading library that
>>>> you build the ports with?
>>> The default thread library on FreeBSD ports is -pthread, I forced
>>> clamav to build using -lthr because we had problems in the past
>>> with -pthread.
>> For freebsd 4 and 5 configure sets THREAD_LIBS to -pthread -lc_r
>> and for later ones to -lthr (unless you patched configure to use
>> PTHREAD_LIBS?).
> 
> Exactly
> 
>> If you patched the main configure to use PTHREAD_LIBS, then please patch
>> libclamav/c++ too.
> 
> Ok, i'll do (after patch you sent is it still necessary?)

Well it does the same as the main configure: use -lthr.
So if you patched the main configure to use PTHREAD_LIBS instead of
-lthr, you should do the same for libclamav/c++.

I don't know what our version should do:
 - official freebsd port uses -lthr for clamav (and so do we)
 - libcheck uses -pthread

I don't want to switch clamav to -pthread just because of libcheck,
if -lthr works better (for clamav).

FWIW on Debian there is no libcheck.la, there is just a libcheck.a, and
libcheck_pic.a.

Would it be possible to link to libcheck.a on FreeBSD? libclamav is
already linked with the proper threading libs...

Also I'm told latest FreeBSD only has 1 threading lib.
Which is it? -lthr or -lpthread? (or does -pthread imply -lthr there?).

> 
>>> libcheck port doesn't have this forced, so, it used the default when
>>> it was built.
>>>
>>> I can try to build clamav using the default thread and see what
>>> happens.
>>
>> On 03/04/2010 08:46 PM, Renato Botelho wrote:
>>> I cannot remember when it was done, but there is a comment about
>>> it on ports Makefile
>>>
>>> # This port has a problem with -pthread,
>>> # force to use -lthr until it's not fixed.
>>> PTHREAD_LIBS=  -pthread
>>>
>> I don't understand, the comment says force -lthr, but the Makefile does
>> -pthread.
> 
> I replaced it with -pthread right now to make a test, the official port
> uses -lthr

Ah ok.

> 
>>>> And why did it work so far? I don't think I changed anything wrt libcheck.
>>> good question
>>>
>> Did you build the unit tests for 0.95?
> 
> Nope, i'll try it too
> 

Thanks.

Best regards,
--Edwin
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net

Reply via email to