Fix naked asm symbol name for cg_clif on macOS

This commit is contained in:
bjorn3 2025-04-30 12:59:50 +00:00
parent b3b1eddc5b
commit bfabf71781

View file

@ -34,7 +34,8 @@ impl<'tcx> AsmCodegenMethods<'tcx> for GlobalAsmContext<'_, 'tcx> {
}
fn mangled_name(&self, instance: Instance<'tcx>) -> String {
self.tcx.symbol_name(instance).name.to_owned()
let symbol_name = self.tcx.symbol_name(instance).name.to_owned();
if self.tcx.sess.target.is_like_darwin { format!("_{symbol_name}") } else { symbol_name }
}
}