Skip to content

Commit

Permalink
Clarify comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Sep 22, 2024
1 parent 643dd8c commit 8794ca2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/rustc_codegen_llvm/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,10 @@ impl<'ll> CodegenCx<'ll, '_> {
// Local definitions can never be imported, so we must not apply
// the DLLImport annotation.
&& !dso_local
// ThinLTO can't handle this workaround in all cases, so we don't
// emit the attrs. Instead we make them unnecessary by disallowing
// dynamic linking when linker plugin based LTO is enabled.
// Linker plugin ThinLTO doesn't create the self-dllimport Rust uses for rlibs
// as the code generation happens out of process. Instead we assume static linkage
// and disallow dynamic linking when linker plugin based LTO is enabled.
// Regular in-process ThinLTO doesn't need this workaround.
&& !self.tcx.sess.opts.cg.linker_plugin_lto.enabled();

// If this assertion triggers, there's something wrong with commandline
Expand Down

0 comments on commit 8794ca2

Please sign in to comment.