jemalloc support for Windows x64 build (VC 2005 / 2008)

RESOLVED FIXED in mozilla1.9.3a5

Status

()

defect
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: m_kato, Assigned: m_kato)

Tracking

Trunk
mozilla1.9.3a5
x86_64
Windows NT
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

need more patches to crt source code
Posted patch WIP v0.5 (obsolete) — Splinter Review
VC8 patch is old.  I have to update it for about:memory
Posted patch patch v1 (obsolete) — Splinter Review
Attachment #405374 - Attachment is obsolete: true
Comment on attachment 428423 [details] [diff] [review]
patch v1

Some drive-by comments here.

>diff --git a/configure.in b/configure.in
>--- a/configure.in
>+++ b/configure.in
>@@ -6749,6 +6749,9 @@ if test "$MOZ_MEMORY"; then
>     i*86)
>       _WIN32_CRT_CPU=intel
>       ;;
>+    x86_64)
>+      _WIN32_CRT_CPU=amd64
>+      ;;

You should probably just put this into MOZ_CRT_CPU_ARCH and AC_SUBST it into autoconf.mk, so you can avoid doing the same check in the Makefile below.

>     *)
>       AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
>       ;;
>diff --git a/memory/jemalloc/Makefile.in b/memory/jemalloc/Makefile.in
>--- a/memory/jemalloc/Makefile.in
>+++ b/memory/jemalloc/Makefile.in
>@@ -52,13 +52,18 @@ VISIBILITY_FLAGS=
> ifeq (WINNT,$(OS_TARGET))
> # Building the CRT from source
> CRT_OBJ_DIR = $(CURDIR)/crtsrc
>+ifeq ($(TARGET_CPU), x86_64)
>+MOZ_CRT_CPU_ARCH=amd64
>+else
>+MOZ_CRT_CPU_ARCH=intel
>+endif
> 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
>+MOZ_CRT_DLL = $(CRT_OBJ_DIR)/build/$(MOZ_CRT_CPU_ARCH)/$(MOZ_CRT_DLL_NAME).dll
>+MOZ_CRT_IMPORT_LIB = $(CRT_OBJ_DIR)/build/$(MOZ_CRT_CPU_ARCH)/$(MOZ_CRT_DLL_NAME).lib
>+MOZ_CRTCPP_DLL = $(CRT_OBJ_DIR)/build/$(MOZ_CRT_CPU_ARCH)/$(MOZ_CRTCPP_DLL_NAME).dll
>+MOZ_CRTCPP_IMPORT_LIB = $(CRT_OBJ_DIR)/build/$(MOZ_CRT_CPU_ARCH)/$(MOZ_CRTCPP_DLL_NAME).lib
> 
> # copy the CRT DLLs to dist/bin,
> # copy the import libs to dist/lib
>@@ -69,15 +74,17 @@ libs:: $(MOZ_CRT_DLL) $(MOZ_CRT_IMPORT_L
> $(MOZ_CRT_IMPORT_LIB): $(MOZ_CRT_DLL)
> 
> define EXTRACT_CMD
>-cd $(CRT_OBJ_DIR)/intel/$(i)_lib && lib "-extract:..\\build\\intel\\$(i)_obj\\unhandld.obj" eh.lib
>+cd $(CRT_OBJ_DIR)/$(MOZ_CRT_CPU_ARCH)/$(i)_lib && lib "-extract:..\\build\\$(MOZ_CRT_CPU_ARCH)\\$(i)_obj\\unhandld.obj" eh.lib

Do the amd64 libs have the same problem as intel here?

> # patch if necessary
> ifeq ($(CC_VERSION), 14.00.50727.762)
> CRTDIFF=crtvc8sp1.diff
>+CRTDIFF_AMD64=crtvc8sp1-amd64.diff
> else
> CRTDIFF=crtvc9sp1.diff
>+CRTDIFF_AMD64=crtvc9sp1-amd64.diff
> endif

You could just rename the existing patches to crtvc8sp1-intel.diff and name your new patches crtvc8sp1-amd64.diff, and then make this CRTDIFF=crtvc8sp1-$(MOZ_CRT_CPU_ARCH).diff.
(In reply to comment #3)
> Do the amd64 libs have the same problem as intel here?

Yes.  But we cannot use same workaround that linking unhandld.obj.  So the patch removes the reference __CxxSetUnhandledExceptionFilter.
Posted patch patch v2Splinter Review
Attachment #428423 - Attachment is obsolete: true
Attachment #446671 - Flags: review?(ted.mielczarek)
Attachment #446671 - Flags: review?(ted.mielczarek) → review+
Summary: jemalloc support for Windows x64 build → jemalloc support for Windows x64 build (VC 2005 / 2008)
landed
http://hg.mozilla.org/mozilla-central/rev/7f7dfb33a33e
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a5
Blocks: 572937
You need to log in before you can comment on or make changes to this bug.