Bug 1168291 - Install mozcrt.lib instead of mozglue.lib in the SDK. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 26 May 2015 15:48:21 +0900
changeset 257136 b9f57927eb9e6d3a64574d2dad450b2ef220d69f
parent 257135 bc66277dd5830655abcdfb8194a59c916b70ddca
child 257137 0288a5a474785857fc52c32f2d83eb30fa799b06
push id63529
push usermh@glandium.org
push dateMon, 10 Aug 2015 22:23:09 +0000
treeherdermozilla-inbound@0288a5a47478 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1168291
milestone43.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 1168291 - Install mozcrt.lib instead of mozglue.lib in the SDK. r=mshal 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