@@ -1,6 +1,6 @@
11{ stdenv, targetPackages, removeReferencesTo
22, fetchurl, fetchgit, fetchzip, file, python2, tzdata, ps
3−, llvm, ncurses, darwin, rustPlatform, git, cmake, curl
3+, llvm, jemalloc, ncurses, darwin, rustPlatform, git, cmake, curl
44, which, libffi, gdb
55, version
66, withBundledLLVM ? false
@@ -20,6 +20,8 @@ let
2020
2121 llvmShared = llvm.override { enableSharedLibraries = true; };
2222
23+ prefixedJemalloc = jemalloc.override { stripPrefix = false; };
24+
2325 target = builtins.replaceStrings [" "] [","] (builtins.toString targets);
2426in
2527
@@ -60,6 +62,7 @@ stdenv.mkDerivation {
6062 configureFlags = configureFlags
6163 ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath"
6264 "--enable-vendor"
65+ "--jemalloc-root=${prefixedJemalloc}/lib"
6366 "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ]
6467 ++ optional (!withBundledLLVM) [ "--enable-llvm-link-shared" "--llvm-root=${llvmShared}" ]
6568 ++ optional (targets != []) "--target=${target}";
@@ -82,6 +85,7 @@ stdenv.mkDerivation {
8285 patchShebangs src/etc
8386
8487 ${optionalString (!withBundledLLVM) ''rm -rf src/llvm''}
88+ rm -rf src/jemalloc
8589
8690 # Fix the configure script to not require curl as we won't use it
8791 sed -i configure \
@@ -93,7 +97,7 @@ stdenv.mkDerivation {
9397 # https://github.com/rust-lang/rust/issues/39522
9498 echo removing gdb-version-sensitive tests...
9599 find src/test/debuginfo -type f -execdir grep -q ignore-gdb-version '{}' \; -print -delete
96− rm src/test/debuginfo/{borrowed-c-style-enum.rs,c-style-enum-in-composite.rs,generic-enum-with-different-disr-sizes.rs}
100+ rm src/test/debuginfo/{borrowed-c-style-enum.rs,c-style-enum-in-composite.rs,gdb-pretty-struct-and-enums-pre-gdb-7-7.rs,generic-enum-with-different-disr-sizes.rs}
97101
98102 # Useful debugging parameter
99103 # export VERBOSE=1