Sat 11 Aug 2012 02:34:40 PM UTC, original submission:
With '--enable-force-upnp-natpmp' present when ./configure, mldonkey will report no error in the configure phase but will fail in building mlnet binary:
{{{
Compile time error:
Undefined symbols for architecture x86_64:
"_pthread_mutex_timedlock", referenced from:
_upnpNatpmpThread in upnp_stubs.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
File "caml_startup", line 1:
Error: Error during linking
make: *** [mlnet] Error 2
}}}
This is because of the use of pthread_mutex_timedlock() in src/utils/net/upnp_stubs.c line 874, plus that Mac OSX has not implemented pthread_mutex_timedlock() from 10.4 (or even earlier) to the latest 10.8. Here is a somewhat complete explanation of the situation: http://lists.apple.com/archives/Unix-porting/2008/Jan/msg00014.html
What mldonkey might want to do is that:
Detecting support for pthread_mutex_timedlock() in configure scripts, when the support is not available, removing the only call for pthread_mutex_timedlock() in "src/utils/net/upnp_stubs.c".
Specifically from LINE 871:
if ( g_running ){
deltatime.tv_sec = time(NULL) + 30;
deltatime.tv_nsec = 0;
dbg_printf("%d seconds timedlock, running...\n", deltatime.tv_sec);
I am not even a developer so I have no idea how to achieve above logic... But in such a way, Mac OSX users get a build success for mldonkey with upnp libs. The only compromise is the absence of a number in debug log.
If there is anything I can do please let me know. Thanks.
btw. Seems that Android has no pthread_mutex_timedlock() implementation either.
|