File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
compiler/rustc_codegen_llvm/src/builder Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments