[SERVER-27377] Dynamic builds should use --no-as-needed for executables, not just libraries Created: 12/Dec/16  Updated: 05/Apr/17  Resolved: 12/Dec/16

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.4.1, 3.5.1

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

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4
Sprint: Platforms 2017-01-23
Participants:

 Description   

We currently add -Wl,--no-as-needed to SHLINKFLAGS, so that we don't silently drop library to library dependency edges if there is no symbolic dependency on platforms where -Wl,--no-as-needed is on by default. We don't want to drop those edges because even though there is no symbol level dependency, there may be a "hidden" dependency on static initializers or mongo initializers.

However, we have not done the same thing for executable to library edges, so we can still end up dropping a dependency edge.

We should add -Wl,--no-as-needed to LINKFLAGS instead of SHLINKFLAGS, so it is applied to both executables and dynamic libraries.



 Comments   
Comment by Githook User [ 13/Dec/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-27377 Executables need --no-as-needed too

(cherry picked from commit f371d09cd36ca79b19f5439eca12094e9ccd4a14)
Branch: v3.4
https://github.com/mongodb/mongo/commit/34a39c8f9d7ea9b06692978c6c7b1018b082a8cb

Comment by Githook User [ 12/Dec/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-27377 Executables need --no-as-needed too
Branch: master
https://github.com/mongodb/mongo/commit/f371d09cd36ca79b19f5439eca12094e9ccd4a14

Generated at Thu Feb 08 04:14:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.