Bug 1168291 - Install mozcrt.lib instead of mozglue.lib in the SDK. r=mshal, a=lmandel
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 26 May 2015 15:48:21 +0900
changeset 288711 0c0537b5cbdd1c2143347ccd7d0c9e9fc7453c1d
parent 288710 c57928b47c0f83854bb10a61cf493729da52f66a
child 288712 bef1e3e26eee5b8b25dd88a22c04176a5201b705
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal, lmandel
bugs1168291
milestone42.0a2
Bug 1168291 - Install mozcrt.lib instead of mozglue.lib in the SDK. r=mshal, a=lmandel When building with MOZ_CRT (which is more or less the default when building on Windows with MSVC2013), building e.g. XPCOM components requires linking against mozcrt.lib, so it needs to be shipped in the SDK. On the other hand, mozglue.lib, which is currently shipped, is not useful because it lacks the necessary hacks from mozcrt.lib avoiding crashes for memory allocator mismatch.
mozglue/build/moz.build
mozglue/crt/Makefile.in
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -6,17 +6,18 @@
 
 # Build mozglue as a shared lib on Windows, OSX and Android.
 # If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
 if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
     SharedLibrary('mozglue')
 else:
     Library('mozglue')
 
-SDK_LIBRARY = True
+if not CONFIG['MOZ_CRT']:
+    SDK_LIBRARY = True
 
 if CONFIG['OS_TARGET'] == 'Android':
     SOURCES += [
         'BionicGlue.cpp',
     ]
 
 if CONFIG['MOZ_ASAN']:
     SOURCES += [
--- a/mozglue/crt/Makefile.in
+++ b/mozglue/crt/Makefile.in
@@ -74,8 +74,16 @@ msvc_removed.lib: msvc_combined.lib crtd
 
 # Extract the broken object file out of the combined library
 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:
 	lib -OUT:$@ $(WIN32_CRT_LIBS)
+
+# Normally, we'd use SDK_LIBRARY, but we can't because all the tricks above
+# involve *not* defining the library in moz.build, so SDK_LIBRARY = True would
+# not have the expected outcome.
+SDK_FILES = mozcrt.lib
+SDK_DEST = $(SDK_LIB_DIR)
+SDK_TARGET = target
+INSTALL_TARGETS += SDK