Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Linker error because -wL as-needed conflicts with -C link-dead-code #64685

Open
Labels
-Clink-dead-codeLinkage option: -Clink-dead-code A-linkageArea: linking into static, shared libraries and binaries C-bugCategory: This is a bug. T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
@xd009642

Description

When a project has the [lib] tag in the Cargo.toml the -wL as-needed flag is added to the projects linker flags. However, if a project uses -C link-dead-code the two flags conflict causing a linker error of undefined reference for any functions in the lib.

This was discovered because link-dead-code is used for code coverage in tarpaulin. I spent some time seeing if there was a way around it as a user but I didn't manage to solve it myself. Issue that lead me to this for reference: xd009642/tarpaulin#126

Any solutions I could currently implement would be appreciated if this requires a PR I'm also happy to contribute (though may need some mentorship)

Metadata

Metadata

Assignees

No one assigned

    Labels

    -Clink-dead-codeLinkage option: -Clink-dead-code A-linkageArea: linking into static, shared libraries and binaries C-bugCategory: This is a bug. T-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

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /