Skip to content

instrument-coverage for wasm32-unknown-unknown is broken in versions since 1.87.0 #149084

@Spxg

Description

@Spxg

I tried this code:

pub extern "C" fn foo(a: i32, b: i32) -> i32 {
    a + b
}

run:

RUSTFLAGS="-Cinstrument-coverage -Zno-profiler-runtime" cargo build --target wasm32-unknown-unknown

I expected to see this happen: The __llvm_profile_init symbol and other profiling symbols are present.

Instead, this happened: The __llvm_profile_init symbol and other profiling symbols are missing.

Introduced: nightly-2025-02-18

This might be related to the LLVM 20 upgrade:
ce36a966c#diff-eac3d5ef63f39b7914ae9015f31b8d87353ea8fbcd5b02a7335dd86c557e7625

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (ce36a966c 2025-02-17)
binary: rustc
commit-hash: ce36a966c79e109dabeef7a47fe68e5294c6d71e
commit-date: 2025-02-17
host: aarch64-apple-darwin
release: 1.87.0-nightly
LLVM version: 20.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-code-coverageArea: Source-based code coverage (-Cinstrument-coverage)C-bugCategory: This is a bug.O-wasmTarget: WASM (WebAssembly), http://webassembly.org/needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions