Backout bug 673197, bug 667962 (changesets 83ef35b794ce and 370bcc140023) for winopt bustage
authorMs2ger <ms2ger@gmail.com>
Wed, 27 Jul 2011 23:25:32 +0200
changeset 74202 a627b24e684e36c19f2810e5b28cd140c6b62bbd
parent 74201 370bcc14002338d95adb1dd0b23b9d8b20a902e6
child 74203 d066929dd830e4f101dc1ab0a60ef7c3c6652a56
push id235
push userbzbarsky@mozilla.com
push dateTue, 27 Sep 2011 17:13:04 +0000
treeherdermozilla-beta@2d1e082d176a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs673197, 667962
milestone8.0a1
first release with
nightly linux32
a627b24e684e / 8.0a1 / 20110728030819 / files
nightly linux64
a627b24e684e / 8.0a1 / 20110728030819 / files
nightly mac
a627b24e684e / 8.0a1 / 20110728030819 / files
nightly win32
a627b24e684e / 8.0a1 / 20110728030819 / files
nightly win64
a627b24e684e / 8.0a1 / 20110728030819 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backout bug 673197, bug 667962 (changesets 83ef35b794ce and 370bcc140023) for winopt bustage
configure.in
memory/jemalloc/Makefile.in
--- a/configure.in
+++ b/configure.in
@@ -7502,64 +7502,72 @@ else
   *-netbsd*)
     AC_DEFINE(MOZ_MEMORY_BSD)
     ;;
   *-solaris*)
     AC_DEFINE(MOZ_MEMORY_SOLARIS)
     ;;
   *-mingw*)
     AC_DEFINE(MOZ_MEMORY_WINDOWS)
-    AC_MSG_CHECKING([for VC2005/2008++ CRT source])
+    dnl This is sort of awful. Will revisit if we add support for more versions
     if test "$CC_VERSION" == "14.00.50727.762" -o "$CC_VERSION" == "15.00.30729.01"; then
-      if test -z "$WIN32_CRT_SRC_DIR" -a -n "$VCINSTALLDIR"; then
+      WIN32_OLD_STYLE_JEMALLOC=1
+      AC_DEFINE(WIN32_OLD_STYLE_JEMALLOC)
+    elif test "$CC_VERSION" == "16.00.30319.01" -o "$CC_VERSION" == "16.00.40219.01"; then
+      WIN32_NEW_STYLE_JEMALLOC=1
+      AC_DEFINE(WIN32_NEW_STYLE_JEMALLOC)
+    else        
+      AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 or 2008 SP1 or 2010 currently.])
+    fi
+    if test -z "$WIN32_CRT_SRC_DIR" -a -n "$WIN32_OLD_STYLE_JEMALLOC"; then
+      if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
+        AC_MSG_ERROR([When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you).])
+      else
         WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
       fi
-      if test -n "$WIN32_CRT_SRC_DIR" -a -d "$WIN32_CRT_SRC_DIR"; then
-        AC_MSG_RESULT([yes])
-        WIN32_OLD_STYLE_JEMALLOC=1
-        WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
-        _objdir_win=`pwd -W`
-        WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
-        MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
-      fi
-    fi
-    if test -z "$WIN32_OLD_STYLE_JEMALLOC"; then
-      AC_MSG_RESULT([no])
-      WIN32_NEW_STYLE_JEMALLOC=1
-      AC_DEFINE(WIN32_NEW_STYLE_JEMALLOC)
-      if test -z "$MOZ_DEBUG"; then
-        WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
-      else
-        WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
-      fi
-      dnl Look for a broken crtdll.obj
-      WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
-      lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
-      if grep -q __imp__\{0,1\}free crtdll.obj; then
-        MOZ_MEMORY_LDFLAGS='-MANIFEST:NO -LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
-      else
-        MOZ_MEMORY_LDFLAGS='$(DIST)/../memory/jemalloc/jemalloc.lib'
-      fi
-      rm crtdll.obj
     fi
     dnl cpu check
     case "${target_cpu}" in
     i*86)
       MOZ_CRT_CPU_ARCH=intel
       ;;
     x86_64)
       MOZ_CRT_CPU_ARCH=amd64
       ;;
     *)
       AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
       ;;
     esac
 
     AC_SUBST(MOZ_CRT_CPU_ARCH)
 
