Serialize and honor whether a particular library should be force-loaded.

When a module built with -autolink-force-load is imported, add a reference
to a special symbol in the corresponding library so that ld is forced to
link it.

This means the library will be linked into the final binary even if no other
symbols are used (which happens for some of our overlays that just add
category methods to Objective-C classes).

Second part of <rdar://problem/16829587>

Swift SVN r17751
This commit is contained in:
Jordan Rose
2014-05-09 01:20:32 +00:00
parent 41700b03da
commit dde2a8b06b
9 changed files with 63 additions and 38 deletions

View File

@@ -40,7 +40,7 @@ const uint16_t VERSION_MAJOR = 0;
/// Serialized module format minor version number.
///
/// When the format changes IN ANY WAY, this number should be incremented.
const uint16_t VERSION_MINOR = 91;
const uint16_t VERSION_MINOR = 92;
using DeclID = Fixnum<31>;
using DeclIDField = BCFixed<31>;
@@ -348,6 +348,7 @@ namespace input_block {
using LinkLibraryLayout = BCRecordLayout<
LINK_LIBRARY,
LibraryKindField, // kind
BCFixed<1>, // forced?
BCBlob // library name
>;