Skip to content

Code coverage and profiling don't work on non-X86_64 -musl targets because profiler_builtins isn't provided for them #79556

Open
@briansmith

Description

@briansmith
Contributor

This indicates to me that it should be practical to enable the profiler feature for -musl targets on ARM and Intel targets, and we should do so. At a minimum, the following very common targets should have the profiler feature enabled:

Activity

briansmith

briansmith commented on Nov 30, 2020

@briansmith
Author
kobehz

kobehz commented on Jun 3, 2021

@kobehz

This indicates to me that it should be practical to enable the profiler feature for -musl targets on ARM and Intel targets, and we should do so. At a minimum, the following very common targets should have the profiler feature enabled:

  • aarch64-unknown-linux-musl
    arm-unknown-linux-musleabihf
    armv7-unknown-linux-musleabihf
    i686-unknown-linux-musl

I have the same problem for target aarch64-unknown-linux-musl.
What time do you expect to enable the the profiler feature for these targets?
Or what can I do myself to solve the problem?

briansmith

briansmith commented on Jun 3, 2021

@briansmith
ContributorAuthor

Or what can I do myself to solve the problem?

I think there's not much stopping us from making a PR to rust-lang/rust that copies https://github.com/rust-lang/rust/pull/76035/files for the other musl targets.

mati865

mati865 commented on Jun 3, 2021

@mati865
Member

This might be harder than it sounds since only x86_64 musl target is natively built. Others are cross compiled from Linux GNU target.
But trying to do what Brian said won't hurt.

clarfonthey

clarfonthey commented on Jul 13, 2022

@clarfonthey
Contributor

Ran into something similar to this after trying to test some code via cross. If I'm understanding correctly, all tier-2 and below targets don't have support for profiler_builtins. That includes not only the MUSL targets, but targets for architectures other than x86_64, aarch64, and i686.

kobehz

kobehz commented on Jul 13, 2022

@kobehz
tmandry

tmandry commented on Jul 13, 2022

@tmandry
Member

It definitely works for Fuchsia (Tier 2) since we use it there. But we also build our own toolchain. This is probably (at least in part) an issue with the way the official distribution for those targets is configured and built.

briansmith

briansmith commented on Oct 31, 2023

@briansmith
ContributorAuthor

This might be harder than it sounds since only x86_64 musl target is natively built. Others are cross compiled from Linux GNU target.

https://github.com/rust-lang/rust/pull/111575/files added profiler support by just adding --enable-profiler to ENV RUST_CONFIGURE_ARGS. So I think it isn't as hard as we're worried about.

5 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)O-muslTarget: The musl libcT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @briansmith@Enselic@wesleywiser@mati865@tmandry

        Issue actions

          Code coverage and profiling don't work on non-X86_64 -musl targets because `profiler_builtins` isn't provided for them · Issue #79556 · rust-lang/rust