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

Re: [BUG] Unix Builds Requires Pthread Support (was [PATCH v4 00/12] Simple IPC Mechanism)

From
Jeff King <peff@peff.net>
Date
May 18, 2021, 13:59 UTC
Message-ID
<YKPIKHnyeU1MHgXp@coredump.intra.peff.net>
In-Reply-To
<00f301d74bea$fb39d220$f1ad7660$@nexbridge.com>
On Tue, May 18, 2021 at 09:37:38AM -0400, Randall S. Becker wrote:
Show 36 quoted lines
> >+# All simple-ipc requires threads, and then individual # mechanisms
> >+have their own requirements.
> >+ifndef NO_PTHREADS
> >+	BASIC_CFLAGS += -DSUPPORTS_SIMPLE_IPC
> > 	LIB_OBJS += compat/simple-ipc/ipc-shared.o
> >+ifndef NO_UNIX_SOCKETS
> > 	LIB_OBJS += compat/simple-ipc/ipc-unix-socket.o
> > endif
> >-
> > ifdef USE_WIN32_IPC
> >-	LIB_OBJS += compat/simple-ipc/ipc-shared.o
> > 	LIB_OBJS += compat/simple-ipc/ipc-win32.o  endif
> >+endif
> >
> > ifdef NO_ICONV
> > 	BASIC_CFLAGS += -DNO_ICONV
> >diff --git a/simple-ipc.h b/simple-ipc.h index dc3606e30b..0f58be7945 100644
> >--- a/simple-ipc.h
> >+++ b/simple-ipc.h
> >@@ -4,11 +4,6 @@
> > /*
> >  * See Documentation/technical/api-simple-ipc.txt
> >  */
> >-
> >-#if defined(GIT_WINDOWS_NATIVE) || !defined(NO_UNIX_SOCKETS) -#define SUPPORTS_SIMPLE_IPC -#endif
> >-
> > #ifdef SUPPORTS_SIMPLE_IPC
> > #include "pkt-line.h"
> 
> I'm not sure this is going to work. The platform *does* support UNIX
> sockets (and not disabled) and pthreads, but we have disabled pthreads
> in our build. So in the above, ipc-unix-socket.o will be included at
> the ifndef NO_UNIX_SOCKETS. If NO_PTHREADS, not being pedantic, there
> should be no pthread references, regardless of other considerations.
> Although, at some point, I hope to resolve why pthreads (PUT) is
> having issues in git on the platform but not at this point.

Unless I screwed something up, it shouldn't be. There's an outer ifndef for NO_PTHREADS. Double negation aside, that means that we don't even hit the ifndef NO_UNIX_SOCKETS inside it unless we now pthreads are supported. And so we do not include ipc-unix-socket.o.

For the SUPPORTS_SIMPLE_IPC flag, I just moved the logic into the Makefile. It could continue to live in simple-ipc.h, too (but then that is basically a repetition of the Makefile logic; it would have to learn the same "only if pthreads are available" conditional, too).

-Peff
Previous: Randall S. Becker
Message 7 of 7 in “[BUG] Unix Builds Requires Pthread Support (was [PATCH v4 00/12] Simple IPC Mechanism)”
  1. Randall S. BeckerMay 17, 2021
  2. Jeff KingMay 18, 2021
  3. Jeff HostetlerMay 18, 2021
  4. Jeff KingMay 18, 2021
  5. Jeff HostetlerMay 18, 2021
  6. Randall S. BeckerMay 18, 2021
  7. Jeff KingMay 18, 2021

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.