Multiple #[link(name="X")]
attributes result in duplicate link arguments
#65847
Labels
A-linkage
Area: linking into static, shared libraries and binaries
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Given static libraries, having duplicate
-lfoo
is more likely to result in an error than not. Having multiple#[link]
blocks withkind="static"
specified or inferred in any way will cause the linking to fail. Consider for example this:will pass to the linker
which will fail due to duplicate symbols. This is somewhat surprising because
rustc
will avoid passing through to the linker the-lfoo
from-l static=foo
if there’s a#[link]
attribute in the crate.The text was updated successfully, but these errors were encountered: