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
c6dd11ca39, meaning we should no longer
attempt to link against that lib.
This commit is contained in:
Tobias Mayer 2022-05-24 18:03:33 +02:00
parent 41cc1d5d95
commit 1e447d7898

View File

@ -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 "");