[SERVER-49119] Expansion of init-no-global-side-effects tag should be different in dynamic builds Created: 25/Jun/20  Updated: 29/Oct/23  Resolved: 27/Aug/20

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

Type: Improvement 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:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Dev Platform 2020-08-10, Dev Platform 2020-08-24, Dev Platform 2020-09-07
Participants:
Linked BF Score: 0

 Description   

The init-no-global-side-effects tag allows the build, in static mode, to not wrap use of the static library in -Wl,--whole-archive ... -Wl,--no-whole-archive or the semantic equivalent on other platforms.

In dynamic builds we have no need at all of the --whole-archive flag at all. Instead, the flag could be interpreted to mean that the library can be wrapped instead in -Wl,--no-as-needed ... -Wl,--as-needed, or the local equivalent. This would allow libraries that have no global initialization side effects to be automatically pruned from the DT_NEEDED set, even if LIBDEPS in public mode causes the library to be spammed on to the link line of other things.



 Comments   
Comment by Githook User [ 27/Aug/20 ]

Author:

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

Message: SERVER-49119 Added way for libdeps to generically handle prefix/postfix flags, moved --whole-archive out to SConstruct and add --as-needed for dynamic
Branch: master
https://github.com/mongodb/mongo/commit/31361990d9bd79ba3a3c578546ac62b57af11847

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