diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-01-23 15:51:03 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-01-23 17:25:50 +0100 |
commit | 3bf20e5bf80ebf221cf500412e6df2cb0601aaee (patch) | |
tree | b97541f5246a9c04b80faeec93fdf7f9fea28749 /pkgs/build-support/rust | |
parent | f3a07da669be5ae45211fb08fdf0680909545709 (diff) |
rust.envVars: use wrapped LLD for aarch64 musl
The unwrapped version doesn't know where to look for libraries, so this is required to e.g. build anything that uses openssl-sys with OPENSSL_NO_VENDOR. A randomly chosen example package that's fixed by this change is pkgsStatic.gitoxide.
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r-- | pkgs/build-support/rust/lib/default.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/build-support/rust/lib/default.nix b/pkgs/build-support/rust/lib/default.nix index 4958a42fcdd96..e09f913bfbd39 100644 --- a/pkgs/build-support/rust/lib/default.nix +++ b/pkgs/build-support/rust/lib/default.nix @@ -1,6 +1,7 @@ { lib , stdenv , pkgsBuildHost +, pkgsBuildTarget , pkgsTargetTarget }: @@ -24,7 +25,7 @@ rec { cxxForHost = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++"; linkerForHost = if shouldUseLLD stdenv.targetPlatform && !stdenv.cc.bintools.isLLVM - then "${pkgsBuildHost.lld}/bin/ld.lld" + then "${pkgsBuildHost.llvmPackages.bintools}/bin/${stdenv.cc.targetPrefix}ld.lld" else ccForHost; # Unfortunately we must use the dangerous `pkgsTargetTarget` here @@ -35,7 +36,7 @@ rec { cxxForTarget = "${pkgsTargetTarget.stdenv.cc}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}c++"; linkerForTarget = if shouldUseLLD pkgsTargetTarget.stdenv.targetPlatform && !pkgsTargetTarget.stdenv.cc.bintools.isLLVM # whether stdenv's linker is lld already - then "${pkgsBuildHost.lld}/bin/ld.lld" + then "${pkgsBuildTarget.llvmPackages.bintools}/bin/${pkgsTargetTarget.stdenv.cc.targetPrefix}ld.lld" else ccForTarget; rustBuildPlatform = stdenv.buildPlatform.rust.rustcTarget; |