I wanted to test the latest Firefox but for the love of whoever you want, I wasn’t able to find a 64bit build in Mozilla’s site. I could choose between lots of languages, but I couldn’t choose between 32 and 64 bits– their detection system insisted in providing the 32 bits builds. Bad, bad UI design!
But I managed to find how to build it from source. It turned out to be quite simple, it’s all in one page. With the Ubuntu instructions only, it gets reduced to this:
sudo apt-get build-dep firefox
sudo apt-get install mercurial libasound2-dev libcurl4-openssl-dev libnotify-dev libxt-dev libiw-dev mesa-common-dev autoconf2.13
hg clone http://hg.mozilla.org/mozilla-central/ # this step might take quite a while
cd mozilla-central
# Setup a basic mozconfig file
echo '. $topsrcdir/browser/config/mozconfig' > mozconfig # let's build Firefox...
echo 'mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir-ff-release' >> mozconfig # ...in this directory...
# Parallel compilation is a nice speedup.
echo 'mk_add_options MOZ_MAKE_FLAGS="-j4"' >> mozconfig
# Build
make -f client.mkAnd to update:
cd /path/to/mozilla-central
# Get the latest source
hg pull -r default
hg update
# Build
make -f client.mkIt didn’t take much time to build (less than 20 minutes). I can’t remember how much time did Chrome take the last time I tried, I should repeat it if only for curiosity sake.
And now I have a custom build, aptly named Minefield!

Still, it’s slower than Chrome in the tests I have ran (Javascript intensive tests, mostly Mr.doob‘s javascript experiments). What a pity, the promised speed improvements made me want to go back to Firefox :-(
In their defence, it built without complaining about any missing and/or almost impossible to fulfill dependency. Which is something you can’t say about every open source project, unfortunately.
I’ll keep an eye on it, now that I know how to get my own builds…
UPDATE: if the build breaks for whatever the reason and you get errors such as these:
nsFileChannel.cpp:(.text+0xaa3): undefined reference to `nsBaseContentStream::AsyncWait(nsIInputStreamCallback*, unsigned int, unsigned int, nsIEventTarget*)'
../../netwerk/protocol/file/libnkfile_s.a(nsFileChannel.o): In function `nsFileUploadContentStream::Release()':
nsFileChannel.cpp:(.text+0x9d1): undefined reference to `nsBaseContentStream::Release()'
../../netwerk/protocol/file/libnkfile_s.a(nsFileChannel.o): In function `nsFileUploadContentStream::AddRef()':
nsFileChannel.cpp:(.text+0x9d7): undefined reference to `nsBaseContentStream::AddRef()'
../../netwerk/protocol/file/libnkfile_s.a(nsFileChannel.o): In function `nsFileUploadContentStream::QueryInterface(nsID const&, void**)':
nsFileChannel.cpp:(.text+0x9dd): undefined reference to `nsBaseContentStream::QueryInterface(nsID const&, void**)'
../../netwerk/protocol/file/libnkfile_s.a(nsFileChannel.o): In function `nsBaseContentStream::~nsBaseContentStream()':
nsFileChannel.cpp:(.text._ZN19nsBaseContentStreamD2Ev[nsBaseContentStream::~nsBaseContentStream()]+0x3): undefined reference to `vtable for nsBaseContentStream'
/usr/bin/ld.bfd.real: ../../netwerk/protocol/file/libnkfile_s.a(nsFileChannel.o): relocation R_X86_64_PC32 against undefined hidden symbol `vtable for nsBaseContentStream' can not be used when making a shared object
/usr/bin/ld.bfd.real: final link failed: Bad value
collect2: ld returned 1 exit status
make[5]: *** [libxul.so] Error 1
make[5]: Leaving directory `/home/sole/Applications/mozilla/mozilla-central/objdir-ff-release/toolkit/library'
make[4]: *** [libs_tier_platform] Error 2
make[4]: Leaving directory `/home/sole/Applications/mozilla/mozilla-central/objdir-ff-release'
make[3]: *** [tier_platform] Error 2
make[3]: Leaving directory `/home/sole/Applications/mozilla/mozilla-central/objdir-ff-release'
make[2]: *** [default] Error 2
make[2]: Leaving directory `/home/sole/Applications/mozilla/mozilla-central/objdir-ff-release'
make[1]: *** [realbuild] Error 2
make[1]: Leaving directory `/home/sole/Applications/mozilla/mozilla-central'
make: *** [build] Error 2just delete the objdir-mozilla directory and try with make again.
Another solution is to delete .a files from the build directory:
find . -name "*.a" --delete
Paolo
Mozilla only distributes 32 bit builds. I don’t know why is so difficult for them to compile and test 64 bit versions (plenty of people would test them) but that’s it.
I’ll try your instructions to compile for 64 Linux soon. Thanks!
Paolo
It worked. A few of notes:
1) To install: cd objdir-ff-release; sudo make install. Run with /usr/local/bin/firefox
2) The source directory is 1.3 GB after the compilation ends. cd objdir-ff-release; make clean brings it down to 902 MB. Not much if one is low on disk space.
3) You might copy flashplayer from the regular firefox installation. This is what I did: sudo cp /usr/lib/firefox-addons/plugins/libflashplayer.so /usr/lib/mozilla/plugins/
and restart firefox.
sole
Paolo, thanks for the extra notes. I haven’t installed it because I just run it from the objdir-ff… directory but it’s good to know how to do that :)
Also, maybe for copying the flash player you’ll need it to be 64bits too OR have the 32bits libraries compatibility thing installed (can’t recall now how was it named).