Bug 1144842 (part 2) - Make --enable-dmd imply --enable-profiling. r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 21 Jan 2016 16:58:50 -0800
changeset 281456 16b98426457ca48e93c896bf4cc0d992b59d8832
parent 281455 0517f538cdf85acc421736e65b3febab41d9706d
child 281457 29271e7d0c2362109080fb8cfbbbbadba0c4f0f6
push id17203
push usercbook@mozilla.com
push dateMon, 25 Jan 2016 11:46:20 +0000
treeherderfx-team@c39242d264c8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1144842
milestone46.0a1
Bug 1144842 (part 2) - Make --enable-dmd imply --enable-profiling. r=glandium. This requires moving the --enable-dmd code earlier, before MOZ_PROFILING starts being used.
configure.in
memory/replace/dmd/DMD.cpp
--- a/configure.in
+++ b/configure.in
@@ -1795,16 +1795,39 @@ if test "$MOZ_PROFILING" -a -z "$STRIP_F
     case "$OS_TARGET" in
     Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
         STRIP_FLAGS="--strip-debug"
         ;;
     esac
 fi
 
 dnl ========================================================
+dnl = Enable DMD
+dnl ========================================================
+
+MOZ_ARG_ENABLE_BOOL(dmd,
+[  --enable-dmd            Enable DMD; also enables jemalloc, replace-malloc and profiling],
+    MOZ_DMD=1,
+    MOZ_DMD= )
+
+if test "$MOZ_DMD"; then
+    AC_DEFINE(MOZ_DMD)
+
+    if test "${CPU_ARCH}" = "arm"; then
+        CFLAGS="$CFLAGS -funwind-tables"
+        CXXFLAGS="$CXXFLAGS -funwind-tables"
+    fi
+
+    MOZ_MEMORY=1                        # DMD enables jemalloc
+    MOZ_REPLACE_MALLOC=1                # DMD enables replace-malloc
+    MOZ_PROFILING=1                     # DMD enables profiling
+fi
+AC_SUBST(MOZ_DMD)
+
+dnl ========================================================
 dnl Profiling
 dnl ========================================================
 if test -n "$MOZ_PROFILING"; then
     AC_DEFINE(MOZ_PROFILING)
 fi
 
 dnl ========================================================
 dnl System overrides of the defaults for host
@@ -7058,38 +7081,16 @@ if test -n "$MOZ_DUMP_PAINTING"; then
     AC_DEFINE(MOZ_DUMP_PAINTING)
     AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
 fi
 if test -n "$MOZ_DEBUG"; then
     AC_DEFINE(MOZ_DUMP_PAINTING)
 fi
 
 dnl ========================================================
-dnl = Enable DMD
-dnl ========================================================
-
-MOZ_ARG_ENABLE_BOOL(dmd,
-[  --enable-dmd            Enable DMD; also enables jemalloc and replace-malloc],
-    MOZ_DMD=1,
-    MOZ_DMD= )
-
-if test "$MOZ_DMD"; then
-    AC_DEFINE(MOZ_DMD)
-
-    if test "${CPU_ARCH}" = "arm"; then
-        CFLAGS="$CFLAGS -funwind-tables"
-        CXXFLAGS="$CXXFLAGS -funwind-tables"
-    fi
-
-    MOZ_MEMORY=1                        # DMD enables jemalloc
-    MOZ_REPLACE_MALLOC=1                # DMD enables replace-malloc
-fi
-AC_SUBST(MOZ_DMD)
-
-dnl ========================================================
 dnl = Enable jemalloc
 dnl ========================================================
 MOZ_ARG_ENABLE_BOOL(jemalloc,
 [  --enable-jemalloc       Replace memory allocator with jemalloc],
     MOZ_MEMORY=1,
     MOZ_MEMORY=)
 
 case "${OS_TARGET}" in
--- a/memory/replace/dmd/DMD.cpp
+++ b/memory/replace/dmd/DMD.cpp
@@ -7,20 +7,21 @@
 #include <ctype.h>
 #include <errno.h>
 #include <limits.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#if !defined(MOZ_PROFILING)
+#error "DMD requires MOZ_PROFILING"
+#endif
+
 #ifdef XP_WIN
-#if defined(MOZ_OPTIMIZE) && !defined(MOZ_PROFILING)
-#error "Optimized, DMD-enabled builds on Windows must be built with --enable-profiling"
-#endif
 #include <windows.h>
 #include <process.h>
 #else
 #include <unistd.h>
 #endif
 
 #ifdef ANDROID
 #include <android/log.h>