From f0b7561275eba64804854328fa77cf480e814f81 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Tue, 23 Apr 2019 09:25:12 -0400 Subject: [PATCH] rustc: use llvm5 for bootstrapping --- pkgs/development/compilers/rust/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/rust/default.nix b/pkgs/development/compilers/rust/default.nix index 47df7e716dc1..5c3c08952074 100644 --- a/pkgs/development/compilers/rust/default.nix +++ b/pkgs/development/compilers/rust/default.nix @@ -2,6 +2,8 @@ , buildPackages , newScope, callPackage , CoreFoundation, Security +, llvmPackages_5 +, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost }: rec { makeRustPlatform = { rustc, cargo, ... }: { rust = { @@ -48,10 +50,15 @@ buildRustPackages = buildPackages.rust.packages.stable; # Analogous to stdenv rustPlatform = makeRustPlatform self.buildRustPackages; - rustc = self.callPackage ./rustc.nix { + rustc = self.callPackage ./rustc.nix ({ # Use boot package set to break cycle rustPlatform = bootRustPlatform; - }; + } // lib.optionalAttrs (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) { + stdenv = llvmPackages_5.stdenv; + pkgsBuildBuild = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages_5.stdenv; }; + pkgsBuildHost = pkgsBuildBuild // { targetPackages.stdenv = llvmPackages_5.stdenv; }; + pkgsBuildTarget = pkgsBuildTarget // { targetPackages.stdenv = llvmPackages_5.stdenv; }; + }); cargo = self.callPackage ./cargo.nix { # Use boot package set to break cycle rustPlatform = bootRustPlatform;