summary refs log tree commit diff
path: root/pkgs/development/compilers/rust
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2020-11-29 17:47:51 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2020-12-02 15:30:51 +0000
commit47b99769f9dbc775950830f8a230fccadf46ab87 (patch)
tree48cb32ab869667d23df83f295bd866f06c17befd /pkgs/development/compilers/rust
parent77816426b69bb754d3f370f22f2a9b211484d227 (diff)
downloadnixpkgs-47b99769f9dbc775950830f8a230fccadf46ab87.tar
nixpkgs-47b99769f9dbc775950830f8a230fccadf46ab87.tar.gz
nixpkgs-47b99769f9dbc775950830f8a230fccadf46ab87.tar.bz2
nixpkgs-47b99769f9dbc775950830f8a230fccadf46ab87.tar.lz
nixpkgs-47b99769f9dbc775950830f8a230fccadf46ab87.tar.xz
nixpkgs-47b99769f9dbc775950830f8a230fccadf46ab87.tar.zst
nixpkgs-47b99769f9dbc775950830f8a230fccadf46ab87.zip
rustc: Improve musl support
There was a slight error in the target logic I didn't notice before, and
also should do the same thing for the other platforms.
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r--pkgs/development/compilers/rust/rustc.nix7
1 files changed, 5 insertions, 2 deletions
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index 1fd3bbaba92..dab1f2a6bd8 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -1,5 +1,4 @@
 { stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
-, targetPackages
 , fetchurl, file, python3
 , llvm_10, darwin, cmake, rust, rustPlatform
 , pkgconfig, openssl
@@ -93,8 +92,12 @@ in stdenv.mkDerivation rec {
     "${setTarget}.llvm-config=${llvmSharedForTarget}/bin/llvm-config"
   ] ++ optionals (stdenv.isLinux && !stdenv.targetPlatform.isRedox) [
     "--enable-profiler" # build libprofiler_builtins
+  ] ++ optionals stdenv.buildPlatform.isMusl [
+    "${setBuild}.musl-root=${pkgsBuildBuild.targetPackages.stdenv.cc.libc}"
+  ] ++ optionals stdenv.hostPlatform.isMusl [
+    "${setHost}.musl-root=${pkgsBuildHost.targetPackages.stdenv.cc.libc}"
   ] ++ optionals stdenv.targetPlatform.isMusl [
-    "${setTarget}.musl-root=${targetPackages.stdenv.cc.libc}"
+    "${setTarget}.musl-root=${pkgsBuildTarget.targetPackages.stdenv.cc.libc}"
   ];
 
   # The bootstrap.py will generated a Makefile that then executes the build.