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

[PATCH] make: Remove -pthread on Darwin (it is included by cstdlib).

From
Ted Pavlic <ted@tedpavlic.com>
Date
Jan 26, 2009, 19:03 UTC
Message-ID
<1232996639-12450-1-git-send-email-ted@tedpavlic.com>
In-Reply-To
<497E079C.7090303@tedpavlic.com>
As discussed in
http://lists.apple.com/archives/Unix-porting/2005/Mar/msg00019.html

the Mac OS X C standard library is always thread safe and always includes the pthread library. So explicitly using -pthread causes an 'unrecognized option' compiler warning.

This patch clears PTHREAD_LIBS if Darwin is detected.
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
---

Rather than simply clearing PTHREAD_LIBS, would it be better to filter PTHREAD_LIBS to remove "-pthread" if detected?

 Makefile |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
index b4d9cb4..9d451cf 100644
--- a/Makefile
+++ b/Makefile
@@ -817,6 +817,7 @@ ifeq ($(uname_S),Darwin)
 			BASIC_LDFLAGS += -L/opt/local/lib
 		endif
 	endif
+	PTHREAD_LIBS =
 endif
 
 ifndef CC_LD_DYNPATH
-- 
1.6.1.213.g28da8
Previous: Ted Pavlic
Message 5 of 5 in “make: By default, remove -pthread on Darwin (it is included by cstdlib).”
  1. make: By default, remove -pthread on Darwin (it is included by cstdlib).Ted Pavlic, Jan 26, 2009
  2. make: By default, remove -pthread on Darwin (it is included by cstdlib).Ted Pavlic, Jan 26, 2009
  3. Junio C HamanoJan 26, 2009
  4. Ted PavlicJan 26, 2009
  5. make: Remove -pthread on Darwin (it is included by cstdlib).Ted Pavlic, Jan 26, 2009

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.