[SERVER-49465] Builds with -fuse-ld=bfd fail in --link-model=dynamic Created: 13/Jul/20  Updated: 29/Oct/23  Resolved: 01/Oct/20

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 4.8.0

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Daniel Moody
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
causes SERVER-51244 Evaluate linker argument before testi... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Steps To Reproduce:

scons ... --link-model-dynamic LINKFLAGS=-fuse-ld=bfd install-core

Sprint: Dev Platform 2020-10-05
Participants:

 Description   

This was discovered while working on SERVER-49375. I think we never noticed because we had already made ld.gold preferred over ld.bfd before we started making real use of --link-model=dynamic, and all the platforms on which we build offer ld.gold. So we have no build coverage for this particular mode.

The issue appears to be that ld.bfd, unlike ld.gold or ld.lld, requires that a search path be provided via --rpath-link such that dynamic libraries referenced by libraries on the link line can be found.

This is a little awkward for us, as at link time the libraries are found scattered all over the build tree. We would probably need to do something in libdeps.py to accumulate the paths to each referenced library and annotate the node, then extract and merge the paths at link time.

Alternatively, we could simply require ld.gold and not do this.



 Comments   
Comment by Githook User [ 29/Sep/20 ]

Author:

{'name': 'Daniel Moody', 'email': 'daniel.moody@mongodb.com', 'username': 'dmoody256'}

Message: SERVER-49465 Added linker option and disabled use of BFD linker.
Branch: master
https://github.com/mongodb/mongo/commit/e617aab77fe7a746403c6bc5e04bdbf8595a09f3

Comment by Daniel Moody [ 28/Sep/20 ]

While implementing this, it was found that the BFD linker was not compatible with the kerberos and ldap third party libraries, and would cause a warning to be emitted when building mongokerberos binary due to two different versions of the krb5 library being linked in. 

It was possible to disable the warning, however disabling warnings could cause other issues to go unnoticed so it was decided the we would drop support for the BFD linker.

Generated at Thu Feb 08 05:19:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.