Page MenuHomePhabricator

[CMAKE] Use gold as a linker when available
ClosedPublic

Authored by Fabien on Wed, Mar 11, 22:57.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Commits
rABC116eb55bcaaa: [CMAKE] Use gold as a linker when available
Summary

This diff adds an USE_LD_GOLD option that attempts to use gold
instead of the default toolchain linker. It is ON by default since it
has a safe fallback path.
Note that it works when cross compiling too. The option is also
available with MinGw but supposedly has no effect since gold is
ELF-only.

Building with debug on my machine (with ccache so linking time is more
relevant), before:

real    1m28.916s
user    1m46.125s
sys     0m46.567s

After:

real    1m5.641s
user    1m21.068s
sys     0m42.618s
Test Plan

On Linux and OSX:

ninja all check

Run the Gitian builds twice and check the build is still deterministic.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Wed, Mar 11, 22:57
Herald added a reviewer: Restricted Project. · View Herald TranscriptWed, Mar 11, 22:57
deadalnix accepted this revision.Thu, Mar 12, 14:15
This revision is now accepted and ready to land.Thu, Mar 12, 14:15
This revision was automatically updated to reflect the committed changes.