Faster Linking for Fennec

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:

  1. Download the binary from: and (thanks to mwu).
  2. 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)
  3. Increase nofile ulimit: open /etc/security/limits.conf and add the line |* hard nofile 65535|, then use |ulimit -n 65535| (Bug 10708)
  4. Disable elf-hack: Add |ac_add_options –disable-elf-hack| to your mozconfig. (Bug 671944)
  5. Clobber build recommended.

With an updated binary we could get around step 3 and possibly even step 4.

2 thoughts on “Faster Linking for Fennec

  1. I’m surprised you’d need to disable elfhack for this… Please file a Core/Build Config bug and CC me if you get elfhack failures.
    I’m also surprised that linking with the stock ld from the ndk would take 5 minutes. It’s far from taking that much time here.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s