about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2015-04-08 15:12:08 -0700
committerBrian Anderson <banderson@mozilla.com>2015-04-08 15:12:08 -0700
commit6d17c35cd5fb806eb81441a1cbea755b0efc41ad (patch)
tree30457f5ee9d28b19f4e9f66258e6153ad40e89bd
parent1002155c755562b8932251b50dac149edf8c885b (diff)
downloadrust-6d17c35cd5fb806eb81441a1cbea755b0efc41ad.tar.gz
rust-6d17c35cd5fb806eb81441a1cbea755b0efc41ad.zip
configure: Add --enable-debug-jemalloc
-rwxr-xr-xconfigure3
-rw-r--r--mk/rt.mk4
2 files changed, 7 insertions, 0 deletions
diff --git a/configure b/configure
index 4d2868ede5c..b23cfaf976f 100755
--- a/configure
+++ b/configure
@@ -550,6 +550,7 @@ opt_nosave optimize-llvm 1 "build optimized LLVM"
 opt_nosave llvm-assertions 0 "build LLVM with assertions"
 opt_nosave debug-assertions 0 "build with debugging assertions"
 opt_nosave debuginfo 0 "build with debugger metadata"
+opt_nosave debug-jemalloc 0 "build jemalloc with --enable-debug --enable-fill"
 
 valopt localstatedir "/var/lib" "local state directory"
 valopt sysconfdir "/etc" "install system configuration files"
@@ -633,6 +634,7 @@ if [ -n "$CFG_ENABLE_DEBUG" ]; then
     CFG_DISABLE_OPTIMIZE_LLVM=1
     CFG_ENABLE_LLVM_ASSERTIONS=1
     CFG_ENABLE_DEBUG_ASSERTIONS=1
+    CFG_ENABLE_DEBUG_JEMALLOC=1
 fi
 
 # OK, now write the debugging options
@@ -642,6 +644,7 @@ if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then putvar CFG_DISABLE_OPTIMIZE_LLVM; f
 if [ -n "$CFG_ENABLE_LLVM_ASSERTIONS" ]; then putvar CFG_ENABLE_LLVM_ASSERTIONS; fi
 if [ -n "$CFG_ENABLE_DEBUG_ASSERTIONS" ]; then putvar CFG_ENABLE_DEBUG_ASSERTIONS; fi
 if [ -n "$CFG_ENABLE_DEBUGINFO" ]; then putvar CFG_ENABLE_DEBUGINFO; fi
+if [ -n "$CFG_ENABLE_DEBUG_JEMALLOC" ]; then putvar CFG_ENABLE_DEBUG_JEMALLOC; fi
 
 # A magic value that allows the compiler to use unstable features
 # during the bootstrap even when doing so would normally be an error
diff --git a/mk/rt.mk b/mk/rt.mk
index 527485c5029..70abce8b460 100644
--- a/mk/rt.mk
+++ b/mk/rt.mk
@@ -143,6 +143,10 @@ else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
   JEMALLOC_ARGS_$(1) := --disable-tls
 endif
 
+ifdef CFG_ENABLE_DEBUG_JEMALLOC
+  JEMALLOC_ARGS_$(1) += --enable-debug --enable-fill
+endif
+
 ################################################################################
 # jemalloc
 ################################################################################