mk: Move disable-jemalloc logic into makefiles

The `--disable-jemalloc` configure option has a failure mode where it will
create a distribution that is not compatible with other compilers. For example
the nightly for Linux will assume that it will link to jemalloc by default as
an allocator for executable crates. If, however, a standard library is used
which was built via `./configure --disable-jemalloc` then this will fail
because the jemalloc crate wasn't built.

While this seems somewhat reasonable as a niche situation, the same mechanism is
used for disabling jemalloc for platforms that just don't support it. For
example if the rumprun target is compiled then the sibiling Linux target *also*
doesn't have jemalloc. This is currently a problem for our cross-build nightlies
which build many targets. If rumprun is also built, it will disable jemalloc for
all targets, which isn't desired.

This commit moves the platform-specific disabling of jemalloc as hardcoded logic
into the makefiles that is scoped per-platform. This way when configuring
multiple targets **without the `--disable-jemalloc` option specified** all
targets will get jemalloc as they should.
This commit is contained in:
Alex Crichton 2016-02-08 10:57:41 -08:00
parent a2fb48e9f7
commit b980f22877
18 changed files with 69 additions and 50 deletions

31
configure vendored
View file

@ -865,9 +865,8 @@ fi
# Force bitrig to build with clang; gcc doesn't like us there
if [ $CFG_OSTYPE = unknown-bitrig ]
then
step_msg "on Bitrig, forcing use of clang, disabling jemalloc"
step_msg "on Bitrig, forcing use of clang"
CFG_ENABLE_CLANG=1
CFG_DISABLE_JEMALLOC=1
fi
# default gcc version under OpenBSD maybe too old, try using egcc, which is a
@ -887,16 +886,6 @@ then
CXX="${CXX:-eg++}"
fi
fi
step_msg "on OpenBSD, disabling jemalloc"
CFG_DISABLE_JEMALLOC=1
fi
if [ $CFG_OSTYPE = pc-windows-gnu ]
then
# FIXME(#31030) - there's not a great reason to disable jemalloc here
step_msg "on Windows, disabling jemalloc"
CFG_DISABLE_JEMALLOC=1
fi
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
@ -1186,12 +1175,6 @@ do
;;
*-msvc)
# Currently the build system is not configured to build jemalloc
# with MSVC, so we omit this optional dependency.
step_msg "targeting MSVC, disabling jemalloc"
CFG_DISABLE_JEMALLOC=1
putvar CFG_DISABLE_JEMALLOC
# There are some MSYS python builds which will auto-translate
# windows-style paths to MSYS-style paths in Python itself.
# Unfortunately this breaks LLVM's build system as somewhere along
@ -1300,18 +1283,6 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
putvar CFG_MSVC_LIB_PATH_${bits}
;;
*-rumprun-netbsd)
step_msg "targeting rumprun-netbsd, disabling jemalloc"
CFG_DISABLE_JEMALLOC=1
putvar CFG_DISABLE_JEMALLOC
;;
*-emscripten)
step_msg "targeting emscripten, disabling jemalloc"
CFG_DISABLE_JEMALLOC=1
putvar CFG_DISABLE_JEMALLOC
;;
*)
;;
esac