From bug 662814 comment 26:
So, with the constraints from this API, our build system and our various ways of linking things for the various platforms we target, I think the least worse thing to do would be to have a directory where we'd build a libmozutils library that:
- includes jemalloc when jemalloc is enabled
- includes the event log infrastructure from this bug
- includes what currently is libmozutils on android when building for android
- is a DSO on win/osx and a static lib on linux (i.e., is whatever jemalloc currently is)
I think doing so as a separate patch (i.e. without the event log infrastructure) first would be better.
An advantage of this approach is that whenever we'll need to add something else that has the same kind of constraints, it will be much easier to handle.

(In reply to Kyle Huey [:khuey] (khuey@mozilla.com) from comment #8)
> > # 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_1)
> > # Disable default CRT libs and add the right lib path for the linker
> >-MOZ_MEMORY_LDFLAGS=
> >+MOZ_UTILS_LDFLAGS=
> > endif
>
> I wonder if any of this is relevant anymore ...
It still is, unfortunately. Some places where USE_STATIC_LIBS is defined may not actually require it anymore, though. But some definitely do (I tried a build without that hack. lots of fail)

Ok fair enough. Unfortunately at 4am when I'd already spent an hour sorting out the mess that was m-i, then retriggered a load on m-c and waited to see how that went, I didn't really have time to pick through and work out what had broken. I asked on #pymake but everyone else was away apart from Callek who agreed that just backing out the lot was the easiest solution.

Comment on attachment 557330[details][diff][review]
Build a mozutils library containing jemalloc and other things
>+ 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)'
So, one of my Windows jemalloc builds has a problem. We set these flags that use two variables only known to the mozilla-central build system.
> if grep -q '__imp__\{0,1\}free' crtdll.obj; then
But my crtdll.obj doesn not contain __imp__free...
>+ MOZ_UTILS_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
So the flags don't get updated,
> dnl Also pass this to NSPR/NSS
>+ DLLFLAGS="$DLLFLAGS $MOZ_UTILS_LDFLAGS"
And broken flags get passed to NSPR/NSS...

Note

You need to
log in
before you can comment on or make changes to this bug.