[SERVER-17995] prefer the gold linker if it is available Created: 10/Apr/15 Updated: 21/Jun/16 Resolved: 26/Aug/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Build |
| Affects Version/s: | None |
| Fix Version/s: | 3.1.8 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Adam Midvidy | Assignee: | Jonathan Reams |
| Resolution: | Done | Votes: | 0 |
| Labels: | build-jbr | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | build with CCFLAGS=-fuse-ld=gold |
||||||||
| Sprint: | Build 7 08/10/15, Build 8 08/31/15 | ||||||||
| Participants: | |||||||||
| Description |
|
gold seems to be noticeably faster than GNU ld. We should use TryLink with gold, and prefer it if a system has it. |
| Comments |
| Comment by Githook User [ 26/Aug/15 ] | ||||||||||
|
Author: {u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}Message: | ||||||||||
| Comment by Adam Midvidy [ 10/Aug/15 ] | ||||||||||
|
As this is a clear win, and most people don't care to customize their build flags beyond the bare minimum, I'm inclined to say yes, unless it is complex to implement. | ||||||||||
| Comment by Andrew Morrow (Inactive) [ 10/Aug/15 ] | ||||||||||
|
Do we still think this is useful now that command line or mongo_custom_variables.py can just say LINKFLAGS="-fuse-ld=gold" or whatever? | ||||||||||
| Comment by Eric Milkie [ 13/Apr/15 ] | ||||||||||
|
Clang doesn't have --use-ld (presumably because that is a GNU-specific option to select which GNU linker to use). For Clang users, you can select which linker it uses via alternatives(8):
So I think this TryLink effort will only benefit gcc users. Should we encourage developers to switch to gold? | ||||||||||
| Comment by Andrew Morrow (Inactive) [ 10/Apr/15 ] | ||||||||||
|
This would require that we add support for AddFlagIfSupported for linker targeted flags in SCons, which is something that we want. Basically, we need to try to compile/link with -fuse-ld=gold. If it works, add it to CCFLAGS. |