From 4cdf41c344968cf9f49cfcf46f71dab1c4586475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=B7=F0=9D=92=89=F0=9D=92=8A=F0=9D=92=8D?= =?UTF-8?q?=F0=9D=92=90=F0=9D=92=84=F0=9D=92=82=F0=9D=92=8D=F0=9D=92=9A?= =?UTF-8?q?=F0=9D=92=94=F0=9D=92=95?= Date: Thu, 7 May 2026 18:00:15 -0400 Subject: [PATCH 1/3] libfyaml: patch for C11 atomics detection and macros --- pkgs/by-name/li/libfyaml/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/li/libfyaml/package.nix b/pkgs/by-name/li/libfyaml/package.nix index ebbaae3748d8..26cc0461020b 100644 --- a/pkgs/by-name/li/libfyaml/package.nix +++ b/pkgs/by-name/li/libfyaml/package.nix @@ -25,6 +25,11 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/pantoniou/libfyaml/commit/0982fcefc6a16d4c8cb5b06747d3fc8e630de3ae.diff"; hash = "sha256-aDubIn+et+1fWE7XU7a5AGZVacVFbAbC1PoSDrA6hXw="; }) + # backport "Fix C11 atomics detection and buggy macros for C++ compatibility" + (fetchpatch { + url = "https://github.com/pantoniou/libfyaml/commit/1026d76850909dc9b1c5f95b8cd94e865a313fd5.diff"; + hash = "sha256-0YfOqdqHdELFMqr52TDAC3BNFLkcuxvuJY5b9yZ7NFk="; + }) (fetchpatch { url = "https://github.com/pantoniou/libfyaml/commit/9192deaac095f9881cc1e5756dede683f36b09d6.diff"; hash = "sha256-cNL9wQtxIRg/ShZLJP4qHYNFRrYo9kRG+/U+3FiUeaI="; From 1860b778a5a8abe503b0f6098d292514bc8560ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=B7=F0=9D=92=89=F0=9D=92=8A=F0=9D=92=8D?= =?UTF-8?q?=F0=9D=92=90=F0=9D=92=84=F0=9D=92=82=F0=9D=92=8D=F0=9D=92=9A?= =?UTF-8?q?=F0=9D=92=94=F0=9D=92=95?= Date: Tue, 12 May 2026 07:24:24 -0400 Subject: [PATCH 2/3] 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! --- pkgs/by-name/li/libfyaml/package.nix | 4 ++++ pkgs/by-name/li/libfyaml/pthread-darwin.patch | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 pkgs/by-name/li/libfyaml/pthread-darwin.patch diff --git a/pkgs/by-name/li/libfyaml/package.nix b/pkgs/by-name/li/libfyaml/package.nix index 26cc0461020b..7a7e5dc089c6 100644 --- a/pkgs/by-name/li/libfyaml/package.nix +++ b/pkgs/by-name/li/libfyaml/package.nix @@ -34,6 +34,10 @@ stdenv.mkDerivation (finalAttrs: { url = "https://github.com/pantoniou/libfyaml/commit/9192deaac095f9881cc1e5756dede683f36b09d6.diff"; hash = "sha256-cNL9wQtxIRg/ShZLJP4qHYNFRrYo9kRG+/U+3FiUeaI="; }) + # On Darwin, AX_PTHREAD returns empty PTHREAD_LIBS with -pthread in PTHREAD_CFLAGS; + # don't force -lpthread when PTHREAD_CFLAGS already provides pthread support. + # Pending PR: https://github.com/pantoniou/libfyaml/pull/294 + ./pthread-darwin.patch ]; nativeBuildInputs = [ diff --git a/pkgs/by-name/li/libfyaml/pthread-darwin.patch b/pkgs/by-name/li/libfyaml/pthread-darwin.patch new file mode 100644 index 000000000000..bada0d80d142 --- /dev/null +++ b/pkgs/by-name/li/libfyaml/pthread-darwin.patch @@ -0,0 +1,12 @@ +--- 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 From 59edd93aa956ce3b5ec85c492bbc70c3fc932fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=91=B7=F0=9D=92=89=F0=9D=92=8A=F0=9D=92=8D?= =?UTF-8?q?=F0=9D=92=90=F0=9D=92=84=F0=9D=92=82=F0=9D=92=8D=F0=9D=92=9A?= =?UTF-8?q?=F0=9D=92=94=F0=9D=92=95?= Date: Tue, 12 May 2026 10:03:46 -0400 Subject: [PATCH 3/3] libfyaml: patch for libm "none required" issues --- pkgs/by-name/li/libfyaml/package.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/by-name/li/libfyaml/package.nix b/pkgs/by-name/li/libfyaml/package.nix index 7a7e5dc089c6..4804f7bb9645 100644 --- a/pkgs/by-name/li/libfyaml/package.nix +++ b/pkgs/by-name/li/libfyaml/package.nix @@ -38,6 +38,16 @@ stdenv.mkDerivation (finalAttrs: { # don't force -lpthread when PTHREAD_CFLAGS already provides pthread support. # Pending PR: https://github.com/pantoniou/libfyaml/pull/294 ./pthread-darwin.patch + + # backport "build: don't output 'none required' to LIBM if no linker flags needed for it" + (fetchpatch { + url = "https://github.com/pantoniou/libfyaml/commit/24b18e7363b336962fe160c1dc05ca57ba95783c.diff"; + hash = "sha256-g5QKI4HuS8MEQ9ddIQNC0j+28Dh9zLAp5RaZX5SWBHk="; + }) + (fetchpatch { + url = "https://github.com/pantoniou/libfyaml/commit/9f2492ca27bb1fda64f2b12edc2da17406208b93.diff"; + hash = "sha256-E4wS+P7R3VGrBpD7swWMMi/QPTF+9rzAeEyxhbmdiwk="; + }) ]; nativeBuildInputs = [