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

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

From
Randall S. Becker <rsbecker@nexbridge.com>
Date
May 17, 2021, 17:46 UTC
Message-ID
<009d01d74b44$9efe8a60$dcfb9f20$@nexbridge.com>
On Wed, 17 Feb 2021 21:48:36, Jeff Hostetler wrote:
>Here is V4 of my "Simple IPC" series. It addresses Gábor's comment WRT
>shutting down the server to make unit tests more predictable on CI servers.
>(https://lore.kernel.org/git/20210213093052.GJ1015009@szeder.dev)

I missed this at the time, but it appears that ipc-unix-socket.c forces a dependency on pthreads for Git under Unix-like platforms. This is probably not a correct assumption (or likely intended), but causes git to no longer build on NonStop x86 and ia64 as of 2.32.0-rc0. I am not suggesting undoing this, but amending to make the change more sensitive to a lack of pthread support. pthread_sigmask() showed up as an undefined external:

**** ERROR **** [1210]:
   libgit.a(ipc-unix-socket.o): In function `thread_block_sigpipe':
   ipc-unix-socket.o(.text+0xb87): unresolved reference to pthread_sigmask.

On NonStop, pthread_sigmask is defined in -lput or -lspt, which are not used in our build – and would cause a bunch of other issues if referenced. The build does define NO_PTHREADS.

A simple, but probably wrong fix to get the build to work is:
diff --git a/compat/simple-ipc/ipc-unix-socket.c b/compat/simple-ipc/ipc-unix-socket.c
index 38689b278d..07b2c407c1 100644
--- a/compat/simple-ipc/ipc-unix-socket.c
+++ b/compat/simple-ipc/ipc-unix-socket.c
@@ -535,7 +535,9 @@ static void thread_block_sigpipe(sigset_t *old_set)
        sigaddset(&new_set, SIGPIPE);

        sigemptyset(old_set);
+#ifndef NO_PTHREADS
        pthread_sigmask(SIG_BLOCK, &new_set, old_set);
+#endif
 }

But I suspect that this will not perform the desired action associated with blocking the signal, although since we are not in a
threading situation, that might be fine.

Thoughts?

Randall

-- Brief whoami:
NonStop developer since approximately 211288444200000000
UNIX developer since approximately 421664400
IBM developer since "I'm not talking about it"
-- In my real life, I talk too much.
Next: Jeff King
Message 1 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.