Add a new (hidden) option -autolink-force-load.

This option puts a special symbol into the generated object files that other
object files can reference to force the library to be loaded.

The next commit will modify the way we serialize autolinking information so
that importers of this module will always emit a reference to this symbol.
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).

Part of <rdar://problem/16829587>

Swift SVN r17750
This commit is contained in:
Jordan Rose
2014-05-09 01:07:07 +00:00
parent 4f0776936a
commit 41700b03da
5 changed files with 37 additions and 1 deletions

View File

@@ -263,6 +263,9 @@ Job *Swift::constructJob(const JobAction &JA, std::unique_ptr<JobList> Inputs,
Args.AddLastArg(Arguments, options::OPT_module_link_name);
Args.AddLastArg(Arguments, options::OPT_import_underlying_module);
// FIXME: Warn if -module-link-name is not present.
Args.AddLastArg(Arguments, options::OPT_autolink_force_load);
Args.AddLastArg(Arguments, options::OPT_split_objc_selectors);
Args.AddLastArg(Arguments, options::OPT_implicit_objc_with);
Args.AddLastArg(Arguments, options::OPT_strict_keyword_arguments);