-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Add a feature to print actual static libs linked in, --print=native-static-libs seems not to work #53281
Copy link
Copy link
Open
Labels
A-driverArea: rustc_driver that ties everything together into the `rustc` compilerArea: rustc_driver that ties everything together into the `rustc` compilerA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-driverArea: rustc_driver that ties everything together into the `rustc` compilerArea: rustc_driver that ties everything together into the `rustc` compilerA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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.rsperforms the actual linking and search of paths, and it refers to a--print=native-static-libsoption 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 --verboseI can see the build.rs output which isBut 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.aand this was what was actually linked into the finalbacktrace-sys.rlib.