Skip to content

Commit

Permalink
Improve test for pthreads flag
Browse files Browse the repository at this point in the history
When compiling with CC=clang using Clang 1.1 as shipped by Debian
unstable (package version 2.7-3), the -mt flag is sufficient to compile
during the `configure` test. However, building git would then fail at
link time complaining about missing symbols such as `pthread_key_create'
and `pthread_create'.

Work around this issue by adding pthread key creation to the pthreads
configure test source.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Oblomov authored and gitster committed Mar 28, 2011
1 parent 8cc299d commit cea13a8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,9 @@ AC_LANG_PROGRAM([[
#include <pthread.h>
]], [[
pthread_mutex_t test_mutex;
pthread_key_t test_key;
int retcode = 0;
retcode |= pthread_key_create(&test_key, (void *)0);
retcode |= pthread_mutex_init(&test_mutex,(void *)0);
retcode |= pthread_mutex_lock(&test_mutex);
retcode |= pthread_mutex_unlock(&test_mutex);
Expand Down

0 comments on commit cea13a8

Please sign in to comment.