Skip to content

Commit

Permalink
Merge branch 'ew/autoconf-pthread'
Browse files Browse the repository at this point in the history
Existing autoconf generated test for the need to link with pthread
library did not check all the functions from pthread libraries;
recent FreeBSD has some functions in libc but not others, and we
mistakenly thought linking with libc is enough when it is not.

* ew/autoconf-pthread:
  configure.ac: stronger test for pthread linkage
  • Loading branch information
gitster committed Jul 25, 2016
2 parents 37e9c7f + a9b02de commit 7b01ab5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions configure.ac
Expand Up @@ -1108,14 +1108,19 @@ GIT_CONF_SUBST([HAVE_BSD_SYSCTL])
AC_DEFUN([PTHREADTEST_SRC], [
AC_LANG_PROGRAM([[
#include <pthread.h>
static void *noop(void *ignore) { return ignore; }
]], [[
pthread_mutex_t test_mutex;
pthread_key_t test_key;
pthread_t th;
int retcode = 0;
void *ret = (void *)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);
retcode |= pthread_create(&th, ret, noop, ret);
retcode |= pthread_join(th, &ret);
return retcode;
]])])

Expand Down

0 comments on commit 7b01ab5

Please sign in to comment.