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.
- causes
-
SERVER-51244 Evaluate linker argument before testing compiler
- Closed