Skip to content

Commit 1be0397

Browse files
committed
wip
1 parent 997ad1d commit 1be0397

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

compiler/rustc_codegen_llvm/src/builder/gpu_offload.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,15 @@ pub(crate) fn gen_image_wrapper_module<'ll>(
6565
llvm::set_linkage(llglobal, ExternalLinkage);
6666
llvm::set_visibility(llglobal, Visibility::Hidden);
6767

68+
let c_name = CString::new("__dummy.omp_offloading_entries").unwrap();
69+
let llglobal = llvm::add_global(cx.llmod, offload_entry_arr, &c_name);
70+
llvm::set_global_constant(llglobal, true);
71+
llvm::set_linkage(llglobal, InternalLinkage);
72+
let c_section_name = CString::new("omp_offloading_entries").unwrap();
73+
llvm::set_section(llglobal, &c_section_name);
74+
let zeroinit = cx.const_null(offload_entry_arr);
75+
llvm::set_initializer(llglobal, zeroinit);
76+
6877
// @__start_omp_offloading_entries = external hidden constant [0 x %struct.__tgt_offload_entry]
6978
// @__stop_omp_offloading_entries = external hidden constant [0 x %struct.__tgt_offload_entry]
7079
// @__dummy.omp_offloading_entries = internal constant [0 x %struct.__tgt_offload_entry] zeroinitializer, section "omp_offloading_entries"

0 commit comments

Comments
 (0)