From 138fbf47184267d5d5d81778d73b1c97315337cc Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 30 Sep 2026 14:34:19 +0000 Subject: [PATCH] enroot: fix build --- pkgs/by-name/en/enroot/package.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/en/enroot/package.nix b/pkgs/by-name/en/enroot/package.nix index 23012ad74ae0..d61233563d38 100644 --- a/pkgs/by-name/en/enroot/package.nix +++ b/pkgs/by-name/en/enroot/package.nix @@ -11,6 +11,9 @@ stdenv.mkDerivation (finalAttrs: { pname = "enroot"; version = "4.2.1"; + __structuredAttrs = true; + strictDeps = true; + src = fetchFromGitHub { owner = "NVIDIA"; repo = "enroot"; @@ -21,7 +24,16 @@ stdenv.mkDerivation (finalAttrs: { postPatch = '' substituteInPlace Makefile \ - --replace-fail 'git submodule update' 'echo git submodule update' + --replace-fail \ + 'git submodule update' \ + 'echo git submodule update' + '' + # GCC >= 16 implicitly links `-latomic_asneeded`, which does not exist in the musl sysroot + + lib.optionalString (stdenv.cc.isGNU && (lib.versionAtLeast stdenv.cc.version "16")) '' + substituteInPlace Makefile \ + --replace-fail \ + '$(UTILS): LDFLAGS += -pie -static-pie' \ + '$(UTILS): LDFLAGS += -pie -static-pie -fno-link-libatomic' ''; makeTarget = "install";