git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Improve test for pthreads flag

From
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Date
Mar 28, 2011, 07:39 UTC
Message-ID
<1301297999-30130-1-git-send-email-giuseppe.bilotta@gmail.com>

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>
---
 configure.ac |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index dd07907..fafd815 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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);
-- 
1.7.4.2.644.gb47dd1.dirty
Message 1 of 1 in “Improve test for pthreads flag”
  1. Improve test for pthreads flagGiuseppe Bilotta, Mar 28, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.