forked from mirrors/gecko-dev
bug 508861 - Build/ship the C++ runtime with MSVC/jemalloc. r=bsmedberg
--HG-- extra : rebase_source : 3ce54c05f07236d49469b66c695bfac3ccef06af
This commit is contained in:
parent
175937055b
commit
f2d96f1b3d
5 changed files with 74 additions and 41 deletions
|
|
@ -52,6 +52,7 @@ bin\msvcp80.dll
|
|||
bin\msvcr80.dll
|
||||
#else
|
||||
bin\mozcrt19.dll
|
||||
bin\mozcpp19.dll
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -6665,9 +6665,7 @@ if test "$MOZ_MEMORY"; then
|
|||
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/intel"
|
||||
dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
|
||||
AC_DEFINE(_STATIC_CPPLIB)
|
||||
MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -DEFAULTLIB:mozcrt19"
|
||||
MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
|
||||
dnl Also pass this to NSPR/NSS
|
||||
DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
|
||||
export DLLFLAGS
|
||||
|
|
|
|||
|
|
@ -53,15 +53,18 @@ ifeq (WINNT,$(OS_TARGET))
|
|||
# Building the CRT from source
|
||||
CRT_OBJ_DIR = $(CURDIR)/crtsrc
|
||||
MOZ_CRT_DLL_NAME = mozcrt19
|
||||
MOZ_CRTCPP_DLL_NAME = mozcpp19
|
||||
MOZ_CRT_STATIC_LIBS = libcmt libcpmt
|
||||
MOZ_CRT_DLL = $(CRT_OBJ_DIR)/build/intel/$(MOZ_CRT_DLL_NAME).dll
|
||||
MOZ_CRT_IMPORT_LIB = $(CRT_OBJ_DIR)/build/intel/$(MOZ_CRT_DLL_NAME).lib
|
||||
MOZ_CRTCPP_DLL = $(CRT_OBJ_DIR)/build/intel/$(MOZ_CRTCPP_DLL_NAME).dll
|
||||
MOZ_CRTCPP_IMPORT_LIB = $(CRT_OBJ_DIR)/build/intel/$(MOZ_CRTCPP_DLL_NAME).lib
|
||||
|
||||
# copy the CRT DLL to dist/bin,
|
||||
# copy the import lib to dist/lib
|
||||
# copy the CRT DLLs to dist/bin,
|
||||
# copy the import libs to dist/lib
|
||||
libs:: $(MOZ_CRT_DLL) $(MOZ_CRT_IMPORT_LIB)
|
||||
$(INSTALL) $(MOZ_CRT_DLL) $(FINAL_TARGET)
|
||||
$(INSTALL) $(MOZ_CRT_IMPORT_LIB) $(DIST)/lib
|
||||
$(INSTALL) $(MOZ_CRT_DLL) $(MOZ_CRTCPP_DLL) $(FINAL_TARGET)
|
||||
$(INSTALL) $(MOZ_CRT_IMPORT_LIB) $(MOZ_CRTCPP_IMPORT_LIB) $(DIST)/lib
|
||||
|
||||
$(MOZ_CRT_IMPORT_LIB): $(MOZ_CRT_DLL)
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from subprocess import Popen, STDOUT, PIPE
|
|||
|
||||
if 'MAKEFLAGS' in os.environ:
|
||||
del os.environ['MAKEFLAGS']
|
||||
proc = Popen(['nmake', 'dll_', 'mt'], stdout=PIPE, stderr=STDOUT,
|
||||
proc = Popen(['nmake', 'dll_', 'dll_p', 'mt'], stdout=PIPE, stderr=STDOUT,
|
||||
cwd=sys.argv[1])
|
||||
|
||||
while True:
|
||||
|
|
|
|||
|
|
@ -5,19 +5,7 @@
|
|||
# and its affiliates do not purport to grant any rights in that source code.
|
||||
# Binaries are available under separate licenses at
|
||||
# http://www.microsoft.com/downloads/details.aspx?familyid=200b2fd9-ae1a-4a14-984d-389c36f85647&displaylang=en
|
||||
diff -re crt/src/crt0.c crt-sp1/src/crt0.c
|
||||
273c
|
||||
/*
|
||||
* this used to happen in _mtinit, but we need it before malloc
|
||||
*/
|
||||
_init_pointers(); /* initialize global function pointers */
|
||||
|
||||
if ( malloc_init_hard() ) /* initialize heap */
|
||||
.
|
||||
101a
|
||||
extern BOOL malloc_init_hard(void);
|
||||
.
|
||||
diff -re crt/src/_sample_.rc crt-sp1/src/_sample_.rc
|
||||
diff -re crt/src/_sample_.rc ./crtsrc/_sample_.rc
|
||||
41c
|
||||
VALUE "ProductName", "Mozilla Custom C Runtime"
|
||||
.
|
||||
|
|
@ -36,19 +24,30 @@ diff -re crt/src/_sample_.rc crt-sp1/src/_sample_.rc
|
|||
27c
|
||||
VALUE "CompanyName", "Mozilla Foundation"
|
||||
.
|
||||
|
||||
diff -re crt/src/crt0dat.c crt-sp1/src/crt0dat.c
|
||||
diff -re crt/src/crt0.c ./crtsrc/crt0.c
|
||||
273c
|
||||
/*
|
||||
* this used to happen in _mtinit, but we need it before malloc
|
||||
*/
|
||||
_init_pointers(); /* initialize global function pointers */
|
||||
|
||||
if ( malloc_init_hard() ) /* initialize heap */
|
||||
.
|
||||
101a
|
||||
extern BOOL malloc_init_hard(void);
|
||||
.
|
||||
diff -re crt/src/crt0dat.c ./crtsrc/crt0dat.c
|
||||
789d
|
||||
778d
|
||||
diff -re crt/src/crtexe.c crt-sp1/src/crtexe.c
|
||||
diff -re crt/src/crtexe.c ./crtsrc/crtexe.c
|
||||
333,335d
|
||||
diff -re crt/src/crtheap.c crt-sp1/src/crtheap.c
|
||||
diff -re crt/src/crtheap.c ./crtsrc/crtheap.c
|
||||
61c
|
||||
pv = calloc(count, size);
|
||||
.
|
||||
58,59d
|
||||
diff -re crt/src/crtlib.c crt-sp1/src/crtlib.c
|
||||
779,786d
|
||||
diff -re crt/src/crtlib.c ./crtsrc/crtlib.c
|
||||
781,788d
|
||||
416d
|
||||
400a
|
||||
malloc_shutdown();
|
||||
|
|
@ -71,13 +70,13 @@ extern BOOL malloc_init_hard(void);
|
|||
extern void malloc_shutdown(void);
|
||||
|
||||
.
|
||||
diff -re crt/src/dllcrt0.c crt-sp1/src/dllcrt0.c
|
||||
diff -re crt/src/dllcrt0.c ./crtsrc/dllcrt0.c
|
||||
236,237d
|
||||
183d
|
||||
173d
|
||||
158d
|
||||
153,155d
|
||||
diff -re crt/src/intel/_sample_.def crt-sp1/src/intel/_sample_.def
|
||||
diff -re crt/src/intel/_sample_.def ./crtsrc/intel/_sample_.def
|
||||
1208d
|
||||
723,724d
|
||||
669a
|
||||
|
|
@ -96,18 +95,25 @@ diff -re crt/src/intel/_sample_.def crt-sp1/src/intel/_sample_.def
|
|||
9c
|
||||
LIBRARY MOZCRT19
|
||||
.
|
||||
diff -re crt/src/internal.h crt-sp1/src/internal.h
|
||||
diff -re crt/src/internal.h ./crtsrc/internal.h
|
||||
407a
|
||||
#endif
|
||||
.
|
||||
403a
|
||||
#if 0
|
||||
.
|
||||
diff -re crt/src/makefile crt-sp1/src/makefile
|
||||
diff -re crt/src/makefile ./crtsrc/makefile
|
||||
1840c
|
||||
-def:$(DEFFILE2_DIR)\sample_p.def
|
||||
.
|
||||
1816c
|
||||
$(DEFFILE2_DIR)\sample_p.def $(CPPSRC_OBJS_DLL:*=dll) \
|
||||
.
|
||||
1745a
|
||||
$(DEFFILE_DIR)\$(RETAIL_LIB_NAME).def : $(DEFFILE_DIR)\_sample_.def
|
||||
copy $** $@
|
||||
.
|
||||
1274d
|
||||
1228,1230d
|
||||
754c
|
||||
dll_ :: $(OBJROOT) $(OBJCPUDIR) $(OBJDIR_DLL) $(OBJDIR_DLL)\$(PURE_OBJ_DIR) \
|
||||
|
|
@ -128,15 +134,17 @@ LINKLIB=link -lib -nologo
|
|||
LINKIMPLIB=link -lib -nologo
|
||||
.
|
||||
209d
|
||||
21,22c
|
||||
21,24c
|
||||
RETAIL_DLL_NAME=MOZCRT19
|
||||
RETAIL_LIB_NAME=mozcrt19
|
||||
RETAIL_DLLCPP_NAME=MOZCPP19
|
||||
RETAIL_LIBCPP_NAME=mozcpp19
|
||||
.
|
||||
diff -re crt/src/makefile.inc crt-sp1/src/makefile.inc
|
||||
1623a
|
||||
|
||||
diff -re crt/src/makefile.inc ./crtsrc/makefile.inc
|
||||
1624a
|
||||
$(OBJDIR)\unhandld.obj: $(PREOBJDIR)\unhandld.obj
|
||||
copy $(PREOBJDIR)\unhandld.obj $@
|
||||
|
||||
.
|
||||
618d
|
||||
402d
|
||||
|
|
@ -148,14 +156,14 @@ $(OBJDIR)\unhandld.obj: $(PREOBJDIR)\unhandld.obj
|
|||
327d
|
||||
323d
|
||||
320d
|
||||
diff -re crt/src/makefile.sub crt-sp1/src/makefile.sub
|
||||
diff -re crt/src/makefile.sub ./crtsrc/makefile.sub
|
||||
103c
|
||||
LIB=link -lib -nologo
|
||||
.
|
||||
69c
|
||||
CFLAGS=$(CFLAGS) -O2 -DMOZ_MEMORY=1 -DMOZ_MEMORY_WINDOWS=1
|
||||
.
|
||||
diff -re crt/src/malloc.h crt-sp1/src/malloc.h
|
||||
diff -re crt/src/malloc.h ./crtsrc/malloc.h
|
||||
189a
|
||||
#endif
|
||||
.
|
||||
|
|
@ -170,20 +178,20 @@ diff -re crt/src/malloc.h crt-sp1/src/malloc.h
|
|||
70a
|
||||
#if 0
|
||||
.
|
||||
diff -re crt/src/mlock.c crt-sp1/src/mlock.c
|
||||
diff -re crt/src/mlock.c ./crtsrc/mlock.c
|
||||
274c
|
||||
#endif
|
||||
.
|
||||
262a
|
||||
#if 0
|
||||
.
|
||||
diff -re crt/src/new.cpp crt-sp1/src/new.cpp
|
||||
diff -re crt/src/new.cpp ./crtsrc/new.cpp
|
||||
60d
|
||||
52,55d
|
||||
37,38c
|
||||
break;
|
||||
.
|
||||
diff -re crt/src/nothrownew.cpp crt-sp1/src/nothrownew.cpp
|
||||
diff -re crt/src/nothrownew.cpp ./crtsrc/nothrownew.cpp
|
||||
37a
|
||||
#endif
|
||||
.
|
||||
|
|
@ -193,5 +201,28 @@ diff -re crt/src/nothrownew.cpp crt-sp1/src/nothrownew.cpp
|
|||
#else
|
||||
|
||||
.
|
||||
diff -re crt/src/tidtable.c crt-sp1/src/tidtable.c
|
||||
diff -re crt/src/sample_p.def ./crtsrc/sample_p.def
|
||||
8c
|
||||
LIBRARY MOZCPP19
|
||||
.
|
||||
diff -re crt/src/sample_p.rc ./crtsrc/sample_p.rc
|
||||
41c
|
||||
VALUE "ProductName", "Mozilla Custom C++ Runtime"
|
||||
.
|
||||
39c
|
||||
VALUE "OriginalFilename", "MOZCPP19.DLL"
|
||||
.
|
||||
37c
|
||||
VALUE "OriginalFilename", "MOZCPP19D.DLL"
|
||||
.
|
||||
33c
|
||||
VALUE "InternalName", "MOZCPP19.DLL"
|
||||
.
|
||||
31c
|
||||
VALUE "InternalName", "MOZCPP19D.DLL"
|
||||
.
|
||||
27c
|
||||
VALUE "CompanyName", "Mozilla Foundation"
|
||||
.
|
||||
diff -re crt/src/tidtable.c ./crtsrc/tidtable.c
|
||||
393,394d
|
||||
|
|
|
|||
Loading…
Reference in a new issue