Bug 1014976 - Make MOZ_NO_DEBUG_RTL builds actually disable the MSVC debug CRT everywhere. r=bsmedberg
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 30 May 2014 09:39:44 +0900
changeset 185697 ca0abd3d08bf96c066ffa3d4ba251dc0a82153a2
parent 185696 9ad1fff3aad76ca7f7e4148a25ab3c769cd66978
child 185698 c43eac27b9593030df9f02794bc057ae0b5b3f52
push id44160
push usermh@glandium.org
push dateFri, 30 May 2014 00:41:30 +0000
treeherdermozilla-inbound@0e158358e811 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs1014976
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1014976 - Make MOZ_NO_DEBUG_RTL builds actually disable the MSVC debug CRT everywhere. r=bsmedberg
b2g/installer/Makefile.in
b2g/installer/package-manifest.in
browser/installer/Makefile.in
browser/installer/package-manifest.in
build/autoconf/compiler-opts.m4
build/autoconf/ffi.m4
build/autoconf/icu.m4
build/win32/Makefile.in
configure.in
--- a/b2g/installer/Makefile.in
+++ b/b2g/installer/Makefile.in
@@ -17,18 +17,20 @@ DEFINES += \
 	$(NULL)
 
 DEFINES += -DJAREXT=
 
 DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
 
 # Set MSVC dlls version to package, if any.
 ifdef WIN32_REDIST_DIR
+ifdef MOZ_NO_DEBUG_RTL
 DEFINES += -DMOZ_MSVC_REDIST=$(_MSC_VER)
 endif
+endif
 
 ifdef ENABLE_MARIONETTE
 DEFINES += -DENABLE_MARIONETTE=1
 endif
 
 ifdef MOZ_PKG_MANIFEST_P
 MOZ_PKG_MANIFEST = package-manifest
 endif
--- a/b2g/installer/package-manifest.in
+++ b/b2g/installer/package-manifest.in
@@ -64,29 +64,27 @@
 @BINPATH@/@DLL_PREFIX@xul@DLL_SUFFIX@
 #endif
 #ifdef XP_MACOSX
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
 #else
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
 #endif
 #ifdef XP_WIN32
-#ifndef MOZ_DEBUG
 #if MOZ_MSVC_REDIST == 1600
 @BINPATH@/msvcp100.dll
 @BINPATH@/msvcr100.dll
 #elif MOZ_MSVC_REDIST == 1700
 @BINPATH@/msvcp110.dll
 @BINPATH@/msvcr110.dll
 #elif MOZ_MSVC_REDIST == 1800
 @BINPATH@/msvcp120.dll
 @BINPATH@/msvcr120.dll
 #endif
 #endif
-#endif
 #ifdef MOZ_SHARED_MOZGLUE
 @BINPATH@/@DLL_PREFIX@mozglue@DLL_SUFFIX@
 #endif
 #ifdef MOZ_REPLACE_MALLOC
 #ifndef MOZ_JEMALLOC3
 @BINPATH@/@DLL_PREFIX@replace_jemalloc@DLL_SUFFIX@
 #endif
 #endif
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -67,18 +67,20 @@ ifdef MOZ_D3DCOMPILER_XP_DLL
 DEFINES += -DMOZ_D3DCOMPILER_XP_DLL=$(MOZ_D3DCOMPILER_XP_DLL)
 endif
 endif
 
 DEFINES += -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
 
 # Set MSVC dlls version to package, if any.
 ifdef WIN32_REDIST_DIR
+ifdef MOZ_NO_DEBUG_RTL
 DEFINES += -DMOZ_MSVC_REDIST=$(_MSC_VER)
 endif
+endif
 
 ifneq (,$(filter WINNT Darwin Android,$(OS_TARGET)))
 DEFINES += -DMOZ_SHARED_MOZGLUE=1
 endif
 
 ifdef MOZ_JSDEBUGGER
 DEFINES += -DMOZ_JSDEBUGGER
 endif
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -80,29 +80,27 @@
 #ifdef XP_MACOSX
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@.app/
 @BINPATH@/@DLL_PREFIX@plugin_child_interpose@DLL_SUFFIX@
 #else
 @BINPATH@/@MOZ_CHILD_PROCESS_NAME@
 #endif
 #ifdef XP_WIN32
 @BINPATH@/plugin-hang-ui@BIN_SUFFIX@
