Linking on Fennec slows down incremental builds by roughly 5 minutes which reduces the turn around time for testing changes.
By using the gold linker you can reduce the incremental build time from 5 minutes down to 15 seconds!
Here are the steps I used to setup gold:
- Download the binary from: http://hg.mozilla.org/users/b56girard_gmail.com/files/raw-file/tip/real-ld and http://hg.mozilla.org/users/b56girard_gmail.com/files/raw-file/tip/real-ld-gold (thanks to mwu).
- Place the files in |<…>/android-ndk-r4c/build/prebuilt/linux-x86/arm-eabi-4.4.0/arm-eabi/bin| and make sure they have the execute bit set. (WARNING: There’s multiple bin directories, make sure you go in arm-eabi/bin)
- Increase nofile ulimit: open /etc/security/limits.conf and add the line |* hard nofile 65535|, then use |ulimit -n 65535| (Bug 10708)
- Disable elf-hack: Add |ac_add_options –disable-elf-hack| to your mozconfig. (Bug 671944)
- Clobber build recommended.
With an updated binary we could get around step 3 and possibly even step 4.