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 528984 d3b7794f08af91f2a7afb77e43621002e06d3bfc
parent 528983 8ff9920688c1abb32ba1a9a4c2bdce77558481db
child 528985 6b59228866526e40874ce7adff1d565ffed75001
push id83328
push usermzhilyaev@mozilla.com
push dateFri, 14 Aug 2015 14:50:55 +0000
treeherdertry@ffcfb96ca96a [default view] [failures only]
reviewersmshal, lmandel
bugs1168291
milestone41.0
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