1
Fork 0

Merge commit '3187d32079' into subtree-update

This commit is contained in:
Guillaume Gomez 2024-09-27 22:00:17 +02:00
commit 325b70890a
42 changed files with 943 additions and 365 deletions

View file

@ -9,6 +9,7 @@ use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}
use rustc_middle::mir::interpret::{
self, ConstAllocation, ErrorHandled, Scalar as InterpScalar, read_target_uint,
};
use rustc_middle::mir::mono::Linkage;
use rustc_middle::ty::layout::LayoutOf;
use rustc_middle::ty::{self, Instance};
use rustc_middle::{bug, span_bug};
@ -258,7 +259,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
if !self.tcx.is_reachable_non_generic(def_id) {
#[cfg(feature = "master")]
global.add_string_attribute(VarAttribute::Visibility(Visibility::Hidden));
global.add_attribute(VarAttribute::Visibility(Visibility::Hidden));
}
global
@ -386,6 +387,11 @@ fn check_and_apply_linkage<'gcc, 'tcx>(
let global1 =
cx.declare_global_with_linkage(sym, cx.type_i8(), base::global_linkage_to_gcc(linkage));
if linkage == Linkage::ExternalWeak {
#[cfg(feature = "master")]
global1.add_attribute(VarAttribute::Weak);
}
// Declare an internal global `extern_with_linkage_foo` which
// is initialized with the address of `foo`. If `foo` is
// discarded during linking (for example, if `foo` has weak