Skip to content

Commit

Permalink
Backout the backout of e5815c156b6c (bug 683096), 9ca928d8095c (merge…
Browse files Browse the repository at this point in the history
…), a286edb8ca4b (bug 683875), 61dc35b8f63f (bug 683171), b0741ae44def (bug 683875), 8e01bc314326 + e2697c06468f (bug 677501), 805e28e85577 (bug 680440)
  • Loading branch information
glandium committed Sep 3, 2011
1 parent 8df73fe commit 24677b8
Show file tree
Hide file tree
Showing 33 changed files with 271 additions and 238 deletions.
6 changes: 1 addition & 5 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,11 @@ tier_base_dirs = \
$(NULL)

ifndef LIBXUL_SDK
ifdef MOZ_MEMORY
tier_base_dirs += memory/jemalloc
endif

ifeq ($(OS_TARGET),Android)
tier_base_dirs += other-licenses/android
endif

tier_base_dirs += memory/mozalloc
tier_base_dirs += memory
endif

ifdef COMPILE_ENVIRONMENT
Expand Down
2 changes: 0 additions & 2 deletions browser/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ ifdef MOZ_APP_PROFILE
DEFINES += -DMOZ_APP_PROFILE="$(MOZ_APP_PROFILE)"
endif

LIBS += $(JEMALLOC_LIBS)

ifdef LIBXUL_SDK
include $(topsrcdir)/config/rules.mk
else
Expand Down
7 changes: 1 addition & 6 deletions browser/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
@BINPATH@/@DLL_PREFIX@xpcom@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@
@BINPATH@/@DLL_PREFIX@mozalloc@DLL_SUFFIX@
#ifdef MOZ_MEMORY_DARWIN
@BINPATH@/@DLL_PREFIX@jemalloc@DLL_SUFFIX@
#endif
@BINPATH@/@DLL_PREFIX@mozutils@DLL_SUFFIX@
#ifdef XP_MACOSX
@BINPATH@/XUL
#else
Expand All @@ -60,9 +58,6 @@
@BINPATH@/@MOZ_CHILD_PROCESS_NAME@
#endif
#ifdef XP_WIN32
#ifdef MOZ_MEMORY
@BINPATH@/jemalloc.dll
#endif
#if _MSC_VER == 1400
@BINPATH@/Microsoft.VC80.CRT.manifest
@BINPATH@/msvcm80.dll
Expand Down
2 changes: 1 addition & 1 deletion browser/installer/removed-files.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
@DLL_PREFIX@xpcom_compat@DLL_SUFFIX@
@DLL_PREFIX@xpistub@DLL_SUFFIX@
@DLL_PREFIX@zlib@DLL_SUFFIX@
@DLL_PREFIX@jemalloc@DLL_SUFFIX@
#ifdef MOZ_STATIC_JS
@DLL_PREFIX@mozjs@DLL_SUFFIX@
#endif
Expand Down Expand Up @@ -1258,7 +1259,6 @@ xpicleanup@BIN_SUFFIX@
dictionaries/PL.dic
icons/mozicon16.xpm
icons/mozicon50.xpm
libjemalloc.so
plugins/libnullplugin.so
readme.txt
#endif
Expand Down
2 changes: 2 additions & 0 deletions build/win32/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ CPPSRCS = crashinject.cpp

endif # ENABLE_TESTS

MOZ_UTILS_LDFLAGS =

include $(topsrcdir)/config/rules.mk

ifdef WIN32_REDIST_DIR
Expand Down
2 changes: 2 additions & 0 deletions build/win32/crashinjectdll/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,6 @@ USE_STATIC_LIBS = 1

CPPSRCS = crashinjectdll.cpp

MOZ_UTILS_LDFLAGS =

include $(topsrcdir)/config/rules.mk
2 changes: 2 additions & 0 deletions build/win32/vmwarerecordinghelper/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@ USE_STATIC_LIBS = 1

CPPSRCS = $(LIBRARY_NAME).cpp

MOZ_UTILS_LDFLAGS =

include $(topsrcdir)/config/rules.mk
8 changes: 3 additions & 5 deletions config/autoconf.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ RM = rm -f
MOZ_UI_LOCALE = @MOZ_UI_LOCALE@

MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@
MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS = @MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS@
MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@

MOZ_FIX_LINK_PATHS=@MOZ_FIX_LINK_PATHS@
Expand Down Expand Up @@ -628,13 +627,12 @@ MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@
MOZ_QUANTIFY = @MOZ_QUANTIFY@
MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
WIN32_REDIST_DIR = @WIN32_REDIST_DIR@
MOZ_MEMORY_LDFLAGS = @MOZ_MEMORY_LDFLAGS@
MOZ_UTILS_LDFLAGS = @MOZ_UTILS_LDFLAGS@
MOZ_UTILS_PROGRAM_LDFLAGS = @MOZ_UTILS_PROGRAM_LDFLAGS@
WIN32_CRT_LIBS = @WIN32_CRT_LIBS@

# This is for custom CRT building
ifdef MOZ_MEMORY
# This is used to pass jemalloc flags to NSS
DLLFLAGS = @DLLFLAGS@
endif

# Codesighs tools option, enables win32 mapfiles.
MOZ_MAPINFO = @MOZ_MAPINFO@
Expand Down
19 changes: 6 additions & 13 deletions config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,6 @@ FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
MOZ_UNICHARUTIL_LIBS = $(LIBXUL_DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
MOZ_WIDGET_SUPPORT_LIBS = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)

ifdef MOZ_MEMORY
ifneq ($(OS_ARCH),WINNT)
JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_MOZLIBNAME,jemalloc) $(MKSHLIB_UNFORCE_ALL)
# If we are linking jemalloc into a program, we want the jemalloc symbols
# to be exported
ifneq (,$(SIMPLE_PROGRAMS)$(PROGRAM))
JEMALLOC_LIBS += $(MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS)
endif
endif
endif

CC := $(CC_WRAPPER) $(CC)
CXX := $(CXX_WRAPPER) $(CXX)
MKDIR ?= mkdir
Expand Down Expand Up @@ -247,13 +236,17 @@ endif # MOZ_DEBUG
# We don't build a static CRT when building a custom CRT,
# it appears to be broken. So don't link to jemalloc if
# the Makefile wants static CRT linking.
ifeq ($(MOZ_MEMORY)_$(USE_STATIC_LIBS),1_)
ifeq ($(MOZ_MEMORY)_$(USE_STATIC_LIBS),1_1)
# Disable default CRT libs and add the right lib path for the linker
OS_LDFLAGS += $(MOZ_MEMORY_LDFLAGS)
MOZ_UTILS_LDFLAGS=
endif

endif # WINNT && !GNU_CC

ifndef MOZ_UTILS_PROGRAM_LDFLAGS
MOZ_UTILS_PROGRAM_LDFLAGS=$(MOZ_UTILS_LDFLAGS)
endif

#
# Build using PIC by default
#
Expand Down
24 changes: 13 additions & 11 deletions config/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,12 @@ endif # ENABLE_TESTS

