diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-08-28 09:54:42 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-09-04 08:21:10 +0000 |
| commit | eea81b5d752f5310fcbd5ddae722afc7de0b8fa1 (patch) | |
| tree | 6c631e5afbc48048b5a00961211bec0b90e68ac3 /compiler/rustc_codegen_ssa/src/base.rs | |
| parent | 7a01c7f676cbffba4f14540ae90e4fd82f7b0af1 (diff) | |
| download | rust-eea81b5d752f5310fcbd5ddae722afc7de0b8fa1.tar.gz rust-eea81b5d752f5310fcbd5ddae722afc7de0b8fa1.zip | |
Ensure the allocator shim never participates in LTO
Making it participate in LTO would be incorrect if you compile a crate as both a dylib (which needs it) and rlib (which must not include it) in the same rustc invocation. With linker plugin LTO, the allocator shim will still participate in LTO as it is safe to do so in that case.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/base.rs')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/base.rs | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs index 97cdf8b6973..071bd09249a 100644 --- a/compiler/rustc_codegen_ssa/src/base.rs +++ b/compiler/rustc_codegen_ssa/src/base.rs @@ -46,9 +46,7 @@ use crate::meth::load_vtable; use crate::mir::operand::OperandValue; use crate::mir::place::PlaceRef; use crate::traits::*; -use crate::{ - CachedModuleCodegen, CodegenLintLevels, CrateInfo, ModuleCodegen, ModuleKind, errors, meth, mir, -}; +use crate::{CachedModuleCodegen, CodegenLintLevels, CrateInfo, ModuleCodegen, errors, meth, mir}; pub(crate) fn bin_op_to_icmp_predicate(op: BinOp, signed: bool) -> IntPredicate { match (op, signed) { @@ -1135,12 +1133,7 @@ pub fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> // We can re-use either the pre- or the post-thinlto state. If no LTO is // being performed then we can use post-LTO artifacts, otherwise we must // reuse pre-LTO artifacts - match compute_per_cgu_lto_type( - &tcx.sess.lto(), - &tcx.sess.opts, - tcx.crate_types(), - ModuleKind::Regular, - ) { + match compute_per_cgu_lto_type(&tcx.sess.lto(), &tcx.sess.opts, tcx.crate_types()) { ComputedLtoType::No => CguReuse::PostLto, _ => CguReuse::PreLto, } |