-#ifndef MOZ_DEBUG
 #if MOZ_MSVC_REDIST == 1600
 @BINPATH@/msvcp100.dll
 @BINPATH@/msvcr100.dll
 #elif MOZ_MSVC_REDIST == 1700
 @BINPATH@/msvcp110.dll
 @BINPATH@/msvcr110.dll
 #elif MOZ_MSVC_REDIST == 1800
 @BINPATH@/msvcp120.dll
 @BINPATH@/msvcr120.dll
 #endif
 #endif
-#endif
 #ifndef MOZ_NATIVE_ICU
 #ifdef MOZ_SHARED_ICU
 #ifdef XP_WIN
 @BINPATH@/icudt@MOZ_ICU_DBG_SUFFIX@@MOZ_ICU_VERSION@.dll
 @BINPATH@/icuin@MOZ_ICU_DBG_SUFFIX@@MOZ_ICU_VERSION@.dll
 @BINPATH@/icuuc@MOZ_ICU_DBG_SUFFIX@@MOZ_ICU_VERSION@.dll
 #elif defined(XP_MACOSX)
 @BINPATH@/libicudata.@MOZ_ICU_VERSION@.dylib
--- a/build/autoconf/compiler-opts.m4
+++ b/build/autoconf/compiler-opts.m4
@@ -117,16 +117,22 @@ MOZ_ARG_ENABLE_STRING(debug,
         MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
         _MOZ_DEBUG_FLAGS_SET=1
     fi
   else
     MOZ_DEBUG=
   fi ],
   MOZ_DEBUG=)
 
+if test -z "$MOZ_DEBUG"; then
+    MOZ_NO_DEBUG_RTL=1
+fi
+
+AC_SUBST(MOZ_NO_DEBUG_RTL)
+
 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
 MOZ_ARG_WITH_STRING(debug-label,
 [  --with-debug-label=LABELS
                           Define DEBUG_<value> for each comma-separated
                           value given.],
 [ for option in `echo $withval | sed 's/,/ /g'`; do
     MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
 done])
--- a/build/autoconf/ffi.m4
+++ b/build/autoconf/ffi.m4
@@ -44,17 +44,17 @@ if test -z "$BUILDING_JS" -o -n "$JS_STA
     if test "$_MSC_VER"; then
       # Use a wrapper script for cl and ml that looks more like gcc.
       # autotools can't quite handle an MSVC build environment yet.
       LDFLAGS=
       CFLAGS=
       ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" \
                          CXXCPP=\"cl -nologo -EP\" SHELL=sh.exe"
       rtl=
-      if test -n "$MOZ_DEBUG"; then
+      if test -z "$MOZ_NO_DEBUG_RTL" -a -n "$MOZ_DEBUG"; then
         rtl=" -DUSE_DEBUG_RTL"
       fi
       case "${target_cpu}" in
       x86_64)
         # Need target since MSYS tools into mozilla-build may be 32bit
         ac_configure_args="$ac_configure_args \
                            CC=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64$rtl\" \
                            CXX=\"$_topsrcdir/js/src/ctypes/libffi/msvcc.sh -m64$rtl\""
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -81,17 +81,17 @@ if test -n "$ENABLE_INTL_API"; then
     AC_SUBST(MOZ_SHARED_ICU)
 
     if test -z "$MOZ_NATIVE_ICU"; then
         case "$OS_TARGET" in
             WINNT)
                 ICU_LIB_NAMES="icuin icuuc icudt"
                 if test -n "$MOZ_SHARED_ICU"; then
                     MOZ_ICU_DBG_SUFFIX=
-                    if test -n "$MOZ_DEBUG"; then
+                    if test -n "$MOZ_DEBUG" -a -z "$MOZ_NO_DEBUG_RTL"; then
                         MOZ_ICU_DBG_SUFFIX=d
                     fi
                     MOZ_ICU_LIBS='$(foreach lib,$(ICU_LIB_NAMES),$(DEPTH)/intl/icu/target/lib/$(LIB_PREFIX)$(lib)$(MOZ_ICU_DBG_SUFFIX).$(LIB_SUFFIX))'
                 fi
                 ;;
             Darwin)
                 ICU_LIB_NAMES="icui18n icuuc icudata"
                 if test -n "$MOZ_SHARED_ICU"; then
