cargoSetupHook: set crt-static

Tell rust if we want our binaries linked statically or dynamically.
Otherwise the compiler will always produce statically linked binaries for musl
targets, as this is the default.
This commit is contained in:
Yureka 2022-08-13 14:43:50 +02:00
parent 66ac47bdf6
commit 51c62063e3

View File

@ -76,6 +76,7 @@ in {
[target."${shortTarget}"]
"linker" = "${ccForHost}"
''}
"rustflags" = [ "-C", "target-feature=${if stdenv.hostPlatform.isStatic then "+" else "-"}crt-static" ]
'';
};
} ./cargo-setup-hook.sh) {};