Skip to content

Propagated coverage flags cause gcov link errors #1354

Closed
@cuviper

Description

@cuviper

When compiling code like the example and RUSTFLAGS=-Cprofile-generate=$PWD, it fails to link with errors like this:

foo.c:1:(.text._sub_I_00100_0+0xf): undefined reference to `__gcov_init'

(and many other __gcov_* symbols)

That's with a default CC that is GCC; it's okay with Clang because that uses the same profiling library as Rust.

Maybe -Cprofile-generate (and -Cprofile-use) should not be translated for ToolFamily::Gnu at all? It seems unlikely that someone would use this and try to juggle both LLVM profraw and GCC gcov files, even if the link error is fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions