Skip to content

--print=native-static-libs produces no output for #![no_std] staticlib #108825

Open
@pnkfelix

Description

(spawned off of #53281 (comment) )
I tried this code:

// compile-args: -Cpanic=abort --print=native-static-libs /tmp/hello.rs
#![crate_type="staticlib"]

#![no_std]

use core::panic::PanicInfo;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
    loop { }
}

I expected to see this happen:

A line of output that includes the prefix:

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: [...]

Instead, this happened:

No output.

Meta

rustc --version --verbose:

rustc 1.70.0-nightly (7820b62d2 2023-03-05)
binary: rustc
commit-hash: 7820b62d20bc548096d4632a3487987308cb4b5d
commit-date: 2023-03-05
host: x86_64-unknown-linux-gnu
release: 1.70.0-nightly
LLVM version: 15.0.7

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions