Skip to content

Commit 443f99f

Browse files
Add -Z cross-lang-lto flag in order to support linker-based LTO.
1 parent aed5b9c commit 443f99f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/librustc/session/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
12931293
"make the current crate share its generic instantiations"),
12941294
chalk: bool = (false, parse_bool, [TRACKED],
12951295
"enable the experimental Chalk-based trait solving engine"),
1296+
cross_lang_lto: bool = (false, parse_bool, [TRACKED],
1297+
"generate build artifacts that are compatible with linker-based LTO."),
12961298
}
12971299

12981300
pub fn default_lib_output() -> CrateType {

src/librustc_trans/back/write.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ impl ModuleConfig {
293293
self.inline_threshold = sess.opts.cg.inline_threshold;
294294
self.obj_is_bitcode = sess.target.target.options.obj_is_bitcode;
295295
let embed_bitcode = sess.target.target.options.embed_bitcode ||
296-
sess.opts.debugging_opts.embed_bitcode;
296+
sess.opts.debugging_opts.embed_bitcode ||
297+
sess.opts.debugging_opts.cross_lang_lto;
297298
if embed_bitcode {
298299
match sess.opts.optimize {
299300
config::OptLevel::No |

0 commit comments

Comments
 (0)