@@ -92,6 +92,13 @@ stdenv.mkDerivation {
9292
9393 # Useful debugging parameter
9494 # export VERBOSE=1
95+ '' +
96+ # In src/compiler-rt/cmake/config-ix.cmake, the cmake build falls
97+ # back to darwin 10.4. This causes the OS name to be recorded as
98+ # "10.4" rather than the expected "osx". But mk/rt.mk expects the
99+ # built library name to have an "_osx" suffix on darwin.
100+ optionalString stdenv.isDarwin ''
101+ substituteInPlace mk/rt.mk --replace "_osx" "_10.4"
95102 '';
96103
97104 preConfigure = ''
@@ -118,7 +125,13 @@ stdenv.mkDerivation {
118125
119126 preCheck = ''
120127 export TZDIR=${tzdata}/share/zoneinfo
121− ${optionalString stdenv.isDarwin "export TMPDIR=/tmp"}
128+ '' +
129+ # Ensure TMPDIR is set, and disable a test that removing the HOME
130+ # variable from the environment falls back to another home
131+ # directory.
132+ optionalString stdenv.isDarwin ''
133+ export TMPDIR=/tmp
134+ sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
122135 '';
123136
124137 # Disable doCheck on Darwin to work around upstream issue