im currently writing a shared library that i want to preload into other programs to intercept system calls. The current version is written in C but I am thinking about rewriting it in Rust to make use of it's higher level abstractions as the logic of the library is getting more complex.
As I want to preload the library I am currently using a version script to only export the symbols I want to intercept.
My Question: I found no way to specify the needed version script linker option using cargo. Is there any way to achieve this?
Ok, thanks, I got it working with cargo rustc when only compiling this crate. As --version-script expects a file argument I also had to add a build script that copies that file to OUT_DIR.
But I currently have this crate within a workspace. As far as I found in the documentation I can only add -l and -L to RUSTFLAGS through the build script and that only the topmost .cargo/config is considered when using cargo build which would then affect all crates built within the workspace.
Is there any way to add these options to only one crate within a workspace?