Closed
Description
Since a recent stabilization, rustc supports modifiers such as whole-archive for doing linking (rust-lang/rust#93901 (comment)). whole-archive is useful for cdylib crates that do their main initialization with ctors and thus are liable to have the C components be garbage collected by the linker to confusing results.
Currently it seems that cc emits the rustc-link-lib directive to cargo in such a way that it isn't possible to specify modifiers: https://docs.rs/cc/latest/src/cc/lib.rs.html#1017
It would be great if these modifiers could be specified in the Build builder.
docs on rustc side: https://doc.rust-lang.org/rustc/command-line-arguments.html#-l-link-the-generated-crate-to-a-native-library
Metadata
Metadata
Assignees
Labels
No labels