ifndef LIBRARY
ifdef STATIC_LIBRARY_NAME
_LIBRARY := $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
REAL_LIBRARY := $(LIB_PREFIX)$(STATIC_LIBRARY_NAME).$(LIB_SUFFIX)
# Only build actual library if it is installed in DIST/lib or SDK
ifeq (,$(SDK_LIBRARY)$(DIST_INSTALL)$(NO_EXPAND_LIBS))
LIBRARY := $(_LIBRARY).$(LIBS_DESC_SUFFIX)
LIBRARY := $(REAL_LIBRARY).$(LIBS_DESC_SUFFIX)
else
LIBRARY := $(_LIBRARY) $(_LIBRARY).$(LIBS_DESC_SUFFIX)
LIBRARY := $(REAL_LIBRARY) $(REAL_LIBRARY).$(LIBS_DESC_SUFFIX)
endif
endif # STATIC_LIBRARY_NAME
endif # LIBRARY
Expand Down Expand Up @@ -875,7 +875,7 @@ alltags:
$(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
@$(RM) $@.manifest
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
$(EXPAND_LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
$(EXPAND_LD) -NOLOGO -OUT:$@ -PDB:$(LINK_PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_UTILS_PROGRAM_LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
if test -f "$(srcdir)/$@.manifest"; then \
Expand All @@ -897,10 +897,10 @@ ifdef MOZ_PROFILE_GENERATE
endif
else # !WINNT || GNU_CC
ifeq ($(CPP_PROG_LINK),1)
$(EXPAND_CCC) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
$(EXPAND_CCC) -o $@ $(CXXFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(MOZ_UTILS_PROGRAM_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
@$(call CHECK_STDCXX,$@)
else # ! CPP_PROG_LINK
$(EXPAND_CC) -o $@ $(CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
$(EXPAND_CC) -o $@ $(CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_UTILS_PROGRAM_LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
endif # CPP_PROG_LINK
endif # WINNT && !GNU_CC

Expand Down Expand Up @@ -946,7 +946,7 @@ endif
#
$(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
$(EXPAND_LD) -nologo -out:$@ -pdb:$(LINK_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
$(EXPAND_LD) -nologo -out:$@ -pdb:$(LINK_PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_UTILS_PROGRAM_LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
ifdef MSMANIFEST_TOOL
@if test -f $@.manifest; then \
mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
Expand All @@ -955,10 +955,10 @@ ifdef MSMANIFEST_TOOL
endif # MSVC with manifest tool
else
ifeq ($(CPP_PROG_LINK),1)
$(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS)
$(EXPAND_CCC) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_UTILS_PROGRAM_LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS)
@$(call CHECK_STDCXX,$@)
else
$(EXPAND_CC) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS)
$(EXPAND_CC) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(MOZ_UTILS_PROGRAM_LDFLAGS) $(WRAP_LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS)
endif # CPP_PROG_LINK
endif # WINNT && !GNU_CC

Expand Down Expand Up @@ -1016,6 +1016,8 @@ $(filter %.$(LIB_SUFFIX),$(LIBRARY)): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEP
$(RANLIB) $@

$(filter-out %.$(LIB_SUFFIX),$(LIBRARY)): $(filter %.$(LIB_SUFFIX),$(LIBRARY)) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS_DEPS) $(EXTRA_DEPS) $(GLOBAL_DEPS)
# When we only build a library descriptor, blow out any existing library
$(if $(filter %.$(LIB_SUFFIX),$(LIBRARY)),,$(RM) $(REAL_LIBRARY) $(EXPORT_LIBRARY:%=%/$(REAL_LIBRARY)))
$(EXPAND_LIBS_GEN) $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) > $@

ifeq ($(OS_ARCH),WINNT)
Expand Down Expand Up @@ -1069,10 +1071,10 @@ ifdef DTRACE_LIB_DEPENDENT
ifndef XP_MACOSX
dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
endif
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(MOZ_UTILS_LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
@$(RM) $(DTRACE_PROBE_OBJ)
else # ! DTRACE_LIB_DEPENDENT
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(RESFILE) $(LDFLAGS) $(MOZ_UTILS_LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
endif # DTRACE_LIB_DEPENDENT
@$(call CHECK_STDCXX,$@)

Expand Down
34 changes: 25 additions & 9 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -2602,7 +2602,6 @@ dnl ========================================================
case "$target" in
*-linux*|*-kfreebsd*-gnu|*-gnu*)
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS='-rdynamic -Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/jemalloc-standalone-linkage-version-script'
;;
*-solaris*)
if test -z "$GNU_CC"; then
Expand Down Expand Up @@ -6952,6 +6951,21 @@ if test "$NS_TRACE_MALLOC"; then
MOZ_MEMORY=
fi

if test "${OS_TARGET}" = "Android"; then
dnl On Android, we use WRAP_LDFLAGS to link everything to mozutils
:
elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
dnl On Windows, OSX and OS2, we want to link all our binaries against mozutils
MOZ_UTILS_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozutils,$(LIBXUL_DIST)/lib)'
else
dnl On other Unix systems, we only want to link executables against mozutils
MOZ_UTILS_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozutils,$(LIBXUL_DIST)/lib) $(MKSHLIB_UNFORCE_ALL)'
if test -n "$GNU_CC"; then
dnl And we need mozutils symbols to be exported.
MOZ_UTILS_PROGRAM_LDFLAGS="$MOZ_UTILS_PROGRAM_LDFLAGS -rdynamic"
fi
fi

if test -z "$MOZ_MEMORY"; then
case "${target}" in
*-mingw*)
Expand Down Expand Up @@ -7001,6 +7015,7 @@ else
AC_DEFINE(MOZ_MEMORY_LINUX)
AC_DEFINE(MOZ_MEMORY_ANDROID)
_WRAP_MALLOC=1
MOZ_UTILS_LDFLAGS=
;;
*-*linux*)
AC_DEFINE(MOZ_MEMORY_LINUX)
Expand All @@ -7022,14 +7037,12 @@ else
WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
if grep -q '__imp__\{0,1\}free' crtdll.obj; then
MOZ_MEMORY_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
else
MOZ_MEMORY_LDFLAGS='$(DIST)/../memory/jemalloc/jemalloc.lib'
MOZ_UTILS_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
fi
rm crtdll.obj

dnl Also pass this to NSPR/NSS
DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
DLLFLAGS="$DLLFLAGS $MOZ_UTILS_LDFLAGS"
export DLLFLAGS
;;
*)
Expand All @@ -7045,7 +7058,8 @@ else
AC_DEFINE(HAVE_JEMALLOC_MEMALIGN)
fi # MOZ_MEMORY
AC_SUBST(MOZ_MEMORY)
AC_SUBST(MOZ_MEMORY_LDFLAGS)
AC_SUBST(MOZ_UTILS_LDFLAGS)
AC_SUBST(MOZ_UTILS_PROGRAM_LDFLAGS)
AC_SUBST(WIN32_CRT_LIBS)
dnl Need to set this for make because NSS doesn't have configure
AC_SUBST(DLLFLAGS)
Expand Down Expand Up @@ -8454,7 +8468,6 @@ AC_SUBST(USE_ELF_DYNSTR_GC)
AC_SUBST(USE_ELF_HACK)
AC_SUBST(INCREMENTAL_LINKER)
AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
AC_SUBST(MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS)
AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)

