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)
When a project has the
[lib]tag in theCargo.tomlthe-wL as-neededflag is added to the projects linker flags. However, if a project uses-C link-dead-codethe two flags conflict causing a linker error ofundefined referencefor 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)