From bef59cd1388b05c11433d61e6634a0bf1fac6132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20D=C3=B6nszelmann?= Date: Thu, 28 May 2026 13:46:59 +0200 Subject: [PATCH] Use weak linkage (otherwise we can't compile .so files with eiis in them) --- compiler/rustc_codegen_llvm/src/mono_item.rs | 5 ++++- compiler/rustc_codegen_ssa/src/codegen_attrs.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_codegen_llvm/src/mono_item.rs b/compiler/rustc_codegen_llvm/src/mono_item.rs index 2c0a6ff01018c..b746bab643a34 100644 --- a/compiler/rustc_codegen_llvm/src/mono_item.rs +++ b/compiler/rustc_codegen_llvm/src/mono_item.rs @@ -169,7 +169,10 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> { ) { for (alias, linkage, visibility) in aliases { let symbol_name = self.tcx.symbol_name(Instance::mono(self.tcx, *alias)); - tracing::debug!("FUNCTION ALIAS: {alias:?} {linkage:?} {visibility:?}"); + tracing::debug!( + "FUNCTION ALIAS: generating fn {} that calls {aliasee_instance:?} ({alias:?} {linkage:?} {visibility:?})", + symbol_name.name + ); // predefine another copy of the original instance // with a new symbol name diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs index b4626724fd803..d1d6499ac2d45 100644 --- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs +++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs @@ -259,7 +259,7 @@ fn process_builtin_attrs( codegen_fn_attrs.foreign_item_symbol_aliases.push(( foreign_item, - if i.is_default { Linkage::LinkOnceAny } else { Linkage::External }, + if i.is_default { Linkage::WeakAny } else { Linkage::External }, Visibility::Default, )); codegen_fn_attrs.flags |= CodegenFnAttrFlags::EXTERNALLY_IMPLEMENTABLE_ITEM;