Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--print native-static-libs with --emit metadata prints nothing #137384

Open
ChrisDenton opened this issue Feb 21, 2025 · 0 comments
Open

--print native-static-libs with --emit metadata prints nothing #137384

ChrisDenton opened this issue Feb 21, 2025 · 0 comments
Labels
A-CLI Area: Command-line interface (CLI) to the compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@ChrisDenton
Copy link
Member

ChrisDenton commented Feb 21, 2025

It should be possible to print the necessary native libs without actually creating the static library. However, combining --emit metadata with --print native-static-libs does not print anything.

I tried this:

$ rustc /dev/null --print native-static-libs --crate-type staticlib --emit metadata

I expected to see this printed to the console:

note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.

note: native-static-libs: -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc

Instead, this happened: the output is empty.

If I run without --emit metadata it works:

$ rustc /dev/null --print native-static-libs --crate-type staticlib
note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.

note: native-static-libs: -lgcc_s -lutil -lrt -lpthread -lm -ldl -lc

However, this also creates libnull.a.

Meta

rustc --version --verbose:

rustc 1.87.0-nightly (f04bbc60f 2025-02-20)
binary: rustc
commit-hash: f04bbc60f8c353ee5ba0677bc583ac4a88b2c180
commit-date: 2025-02-20
host: x86_64-unknown-linux-gnu
release: 1.87.0-nightly
LLVM version: 20.1.0
@ChrisDenton ChrisDenton added the C-bug Category: This is a bug. label Feb 21, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Feb 21, 2025
@jieyouxu jieyouxu added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-CLI Area: Command-line interface (CLI) to the compiler and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: Command-line interface (CLI) to the compiler C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants