Skip to contentSkip to conversation

package/uclibc: patch to remove pthread_atfork dummy for noMMU

PATCH Applied Waldemar Brodkorb 2 participants 3 messages Oct 13 – Oct 23

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/uclibc: patch to remove pthread_atfork dummy for noMMU

For noMMU pthread_atfork() is only a dummy.
This causes build failures in util-linux: the configure.ac script detects pthread_atfork() presence because the symbol exists, but the build fails because the prototype isn't there.

Fixes:
- https://autobuild.buildroot.net/results/936/93637dfaabad0a1f11a94488421f6cc73882817f/

---
 ...threads-add-dummy-for-pthread_atfork.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/uclibc/0005-Revert-linuxthreads-add-dummy-for-pthread_atfork.patch
package/uclibc/0005-Revert-linuxthreads-add-dummy-for-pthread_atfork.patch new file +43 -0
new file mode 100644
index 0000000000..66605aa657
@@ -0,0 +1,43 @@
+From 2e902dccb925f1f185836bbad2284e2879550cb3 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <[email protected]>
+Date: Sun, 11 Oct 2026 16:25:53 +0200
+Subject: [PATCH] Revert "linuxthreads: add dummy for pthread_atfork"
+
+This reverts commit 9e38e0aa45cca21d5023d0af94377f0e1e41d2f4.
+
+As reported on the uClibc-ng mailinglist by Thomas Petazzoni
+this dummy without proper prototype is breaking util-linux
+compilation. My usecase in 2017 was curl+libressl. Since then
+I moved from libressl to libopenssl and that works fine without
+pthread_atfork(). Tested with curl in Qemu for RISCV64 noMMU flat.
+
+Upstream: https://gogs.waldemar-brodkorb.de/oss/uclibc-ng/commit/2e902dccb925f1f185836bbad2284e2879550cb3
+Signed-off-by: Waldemar Brodkorb <[email protected]>
+---
+ libpthread/linuxthreads/ptfork.c | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
+index a1bad3d54..74d630830 100644
+--- a/libpthread/linuxthreads/ptfork.c
++++ b/libpthread/linuxthreads/ptfork.c
+@@ -150,16 +150,4 @@ static pid_t __fork(void)
+ strong_alias(__fork,fork)
+ strong_alias(__fork,vfork)
+ 
+-#else
+-
+-/* We can't support pthread_atfork without MMU, since we don't have
+-   fork(), and we can't offer the correct semantics for vfork().
+-   But instead of failing, just provide a dummy */
+-int pthread_atfork(void (*prepare)(void),
+-                  void (*parent)(void),
+-                  void (*child)(void))
+-{
+-  return 0;
+-}
+-
+ #endif
+-- 
+2.47.3
+
Signature · 6 lines
2.47.3

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · Waldemar Brodkorb

For noMMU pthread_atfork() is only a dummy.
This causes build failures in util-linux: the configure.ac script detects pthread_atfork() presence because the symbol exists, but the build fails because the prototype isn't there.

Fixes:
- https://autobuild.buildroot.net/results/936/93637dfaabad0a1f11a94488421f6cc73882817f/

Applied to master, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
In reply to Waldemar Brodkorb

In reply of:

Quoted 9 lines

For noMMU pthread_atfork() is only a dummy.
This causes build failures in util-linux: the configure.ac script detects pthread_atfork() presence because the symbol exists, but the build fails because the prototype isn't there.

Fixes:
- https://autobuild.buildroot.net/results/936/93637dfaabad0a1f11a94488421f6cc73882817f/

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 44 lines
---
 ...threads-add-dummy-for-pthread_atfork.patch | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 package/uclibc/0005-Revert-linuxthreads-add-dummy-for-pthread_atfork.patch
package/uclibc/0005-Revert-linuxthreads-add-dummy-for-pthread_atfork.patch new file +33 -0
new file mode 100644
index 0000000000..66605aa657
@@ -0,0 +1,43 @@
+From 2e902dccb925f1f185836bbad2284e2879550cb3 Mon Sep 17 00:00:00 2001
+From: Waldemar Brodkorb <[email protected]>
+Date: Sun, 11 Oct 2026 16:25:53 +0200
+Subject: [PATCH] Revert "linuxthreads: add dummy for pthread_atfork"
+
+This reverts commit 9e38e0aa45cca21d5023d0af94377f0e1e41d2f4.
+
+As reported on the uClibc-ng mailinglist by Thomas Petazzoni
+this dummy without proper prototype is breaking util-linux
+compilation. My usecase in 2017 was curl+libressl. Since then
+I moved from libressl to libopenssl and that works fine without
+pthread_atfork(). Tested with curl in Qemu for RISCV64 noMMU flat.
+
+Upstream: https://gogs.waldemar-brodkorb.de/oss/uclibc-ng/commit/2e902dccb925f1f185836bbad2284e2879550cb3
+Signed-off-by: Waldemar Brodkorb <[email protected]>
+---
+ libpthread/linuxthreads/ptfork.c | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
+index a1bad3d54..74d630830 100644
+--- a/libpthread/linuxthreads/ptfork.c
++++ b/libpthread/linuxthreads/ptfork.c
+@@ -150,16 +150,4 @@ static pid_t __fork(void)
+ strong_alias(__fork,fork)
+ strong_alias(__fork,vfork)
+ 
+-#else
+-
+-/* We can't support pthread_atfork without MMU, since we don't have
+-   fork(), and we can't offer the correct semantics for vfork().
+-   But instead of failing, just provide a dummy */
+-int pthread_atfork(void (*prepare)(void),

package/uclibc/0005-Revert-linuxthreads-add-dummy-for-pthread_atfork.patch line 43

Quoted 10 lines
package/uclibc/0005-Revert-linuxthreads-add-dummy-for-pthread_atfork.patch new file +10 -0
+-                  void (*parent)(void),
+-                  void (*child)(void))
+-{
+-  return 0;
+-}
+-
+ #endif
+-- 
+2.47.3
+

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot