Open
Description
For Debian we need to keep track of static libs linked into a final binary, for copyright purposes.
It seems that src/librustc_codegen_llvm/back/link.rs
performs the actual linking and search of paths, and it refers to a --print=native-static-libs
option but this doesn't seem to work.
For example when I link to the system libbacktrace and then build this with RUSTFLAGS="--print=native-static-libs" cargo build --verbose --verbose --verbose
I can see the build.rs output which is
cargo:rustc-link-lib=static=backtrace
cargo:rustc-link-search=native=/usr/lib/gcc/x86_64-linux-gnu/7/
But then I don't see any follow-up output that indicates that rustc actually found the file /usr/lib/gcc/x86_64-linux-gnu/7/libbacktrace.a
and this was what was actually linked into the final backtrace-sys.rlib
.