|
1 |
| -use gccjit::{LValue, RValue, ToRValue, Type}; |
| 1 | +use gccjit::{GlobalKind, LValue, RValue, ToRValue, Type}; |
2 | 2 | use rustc_codegen_ssa::traits::{BaseTypeMethods, ConstMethods, DerivedTypeMethods, StaticMethods};
|
3 | 3 | use rustc_hir as hir;
|
4 | 4 | use rustc_hir::Node;
|
@@ -218,7 +218,13 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
|
218 | 218 | }
|
219 | 219 |
|
220 | 220 | let is_tls = fn_attrs.flags.contains(CodegenFnAttrFlags::THREAD_LOCAL);
|
221 |
| - let global = self.declare_global(&sym, llty, false, is_tls, fn_attrs.link_section); |
| 221 | + let global = self.declare_global( |
| 222 | + &sym, |
| 223 | + llty, |
| 224 | + GlobalKind::Exported, |
| 225 | + is_tls, |
| 226 | + fn_attrs.link_section, |
| 227 | + ); |
222 | 228 |
|
223 | 229 | if !self.tcx.is_reachable_non_generic(def_id) {
|
224 | 230 | // TODO(antoyo): set visibility.
|
@@ -389,6 +395,6 @@ fn check_and_apply_linkage<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, attrs: &Codeg
|
389 | 395 | // don't do this then linker errors can be generated where the linker
|
390 | 396 | // complains that one object files has a thread local version of the
|
391 | 397 | // symbol and another one doesn't.
|
392 |
| - cx.declare_global(&sym, llty, true, is_tls, attrs.link_section) |
| 398 | + cx.declare_global(&sym, llty, GlobalKind::Imported, is_tls, attrs.link_section) |
393 | 399 | }
|
394 | 400 | }
|
0 commit comments