diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index ce0dcf1613bf..bd883d1bea86 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -136,6 +136,10 @@ in stdenv.mkDerivation rec { # Useful debugging parameter # export VERBOSE=1 + '' + lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) '' + # See https://github.com/jemalloc/jemalloc/issues/1997 + # Using a value of 48 should work on both emulated and native x86_64-darwin. + export JEMALLOC_SYS_WITH_LG_VADDR=48 ''; # rustc unfortunately needs cmake to compile llvm-rt but doesn't