AC_SUBST(MOZ_FIX_LINK_PATHS)
Expand Down Expand Up @@ -9028,8 +9041,11 @@ ac_configure_args="$ac_configure_args --prefix=$dist"
ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
if test "$MOZ_MEMORY"; then
ac_configure_args="$ac_configure_args --enable-jemalloc"
if test -n "$MOZ_MEMORY_LDFLAGS"; then
export MOZ_MEMORY_LDFLAGS
if test -n "$MOZ_UTILS_LDFLAGS"; then
export MOZ_UTILS_LDFLAGS
fi
if test -n "$MOZ_UTILS_PROGRAM_LDFLAGS"; then
export MOZ_UTILS_PROGRAM_LDFLAGS
fi
fi
export MOZ_APP_NAME
Expand Down
4 changes: 0 additions & 4 deletions ipc/app/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ OS_LIBS += $(call EXPAND_LIBNAME,comctl32 comdlg32 uuid shell32 ole32 oleaut32 v
OS_LIBS += $(call EXPAND_LIBNAME,usp10 msimg32)
endif

ifneq (Android,$(OS_TARGET))
LIBS += $(JEMALLOC_LIBS)
endif

include $(topsrcdir)/config/rules.mk

ifeq ($(OS_ARCH),WINNT)
Expand Down
6 changes: 0 additions & 6 deletions js/src/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -826,12 +826,6 @@ EXTRA_LIBS += -lposix4 -ldl -lnsl -lsocket
endif
endif

ifdef MOZ_MEMORY
ifeq ($(OS_ARCH),Darwin)
LDFLAGS += -ljemalloc
endif
endif

ifdef SOLARIS_SUNPRO_CXX
ifeq ($(TARGET_CPU),sparc)
# Sun Studio SPARC doesn't work well with gcc inline asm, use lock_SunOS_sparc*.il
Expand Down
3 changes: 2 additions & 1 deletion js/src/config/autoconf.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ MOZ_BROWSE_INFO = @MOZ_BROWSE_INFO@
MOZ_TOOLS_DIR = @MOZ_TOOLS_DIR@
MOZ_QUANTIFY = @MOZ_QUANTIFY@
MSMANIFEST_TOOL = @MSMANIFEST_TOOL@
MOZ_MEMORY_LDFLAGS = @MOZ_MEMORY_LDFLAGS@
MOZ_UTILS_LDFLAGS = @MOZ_UTILS_LDFLAGS@
MOZ_UTILS_PROGRAM_LDFLAGS = @MOZ_UTILS_PROGRAM_LDFLAGS@

# Codesighs tools option, enables win32 mapfiles.
MOZ_MAPINFO = @MOZ_MAPINFO@
Expand Down
19 changes: 6 additions & 13 deletions js/src/config/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,6 @@ FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
MOZ_UNICHARUTIL_LIBS = $(LIBXUL_DIST)/lib/$(LIB_PREFIX)unicharutil_s.$(LIB_SUFFIX)
MOZ_WIDGET_SUPPORT_LIBS = $(DIST)/lib/$(LIB_PREFIX)widgetsupport_s.$(LIB_SUFFIX)

ifdef MOZ_MEMORY
ifneq ($(OS_ARCH),WINNT)
JEMALLOC_LIBS = $(MKSHLIB_FORCE_ALL) $(call EXPAND_MOZLIBNAME,jemalloc) $(MKSHLIB_UNFORCE_ALL)
# If we are linking jemalloc into a program, we want the jemalloc symbols
# to be exported
ifneq (,$(SIMPLE_PROGRAMS)$(PROGRAM))
JEMALLOC_LIBS += $(MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS)
endif
endif
endif

CC := $(CC_WRAPPER) $(CC)
CXX := $(CXX_WRAPPER) $(CXX)
MKDIR ?= mkdir
Expand Down Expand Up @@ -247,13 +236,17 @@ endif # MOZ_DEBUG
# We don't build a static CRT when building a custom CRT,
# it appears to be broken. So don't link to jemalloc if
# the Makefile wants static CRT linking.
ifeq ($(MOZ_MEMORY)_$(USE_STATIC_LIBS),1_)
ifeq ($(MOZ_MEMORY)_$(USE_STATIC_LIBS),1_1)
# Disable default CRT libs and add the right lib path for the linker
OS_LDFLAGS += $(MOZ_MEMORY_LDFLAGS)
MOZ_UTILS_LDFLAGS=
endif

endif # WINNT && !GNU_CC

ifndef MOZ_UTILS_PROGRAM_LDFLAGS
MOZ_UTILS_PROGRAM_LDFLAGS=$(MOZ_UTILS_LDFLAGS)
endif

#
# Build using PIC by default
#
Expand Down
Loading

0 comments on commit 24677b8

Please sign in to comment.