From 1e447d78982c086d88509564d3176291746bc34b Mon Sep 17 00:00:00 2001 From: Tobias Mayer Date: Tue, 24 May 2022 18:03:33 +0200 Subject: [PATCH] pkgsStatic.python3: fix build GCC does not come with a `libgcc_eh.a` for the target platform if it was built without `--enable-shared`. That flag was removed with c6dd11ca39ac87899c92b13a743f104c31cadb26, meaning we should no longer attempt to link against that lib. --- pkgs/development/interpreters/python/cpython/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 4463dc8e9ba0..1900296abb7f 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -289,7 +289,7 @@ in with passthru; stdenv.mkDerivation { CPPFLAGS = concatStringsSep " " (map (p: "-I${getDev p}/include") buildInputs); LDFLAGS = concatStringsSep " " (map (p: "-L${getLib p}/lib") buildInputs); LIBS = "${optionalString (!stdenv.isDarwin) "-lcrypt"}"; - NIX_LDFLAGS = lib.optionalString stdenv.cc.isGNU ({ + NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) ({ "glibc" = "-lgcc_s"; "musl" = "-lgcc_eh"; }."${stdenv.hostPlatform.libc}" or "");