From b0f202003e6e95d842ae071700edef96c0bfb40c Mon Sep 17 00:00:00 2001 From: ghpzin Date: Sun, 30 Mar 2025 14:48:54 +0300 Subject: [PATCH] untie: fix build with gcc14 - add patch that adds `#define _GNU_SOURCE` to `untie.c`, as glibc wrapper over clone syscall is not declared otherwise. Fixes `-Wimplicit-function-declaration` error: ``` untie.c:411:15: error: implicit declaration of function 'clone'; did you mean 'close'? [] 411 | ret = clone(child_process, &stack[STACK_SIZE - 1], flags, &args_info); | ^~~~~ | close make: *** [: untie.o] Error 1 ``` --- pkgs/by-name/un/untie/add-define-gnu-source.patch | 12 ++++++++++++ pkgs/by-name/un/untie/package.nix | 5 +++++ 2 files changed, 17 insertions(+) create mode 100644 pkgs/by-name/un/untie/add-define-gnu-source.patch diff --git a/pkgs/by-name/un/untie/add-define-gnu-source.patch b/pkgs/by-name/un/untie/add-define-gnu-source.patch new file mode 100644 index 000000000000..aaaf99149e31 --- /dev/null +++ b/pkgs/by-name/un/untie/add-define-gnu-source.patch @@ -0,0 +1,12 @@ +diff --git a/untie.c b/untie.c +index f08a10d..d3d20b4 100644 +--- a/untie.c ++++ b/untie.c +@@ -18,6 +18,7 @@ + * Copyright (c) 2006, 2007 Guillaume Chazarain + */ + ++#define _GNU_SOURCE + #include + #include + #include diff --git a/pkgs/by-name/un/untie/package.nix b/pkgs/by-name/un/untie/package.nix index 9dee6d7e422d..2bb38695f509 100644 --- a/pkgs/by-name/un/untie/package.nix +++ b/pkgs/by-name/un/untie/package.nix @@ -12,6 +12,11 @@ stdenv.mkDerivation rec { sha256 = "1334ngvbi4arcch462mzi5vxvxck4sy1nf0m58116d9xmx83ak0m"; }; + patches = [ + # fix build with gcc14 + ./add-define-gnu-source.patch + ]; + makeFlags = [ "PREFIX=$(out)" ]; meta = with lib; {