Skip to content

Commit ce8b784

Browse files
authored
Force lto to 'fat' with autodiff enabled
Messes with code I have no business dealing with.
1 parent 637b50b commit ce8b784

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_interface/src/interface.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,10 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se
482482
config.using_internal_features,
483483
config.expanded_args,
484484
);
485+
// Forces lto="fat" if autodiff is enabled.
486+
if sess.opts.unstable_opts.autodiff.contains(&config::AutoDiff::Enable) {
487+
sess.opts.cg.lto = config::LtoCli::Fat;
488+
}
485489

486490
codegen_backend.init(&sess);
487491

0 commit comments

Comments
 (0)