Skip to content

Commit 7b01ab5

Browse files
committed
Merge branch 'ew/autoconf-pthread'
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
2 parents 37e9c7f + a9b02de commit 7b01ab5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

configure.ac

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,14 +1108,19 @@ GIT_CONF_SUBST([HAVE_BSD_SYSCTL])
11081108
AC_DEFUN([PTHREADTEST_SRC], [
11091109
AC_LANG_PROGRAM([[
11101110
#include <pthread.h>
1111+
static void *noop(void *ignore) { return ignore; }
11111112
]], [[
11121113
pthread_mutex_t test_mutex;
11131114
pthread_key_t test_key;
1115+
pthread_t th;
11141116
int retcode = 0;
1117+
void *ret = (void *)0;
11151118
retcode |= pthread_key_create(&test_key, (void *)0);
11161119
retcode |= pthread_mutex_init(&test_mutex,(void *)0);
11171120
retcode |= pthread_mutex_lock(&test_mutex);
11181121
retcode |= pthread_mutex_unlock(&test_mutex);
1122+
retcode |= pthread_create(&th, ret, noop, ret);
1123+
retcode |= pthread_join(th, &ret);
11191124
return retcode;
11201125
]])])
11211126

0 commit comments

Comments
 (0)