rustc: Provide compiler-rt sources

This is needed to build libprofiler_builtins now.

e59f0cc0d3 (diff-daf9539767b10f18e1517f65cdc2e0e2)
https://github.com/rust-lang-nursery/compiler-builtins/issues/295
This commit is contained in:
Eelco Dolstra 2019-08-16 15:05:14 +02:00
parent a4fc84de44
commit b7a8280312

View file

@ -1,6 +1,6 @@
{ stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
, fetchurl, file, python2, tzdata, ps
, llvm_7, darwin, git, cmake, rustPlatform
, llvmPackages_7, darwin, git, cmake, rustPlatform
, which, libffi, gdb
, withBundledLLVM ? false
}:
@ -9,13 +9,17 @@ let
inherit (stdenv.lib) optional optionalString;
inherit (darwin.apple_sdk.frameworks) Security;
llvmSharedForBuild = pkgsBuildBuild.llvm_7.override { enableSharedLibraries = true; };
llvmSharedForHost = pkgsBuildHost.llvm_7.override { enableSharedLibraries = true; };
llvmSharedForTarget = pkgsBuildTarget.llvm_7.override { enableSharedLibraries = true; };
llvmPackages = llvmPackages_7;
llvmSharedForBuild = pkgsBuildBuild.llvmPackages.llvm.override { enableSharedLibraries = true; };
llvmSharedForHost = pkgsBuildHost.llvmPackages.llvm.override { enableSharedLibraries = true; };
llvmSharedForTarget = pkgsBuildTarget.llvmPackages.llvm.override { enableSharedLibraries = true; };
# For use at runtime
llvmShared = llvm_7.override { enableSharedLibraries = true; };
in stdenv.mkDerivation rec {
llvmShared = llvmPackages.llvm.override { enableSharedLibraries = true; };
in
stdenv.mkDerivation rec {
pname = "rustc";
version = "1.37.0";
@ -24,6 +28,12 @@ in stdenv.mkDerivation rec {
sha256 = "1hrqprybhkhs6d9b5pjskfnc5z9v2l2gync7nb39qjb5s0h703hj";
};
# Provide the compiler-rt sources needed for profiling.
preConfigure = ''
mkdir src/llvm-project/compiler-rt
tar xf ${llvmPackages.compiler-rt.src} -C src/llvm-project/compiler-rt --strip-components=1
'';
__darwinAllowLocalNetworking = true;
# rustc complains about modified source files otherwise