Files
nixpkgs/pkgs/by-name/li/libfyaml/pthread-darwin.patch
𝑷𝒉𝒊𝒍𝒐𝒄𝒂𝒍𝒚𝒔𝒕 1860b778a5 libfyaml: fixing pflag mismatched intention
the assumption of the code is that if there are no lib flags set, then
just use the fallback of lpthread.

BUT! The way libSystem passes to it nothing because it's trying to
communicate that it's taking care of it using PTHREAD_CFLAGS. It leads
to this weird situation where both are passed!
2026-05-12 10:03:40 -04:00

13 lines
490 B
Diff

--- a/configure.ac
+++ b/configure.ac
@@ -99,6 +99,7 @@
AX_PTHREAD([], [AC_MSG_ERROR("Missing required pthread support")])
-# in some cases PTHREAD_LIBS is empty - force -lpthread */
-if test "x$PTHREAD_LIBS" = "x"; then
+# In some cases PTHREAD_LIBS is empty; force -lpthread only when PTHREAD_CFLAGS
+# also provides no pthread support (e.g. on Darwin, -pthread in CFLAGS suffices).
+if test "x$PTHREAD_LIBS" = "x" && test "x$PTHREAD_CFLAGS" = "x"; then
PTHREAD_LIBS="-lpthread"
fi