-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
-Clink-dead-codeLinkage option: -Clink-dead-codeLinkage option: -Clink-dead-codeA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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)
sharksforarms and rhysd
Metadata
Metadata
Assignees
Labels
-Clink-dead-codeLinkage option: -Clink-dead-codeLinkage option: -Clink-dead-codeA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.