Always emit native-static-libs note, even if it is empty
This commit is contained in:
parent
65899c06f1
commit
d1cd621b55
2 changed files with 21 additions and 9 deletions
|
@ -1560,12 +1560,9 @@ fn print_native_static_libs(
|
||||||
match out {
|
match out {
|
||||||
OutFileName::Real(path) => {
|
OutFileName::Real(path) => {
|
||||||
out.overwrite(&lib_args.join(" "), sess);
|
out.overwrite(&lib_args.join(" "), sess);
|
||||||
if !lib_args.is_empty() {
|
|
||||||
sess.dcx().emit_note(errors::StaticLibraryNativeArtifactsToFile { path });
|
sess.dcx().emit_note(errors::StaticLibraryNativeArtifactsToFile { path });
|
||||||
}
|
}
|
||||||
}
|
|
||||||
OutFileName::Stdout => {
|
OutFileName::Stdout => {
|
||||||
if !lib_args.is_empty() {
|
|
||||||
sess.dcx().emit_note(errors::StaticLibraryNativeArtifacts);
|
sess.dcx().emit_note(errors::StaticLibraryNativeArtifacts);
|
||||||
// Prefix for greppability
|
// Prefix for greppability
|
||||||
// Note: This must not be translated as tools are allowed to depend on this exact string.
|
// Note: This must not be translated as tools are allowed to depend on this exact string.
|
||||||
|
@ -1573,7 +1570,6 @@ fn print_native_static_libs(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> PathBuf {
|
fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> PathBuf {
|
||||||
let file_path = sess.target_tlib_path.dir.join(name);
|
let file_path = sess.target_tlib_path.dir.join(name);
|
||||||
|
|
16
tests/ui/codegen/empty-static-libs-issue-108825.rs
Normal file
16
tests/ui/codegen/empty-static-libs-issue-108825.rs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
//! Test that linking a no_std application still outputs the
|
||||||
|
//! `native-static-libs: ` note, even though it is empty.
|
||||||
|
|
||||||
|
//@ compile-flags: -Cpanic=abort --print=native-static-libs
|
||||||
|
//@ build-pass
|
||||||
|
//@ error-pattern: note: native-static-libs:
|
||||||
|
//@ dont-check-compiler-stderr (libcore links `/defaultlib:msvcrt` or `/defaultlib:libcmt` on MSVC)
|
||||||
|
//@ ignore-pass (the note is emitted later in the compilation pipeline, needs build)
|
||||||
|
|
||||||
|
#![crate_type = "staticlib"]
|
||||||
|
#![no_std]
|
||||||
|
|
||||||
|
#[panic_handler]
|
||||||
|
fn panic(_info: &core::panic::PanicInfo) -> ! {
|
||||||
|
loop {}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue