Add -Z cross-lang-lto flag in order to support linker-based LTO.

This commit is contained in:
Michael Woerister 2018-04-16 16:25:29 +02:00
parent aed5b9c815
commit 443f99fca0
2 changed files with 4 additions and 1 deletions

View file

@ -1293,6 +1293,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"make the current crate share its generic instantiations"),
chalk: bool = (false, parse_bool, [TRACKED],
"enable the experimental Chalk-based trait solving engine"),
cross_lang_lto: bool = (false, parse_bool, [TRACKED],
"generate build artifacts that are compatible with linker-based LTO."),
}
pub fn default_lib_output() -> CrateType {

View file

@ -293,7 +293,8 @@ impl ModuleConfig {
self.inline_threshold = sess.opts.cg.inline_threshold;
self.obj_is_bitcode = sess.target.target.options.obj_is_bitcode;
let embed_bitcode = sess.target.target.options.embed_bitcode ||
sess.opts.debugging_opts.embed_bitcode;
sess.opts.debugging_opts.embed_bitcode ||
sess.opts.debugging_opts.cross_lang_lto;
if embed_bitcode {
match sess.opts.optimize {
config::OptLevel::No |