+    if test -n "$WIN32_OLD_STYLE_JEMALLOC"; then
+      if test ! -d "$WIN32_CRT_SRC_DIR"; then
+        AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
+      fi
+      WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
+      _objdir_win=`pwd -W`
+      WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
+      MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
+    else
+      if test -z "$MOZ_DEBUG"; then
+        WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
+      else
+        WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
+      fi
+      dnl Look for a broken crtdll.obj
+      WIN32_CRTDLL_FULLPATH=`lib -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
+      lib -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
+      if grep -q '__imp__\{0,1\}free' crtdll.obj; then
+        MOZ_MEMORY_LDFLAGS='-MANIFEST:NO -LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
+      else
+        MOZ_MEMORY_LDFLAGS='$(DIST)/../memory/jemalloc/jemalloc.lib'
+      fi
+      rm crtdll.obj
+    fi
     dnl Also pass this to NSPR/NSS
     DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
     export DLLFLAGS
     ;;
   *)
     AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
     ;;
   esac
--- a/memory/jemalloc/Makefile.in
+++ b/memory/jemalloc/Makefile.in
@@ -206,41 +206,43 @@ ifndef WIN32_OLD_STYLE_JEMALLOC
 # back together with the patched crtdll.obj, glue it to the end of jemalloc's
 # import library and link the rest of Mozilla to that.
 #
 # The result?  A binary that uses jemalloc, doesn't crash, and leaks a tiny
 # amount of memory (32 words per DLL in the 2010 CRT) at shutdown.
 #
 ###############################################################################
 
-libs:: mozcrt.lib
+libs:: $(DIST)/lib/mozcrt.lib
+
+$(DIST)/lib/mozcrt.lib:: mozcrt.lib
 	$(INSTALL) $(IFLAGS2) mozcrt.lib $(DIST)/lib
 
 # And finally combine that with the jemalloc import library to get an import
 # library that has our malloc/free/etc and the CRT's everything else
-mozcrt.lib: $(IMPORT_LIBRARY) msvc_modified.lib
+mozcrt.lib:: $(IMPORT_LIBRARY) msvc_modified.lib
 	lib -OUT:$@ $^
 
 # Put the fixed object file back in
-msvc_modified.lib: msvc_removed.lib crtdll_fixed.obj
+msvc_modified.lib:: msvc_removed.lib crtdll_fixed.obj
 	lib -OUT:$@ $^
 
 # Fix the object file
-crtdll_fixed.obj: crtdll.obj
+crtdll_fixed.obj:: crtdll.obj
 	$(PYTHON) $(srcdir)/fixcrt.py
 
 # Find the path of crtdll.obj
 CRTDLL_FULLPATH=$(subst \,\\,$(shell lib -list msvc_combined.lib | grep crtdll\\.obj))
 
 # Remove the broken object file, only after we have extracted it
-msvc_removed.lib: msvc_combined.lib crtdll.obj
+msvc_removed.lib:: msvc_combined.lib crtdll.obj
 	lib -OUT:$@ msvc_combined.lib -REMOVE:$(CRTDLL_FULLPATH)
 
 # Extract the broken object file out of the combined library
-crtdll.obj: msvc_combined.lib
+crtdll.obj:: msvc_combined.lib
 	lib -OUT:$@ $^ -EXTRACT:$(CRTDLL_FULLPATH)
 
 # Grab both CRT libraries and combine them into one library to simplify things
-msvc_combined.lib:
+msvc_combined.lib::
 	lib -OUT:$@ $(WIN32_CRT_LIBS)
 
 endif
 endif