Rollup merge of #147792 - osamakader:fix-autodiff-proc-macro-lto, r=petrochenkov
Fix autodiff incorrectly applying fat-lto to proc-macro crates Fixes rust-lang/rust#147487
This commit is contained in:
commit
7fa2030d18
1 changed files with 2 additions and 1 deletions
|
|
@ -603,7 +603,8 @@ impl Session {
|
|||
// Autodiff currently requires fat-lto to have access to the llvm-ir of all (indirectly) used functions and types.
|
||||
// fat-lto is the easiest solution to this requirement, but quite expensive.
|
||||
// FIXME(autodiff): Make autodiff also work with embed-bc instead of fat-lto.
|
||||
if self.opts.autodiff_enabled() {
|
||||
// Don't apply fat-lto to proc-macro crates as they cannot use fat-lto without -Zdylib-lto
|
||||
if self.opts.autodiff_enabled() && !self.opts.crate_types.contains(&CrateType::ProcMacro) {
|
||||
return config::Lto::Fat;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue