Skip to content

Commit

Permalink
rustc: Improve musl support
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Ericson2314 committed Dec 2, 2020
1 parent 7781642 commit 47b9976
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkgs/development/compilers/rust/rustc.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{ stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
, targetPackages
, fetchurl, file, python3
, llvm_10, darwin, cmake, rust, rustPlatform
, pkgconfig, openssl
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 47b9976

Please sign in to comment.