Closed Bug 688999 Opened 13 years ago Closed 13 years ago

Modifying jemalloc.c doesn't trigger enough relinks

Categories

(Firefox Build System :: General, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 644608

People

(Reporter: justin.lebar+bug, Unassigned)

References

Details

When I modify jemalloc.c and do a top-level recompile, I don't see anything other than mozutils being relinked. As a result, the changes to jemalloc don't appear when I run Firefox. I think this is due to bug 677501?
Mmmmmm... $ touch memory/jemalloc/jemalloc.c $ make -C objdir/memory make: Entering directory `/mnt/objdir/memory' make export make[1]: Entering directory `/mnt/objdir/memory' make -C jemalloc export make[2]: Entering directory `/mnt/objdir/memory/jemalloc' /mnt/objdir/config/nsinstall -R -m 644 /mnt/memory/jemalloc/jemalloc.h /mnt/memory/jemalloc/jemalloc_types.h ../../dist/include make[2]: Leaving directory `/mnt/objdir/memory/jemalloc' make -C mozutils export make[2]: Entering directory `/mnt/objdir/memory/mozutils' make[2]: Nothing to be done for `export'. make[2]: Leaving directory `/mnt/objdir/memory/mozutils' make -C mozalloc export make[2]: Entering directory `/mnt/objdir/memory/mozalloc' /mnt/objdir/config/nsinstall -R -m 644 /mnt/memory/mozalloc/mozalloc.h /mnt/memory/mozalloc/mozalloc_abort.h /mnt/memory/mozalloc/mozalloc_macro_wrappers.h /mnt/memory/mozalloc/mozalloc_oom.h /mnt/memory/mozalloc/mozalloc_undef_macro_wrappers.h /mnt/memory/mozalloc/throw_gcc.h ../../dist/include/mozilla make[2]: Leaving directory `/mnt/objdir/memory/mozalloc' make[1]: Leaving directory `/mnt/objdir/memory' make libs make[1]: Entering directory `/mnt/objdir/memory' make -C jemalloc libs make[2]: Entering directory `/mnt/objdir/memory/jemalloc' jemalloc.c gcc -o jemalloc.o -c -DOSTYPE=\"Linux2.6.38-bpo\" -DOSARCH=Linux -I/mnt/memory/jemalloc -I. -I../../dist/include -I../../dist/include/nsprpub -I/mnt/objdir/dist/include/nspr -I/mnt/objdir/dist/include/nss -fPIC -Wall -W -Wno-unused -Wpointer-arith -Wdeclaration-after-statement -Wcast-align -W -pedantic -Wno-long-long -fno-strict-aliasing -pthread -ffunction-sections -fdata-sections -pipe -DNDEBUG -DTRIMMED -g -Os -freorder-blocks -fomit-frame-pointer -include ../../mozilla-config.h -DMOZILLA_CLIENT -MD -MF .deps/jemalloc.pp /mnt/memory/jemalloc/jemalloc.c rm -f libjemalloc.a /usr/bin/python2.6 /mnt/config/pythonpath.py -I../../config /mnt/config/expandlibs_gen.py jemalloc.o > libjemalloc.a.desc make[2]: Leaving directory `/mnt/objdir/memory/jemalloc' make -C mozutils libs make[2]: Entering directory `/mnt/objdir/memory/mozutils' rm -f libmozutils.a libmozutils.a.desc /usr/bin/python2.6 /mnt/config/pythonpath.py -I../../config /mnt/config/expandlibs_exec.py --extract -- ar cr libmozutils.a ../jemalloc/libjemalloc.a ranlib libmozutils.a /usr/bin/python2.6 /mnt/config/pythonpath.py -I../../config /mnt/config/expandlibs_gen.py ../jemalloc/libjemalloc.a > libmozutils.a.desc /mnt/objdir/config/nsinstall -R -m 644 libmozutils.a libmozutils.a.desc ../../dist/lib make[2]: Leaving directory `/mnt/objdir/memory/mozutils' make -C mozalloc libs make[2]: Entering directory `/mnt/objdir/memory/mozalloc' /mnt/objdir/config/nsinstall -R -m 755 libmozalloc.so ../../dist/lib /mnt/objdir/config/nsinstall -R -m 755 libmozalloc.so ../../dist/bin /mnt/objdir/config/nsinstall -D ../../dist/sdk/lib /mnt/objdir/config/nsinstall -R -m 755 libmozalloc.so ../../dist/sdk/lib make[2]: Leaving directory `/mnt/objdir/memory/mozalloc' make[1]: Leaving directory `/mnt/objdir/memory' make tools make[1]: Entering directory `/mnt/objdir/memory' make -C jemalloc tools make[2]: Entering directory `/mnt/objdir/memory/jemalloc' make[2]: Nothing to be done for `tools'. make[2]: Leaving directory `/mnt/objdir/memory/jemalloc' make -C mozutils tools make[2]: Entering directory `/mnt/objdir/memory/mozutils' make[2]: Nothing to be done for `tools'. make[2]: Leaving directory `/mnt/objdir/memory/mozutils' make -C mozalloc tools make[2]: Entering directory `/mnt/objdir/memory/mozalloc' make[2]: Nothing to be done for `tools'. make[2]: Leaving directory `/mnt/objdir/memory/mozalloc' make[1]: Leaving directory `/mnt/objdir/memory' if test -d ../dist/bin ; then touch ../dist/bin/.purgecaches ; fi make: Leaving directory `/mnt/objdir/memory' ... and $topsrcdir/Makefile.in goes in memory/ And $topsrcdir/memory/Makefile.in only goes under memory/jemalloc is MOZ_MEMORY is defined. Is it ?
Mozutils is a dynamic library, right? Why would we need to relink anything other then mozutils itself?
(In reply to Benjamin Smedberg [:bsmedberg] from comment #2) > Mozutils is a dynamic library, right? Why would we need to relink anything > other then mozutils itself? I thought because it's libmozutils.a, not libmozutils.so, it had to be linked into something else? But I don't actually understand these things. > And $topsrcdir/memory/Makefile.in only goes under memory/jemalloc is MOZ_MEMORY is defined. Is it ? That log is similar to what I see when I do a top-level build; we do recurse into memory/jemalloc and create libmozutils.a. But suppose you actually change jemalloc.c. For instance, I added a malloc_printf() to the beginning of malloc() (around line 6000). Strangely enough, the first time I added the printf and rebuilt from the top level, it worked. But then I removed the printf, and I'm still seeing the output after four or five top-level rebuild. I don't have my increased-parallelism patch applied, and I've rebuilt with -j1.
I see. On linux, libmozutils is statically linked to the main binary. But building under browser/app may not have the proper dependencies for that. I believe this is bug 644608.
That looks like exactly the issue I'm seeing. Thanks!
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
Note the patch there should work for you. It just happens to subtly break on windows only.
Blocks: 688979
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.