From 7c54269eaf455ef177af03b44f733b565026c1d7 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 9 May 2022 04:36:23 -0700 Subject: [PATCH 1/2] nbench: supply stdenv.glibc.static since Makefile uses -static nbench's Makefile always compiles with -static, so we need it to be able to see libc.a. Let's add stdenv.glibc.static to the buildInputs. --- pkgs/tools/misc/nbench/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/tools/misc/nbench/default.nix b/pkgs/tools/misc/nbench/default.nix index 16e67b848d65d..b53c05f35394d 100644 --- a/pkgs/tools/misc/nbench/default.nix +++ b/pkgs/tools/misc/nbench/default.nix @@ -16,6 +16,8 @@ stdenv.mkDerivation rec { substituteInPlace Makefile --replace "-static" "" ''; + buildInputs = [ stdenv.glibc.static ]; + makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; installPhase = '' From 162ed74d6c953f3732c9efedff66a829f1bf1296 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 9 May 2022 05:06:28 -0700 Subject: [PATCH 2/2] predicate on isGnu --- pkgs/tools/misc/nbench/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/nbench/default.nix b/pkgs/tools/misc/nbench/default.nix index b53c05f35394d..744ce314ec4e2 100644 --- a/pkgs/tools/misc/nbench/default.nix +++ b/pkgs/tools/misc/nbench/default.nix @@ -16,7 +16,9 @@ stdenv.mkDerivation rec { substituteInPlace Makefile --replace "-static" "" ''; - buildInputs = [ stdenv.glibc.static ]; + buildInputs = lib.optionals stdenv.hostPlatform.isGnu [ + stdenv.glibc.static + ]; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];