[SERVER-26276] Support building with thin archives where available Created: 23/Sep/16  Updated: 19/Nov/16  Resolved: 10/Oct/16

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.4.0-rc1

Type: Improvement 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:
Depends
Related
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2016-10-10, Platforms 2016-10-31
Participants:
Linked BF Score: 0

 Description   

This would allow us to do "archive" rather than "object" linking on platforms like Linux where the 'ar' utility supports thin archives, without doubling the disk space or IO requirements for a build.



 Comments   
Comment by Githook User [ 10/Oct/16 ]

Author:

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

Message: SERVER-26276 Enable thin static linking on binutils platforms
Branch: master
https://github.com/mongodb/mongo/commit/bdb8bfe3b57e7db11d0b47d80993e7ba5081d794

Comment by Andrew Morrow (Inactive) [ 26/Sep/16 ]

As a further note, it appears that only the binutils toolchain understands thin archives, so this approach will not work on macOS, or on our current setup for Solaris, where we use the system linker.

Comment by Andrew Morrow (Inactive) [ 26/Sep/16 ]

Note that this would probably require writing a specialized SCons content signature for .a files that synthesized its signature from that of the dependent .o's, especially for a binutils built with --use-deterministic-archives. Otherwise, as redbeard0531 pointed out, purely hash based signature of the file would not change, even if the referenced object files did.

Comment by Andrew Morrow (Inactive) [ 23/Sep/16 ]

Yes, it would. However, if we cannot raise the command line length limits, and the object linking strategy reaches those limits, we may have no choice. Potentially, we could investigate using "response files" on 'NIX. This ticket is mostly a placeholder, for now.

Comment by Andy Schwerin [ 23/Sep/16 ]

Doesn't this just createbanother build system code path to maintain, because the MONGO_INITIALIZER system precludes archive linking on systems without whole-archive support – E.g., Windows?

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