Rollup merge of #155853 - lapla-cogito:rv_mcount, r=mati865

Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets

Fixes rust-lang/rust#155830

glibc on RISC-V exports `_mcount`, not `mcount`. https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/riscv/machine-gmon.h;hb=HEAD

r? mati865 (I think you're well-suited to review this area, but feel free to reroll)
This commit is contained in:
Jacob Pratt
2026-04-30 22:28:25 -04:00
committed by GitHub
3 changed files with 3 additions and 0 deletions
@@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
llvm_abiname: LlvmAbi::Ilp32d,
max_atomic_width: Some(32),
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
mcount: "\u{1}_mcount".into(),
..base::linux_gnu::opts()
},
}
@@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
llvm_abiname: LlvmAbi::Lp64d,
max_atomic_width: Some(64),
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
mcount: "\u{1}_mcount".into(),
..base::linux_gnu::opts()
},
}
@@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
llvm_abiname: LlvmAbi::Lp64d,
max_atomic_width: Some(64),
supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]),
mcount: "\u{1}_mcount".into(),
..base::linux_gnu::opts()
},
}