Skip to content

Commit 0deafd8

Browse files
Add -Z cross-lang-lto flag in order to support linker-based LTO.
1 parent 9c3d811 commit 0deafd8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/librustc/session/config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
13041304
"tell the linker to strip debuginfo when building without debuginfo enabled."),
13051305
share_generics: Option<bool> = (None, parse_opt_bool, [TRACKED],
13061306
"make the current crate share its generic instantiations"),
1307+
cross_lang_lto: bool = (false, parse_bool, [TRACKED],
1308+
"generate build artifacts that are compatible with linker-based LTO."),
13071309
}
13081310

13091311
pub fn default_lib_output() -> CrateType {

src/librustc_trans/back/write.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ impl ModuleConfig {
314314
self.inline_threshold = sess.opts.cg.inline_threshold;
315315
self.obj_is_bitcode = sess.target.target.options.obj_is_bitcode;
316316
let embed_bitcode = sess.target.target.options.embed_bitcode ||
317-
sess.opts.debugging_opts.embed_bitcode;
317+
sess.opts.debugging_opts.embed_bitcode ||
318+
sess.opts.debugging_opts.cross_lang_lto;
318319
if embed_bitcode {
319320
match sess.opts.optimize {
320321
config::OptLevel::No |

0 commit comments

Comments
 (0)