@@ -254,17 +254,17 @@ if test -z "$BUILDING_JS" -o -n "$JS_STA
     	fi
 
     	ICU_LDFLAGS="$MOZ_DEBUG_LDFLAGS"
     	if test -z "$MOZ_DEBUG"; then
     	    # To generate debug symbols, it requires MOZ_DEBUG_FLAGS.
     	    # But, not debug build.
     	    ICU_CFLAGS="$ICU_CFLAGS -UDEBUG -DNDEBUG"
     	    ICU_CXXFLAGS="$ICU_CXXFLAGS -UDEBUG -DNDEBUG"
-    	else
+    	elif test -z "$MOZ_NO_DEBUG_RTL"; then
     	    ICU_BUILD_OPTS="$ICU_BUILD_OPTS --enable-debug"
     	fi
         fi
         if test -z "$MOZ_OPTIMIZE"; then
     	ICU_BUILD_OPTS="$ICU_BUILD_OPTS --disable-release"
         else
     	ICU_CFLAGS="$ICU_CFLAGS $MOZ_OPTIMIZE_FLAGS"
     	ICU_CXXFLAGS="$ICU_CXXFLAGS $MOZ_OPTIMIZE_FLAGS"
@@ -279,17 +279,17 @@ if test -z "$BUILDING_JS" -o -n "$JS_STA
         if test "$GNU_CC"; then
     	ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-fno-rtti|-frtti|g'`
         else
     	if test "$_MSC_VER"; then
     	    ICU_CXXFLAGS=`echo $ICU_CXXFLAGS | sed 's|-GR-|-GR|g'`
     	fi
 
     	# Add RTL flags for MSVCRT.DLL
-    	if test -n "$MOZ_DEBUG"; then
+    	if test -n "$MOZ_DEBUG" -a -z "$MOZ_NO_DEBUG_RTL"; then
     	    ICU_CFLAGS="$ICU_CFLAGS -MDd"
     	    ICU_CXXFLAGS="$ICU_CXXFLAGS -MDd"
     	else
     	    ICU_CFLAGS="$ICU_CFLAGS -MD"
     	    ICU_CXXFLAGS="$ICU_CXXFLAGS -MD"
     	fi
 
     	# add disable optimize flag for workaround for bug 899948
--- a/build/win32/Makefile.in
+++ b/build/win32/Makefile.in
@@ -2,17 +2,16 @@
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MOZ_GLUE_LDFLAGS =
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef WIN32_REDIST_DIR
-ifndef MOZ_DEBUG
 
 ifeq (1600,$(_MSC_VER))
 REDIST_FILES = \
   msvcp100.dll \
   msvcr100.dll \
   $(NULL)
 endif
 
@@ -34,16 +33,15 @@ ifdef REDIST_FILES
 libs-preqs = \
   $(call mkdir_deps,$(FINAL_TARGET)) \
   $(NULL)
 
 libs:: $(libs-preqs)
 	install --preserve-timestamps $(foreach f,$(REDIST_FILES),'$(WIN32_REDIST_DIR)'/$(f)) $(FINAL_TARGET)
 endif
 
-endif # ! MOZ_DEBUG
 endif # WIN32_REDIST_DIR
 
 # run the binscope tool to make sure the binary and all libraries
 # are using all available Windows OS-level security mechanisms
 check::
 	$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/crashreporter-symbols/
 	$(PYTHON) $(srcdir)/autobinscope.py $(DIST)/bin/plugin-container.exe $(DIST)/crashreporter-symbols/
--- a/configure.in
+++ b/configure.in
@@ -9210,16 +9210,19 @@ if test -n "$_WRAP_MALLOC"; then
 fi
 
 if test -z "$MOZ_NATIVE_NSPR"; then
     ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
     if test -z "$MOZ_DEBUG"; then
         ac_configure_args="$ac_configure_args --disable-debug"
     else
         ac_configure_args="$ac_configure_args --enable-debug"
+        if test -n "$MOZ_NO_DEBUG_RTL"; then
+            ac_configure_args="$ac_configure_args --disable-debug-rtl"
+        fi
     fi
     if test "$MOZ_OPTIMIZE" = "1"; then
         ac_configure_args="$ac_configure_args --enable-optimize"
     elif test -z "$MOZ_OPTIMIZE"; then
         ac_configure_args="$ac_configure_args --disable-optimize"
     fi
     if test -n "$HAVE_64BIT_OS"; then
         ac_configure_args="$ac_configure_args --enable-64bit"