mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
git: Fix cross compilation
The problem was that Cargo didn't have a way to find a linker for the build platform which is required to link the build script. So, when cross compiling we add in the standard build -> build compiler so that it can compile the build script. This fix was taken from the ideas of @magicquark and @nwf in https://github.com/NixOS/nixpkgs/issues/523378. Fixes #523378
This commit is contained in:
parent
9ff29b46ff
commit
bbe694f8ea
1 changed files with 5 additions and 0 deletions
|
|
@ -212,6 +212,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
libsecret
|
||||
];
|
||||
|
||||
# This is required for building the rust build.rs script when cross compiling
|
||||
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
||||
buildPackages.stdenv.cc
|
||||
];
|
||||
|
||||
env = {
|
||||
# required to support pthread_cancel()
|
||||
NIX_LDFLAGS =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue