Skip to content

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

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lapla-cogito:rv_mcount
May 1, 2026
Merged

Use _mcount as the mcount symbol name on RISC-V Linux GNU targets#155853
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
lapla-cogito:rv_mcount

Conversation

@lapla-cogito
Copy link
Copy Markdown
Contributor

@lapla-cogito lapla-cogito commented Apr 27, 2026

Fixes #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)

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 27, 2026

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 27, 2026
@lapla-cogito
Copy link
Copy Markdown
Contributor Author

(▰╹◡╹)❯  riscv64-linux-gnu-nm -D /usr/riscv64-linux-gnu/lib/libc.so.6 | rg mcount
0000000000113c22 T _dl_mcount_wrapper@GLIBC_2.27
0000000000112252 T _dl_mcount_wrapper_check@@GLIBC_2.27
00000000000cfc14 T _mcount@@GLIBC_2.27

Copy link
Copy Markdown
Member

@mati865 mati865 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mati865
Copy link
Copy Markdown
Member

mati865 commented Apr 29, 2026

Oops, forgot about bors.

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 29, 2026

📌 Commit 1a681b0 has been approved by mati865

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 29, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 30, 2026
Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets

Fixes rust-lang#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)
jhpratt added a commit to jhpratt/rust that referenced this pull request Apr 30, 2026
Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets

Fixes rust-lang#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)
rust-bors Bot pushed a commit that referenced this pull request Apr 30, 2026
Rollup of 6 pull requests

Successful merges:

 - #155853 (Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets)
 - #155939 (Add feature gate for view_types experiment)
 - #155974 (add `c_variadic_experimental_arch` feature)
 - #155523 (Reorganize `tests/ui/issues/` - 02)
 - #155980 (Move `feature*` methods from `parse` mod to `errors` mod.)
 - #155987 (Make lifting infallible)

Failed merges:

 - #155237 (Disentangle AST crates and error crates)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 30, 2026
Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets

Fixes rust-lang#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)
rust-bors Bot pushed a commit that referenced this pull request Apr 30, 2026
…uwer

Rollup of 13 pull requests

Successful merges:

 - #155249 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup)
 - #155853 (Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets)
 - #155919 (simplify `ast_fragments!`)
 - #155939 (Add feature gate for view_types experiment)
 - #155974 (add `c_variadic_experimental_arch` feature)
 - #155991 (Catch unwinds from the global ctxt callback to complete queries profiling data in more cases)
 - #156003 (Pass Session to optimize_and_codegen_fat_lto)
 - #153566 (Add suggestion for E0401 on inner const items)
 - #154610 (Suggest public re-exports when a private module makes an import path inaccessible)
 - #155523 (Reorganize `tests/ui/issues/` - 02)
 - #155980 (Move `feature*` methods from `parse` mod to `errors` mod.)
 - #155987 (Make lifting infallible)
 - #155988 (tests/run-make/print-cfg: add Android target_env case)
rust-bors Bot pushed a commit that referenced this pull request May 1, 2026
Rollup of 19 pull requests

Successful merges:

 - #155237 (Disentangle AST crates and error crates)
 - #155249 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup)
 - #155853 (Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets)
 - #155919 (simplify `ast_fragments!`)
 - #155939 (Add feature gate for view_types experiment)
 - #155954 (rustdoc: preserve parent doc cfg for `macro_export` macros)
 - #155974 (add `c_variadic_experimental_arch` feature)
 - #155991 (Catch unwinds from the global ctxt callback to complete queries profiling data in more cases)
 - #156003 (Pass Session to optimize_and_codegen_fat_lto)
 - #153566 (Add suggestion for E0401 on inner const items)
 - #154610 (Suggest public re-exports when a private module makes an import path inaccessible)
 - #155523 (Reorganize `tests/ui/issues/` - 02)
 - #155821 (c-variadic: document `Clone` and `Drop` instances and require `VaArgSafe: Copy`)
 - #155980 (Move `feature*` methods from `parse` mod to `errors` mod.)
 - #155987 (Make lifting infallible)
 - #155988 (tests/run-make/print-cfg: add Android target_env case)
 - #156000 (Fix ICE when using -Zinstrument-mcount and -Clinker-flavor=lld)
 - #156002 (Allow to use `Diagnostic` directly in `SharedContext::emit_lint`)
 - #156015 (rustc-dev-guide subtree update)
@rust-bors rust-bors Bot merged commit 6e290de into rust-lang:main May 1, 2026
11 checks passed
@rustbot rustbot added this to the 1.97.0 milestone May 1, 2026
rust-timer added a commit that referenced this pull request May 1, 2026
Rollup merge of #155853 - lapla-cogito:rv_mcount, r=mati865

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

Fixes #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)
@lapla-cogito lapla-cogito deleted the rv_mcount branch May 1, 2026 10:23
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request May 4, 2026
Rollup of 19 pull requests

Successful merges:

 - rust-lang/rust#155237 (Disentangle AST crates and error crates)
 - rust-lang/rust#155249 (Fix: On wasm targets, call `panic_in_cleanup` if panic occurs in cleanup)
 - rust-lang/rust#155853 (Use `_mcount` as the mcount symbol name on RISC-V Linux GNU targets)
 - rust-lang/rust#155919 (simplify `ast_fragments!`)
 - rust-lang/rust#155939 (Add feature gate for view_types experiment)
 - rust-lang/rust#155954 (rustdoc: preserve parent doc cfg for `macro_export` macros)
 - rust-lang/rust#155974 (add `c_variadic_experimental_arch` feature)
 - rust-lang/rust#155991 (Catch unwinds from the global ctxt callback to complete queries profiling data in more cases)
 - rust-lang/rust#156003 (Pass Session to optimize_and_codegen_fat_lto)
 - rust-lang/rust#153566 (Add suggestion for E0401 on inner const items)
 - rust-lang/rust#154610 (Suggest public re-exports when a private module makes an import path inaccessible)
 - rust-lang/rust#155523 (Reorganize `tests/ui/issues/` - 02)
 - rust-lang/rust#155821 (c-variadic: document `Clone` and `Drop` instances and require `VaArgSafe: Copy`)
 - rust-lang/rust#155980 (Move `feature*` methods from `parse` mod to `errors` mod.)
 - rust-lang/rust#155987 (Make lifting infallible)
 - rust-lang/rust#155988 (tests/run-make/print-cfg: add Android target_env case)
 - rust-lang/rust#156000 (Fix ICE when using -Zinstrument-mcount and -Clinker-flavor=lld)
 - rust-lang/rust#156002 (Allow to use `Diagnostic` directly in `SharedContext::emit_lint`)
 - rust-lang/rust#156015 (rustc-dev-guide subtree update)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

riscv64: [run-make] tests/run-make/instrument-mcount-link-pg failed: undefined reference to `mcount'

4 participants