diff options
| author | David Rheinsberg <david.rheinsberg@gmail.com> | 2022-11-21 16:47:02 +0100 |
|---|---|---|
| committer | David Rheinsberg <david.rheinsberg@gmail.com> | 2022-11-29 10:57:25 +0100 |
| commit | a0771bdabbd23738e73a7745d1b224d53db8c826 (patch) | |
| tree | 91918419f4c7675ad8ada38c00a41594c79717a1 /compiler/rustc_codegen_gcc/src | |
| parent | 1ef685ea39280cc4a4a32f7c3c586d2ce946e8f0 (diff) | |
| download | rust-a0771bdabbd23738e73a7745d1b224d53db8c826.tar.gz rust-a0771bdabbd23738e73a7745d1b224d53db8c826.zip | |
codegen-llvm: never combine DSOLocal and DllImport
Prevent DllImport from being attached to DSOLocal definitions in the
LLVM IR. The combination makes no sense, since definitions local to the
compilation unit will never be imported from external objects.
Additionally, LLVM will refuse the IR if it encounters the
combination (introduced in [1]):
if (GV.hasDLLImportStorageClass())
Assert(!GV.isDSOLocal(),
"GlobalValue with DLLImport Storage is dso_local!", &GV);
Right now, codegen-llvm will only apply DllImport to constants and rely
on call-stubs for functions. Hence, we simply extend the codegen of
constants to skip DllImport for any local definitions.
This was discovered when switching the EFI targets to the static
relocation model [2]. With this fixed, we can start another attempt at
this.
[1] https://smlnj-gitlab.cs.uchicago.edu/manticore/llvm/commit/509132b368efed10bbdad825403f45e9cf1d6e38
[2] https://github.com/rust-lang/rust/issues/101656
Diffstat (limited to 'compiler/rustc_codegen_gcc/src')
0 files changed, 0 insertions, 0 deletions
