diff options
| author | David Tolnay <dtolnay@gmail.com> | 2023-07-19 15:13:40 -0700 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2023-07-20 11:04:32 -0700 |
| commit | 26fd6b15b058df4b53fd95109a92316a74e7e94a (patch) | |
| tree | 55b8530c04bd55ff46856cac5dee9f11f77b345c /compiler | |
| parent | 5ca0946ac0ae7c75feb3474039c7fb9a5348601d (diff) | |
| download | rust-26fd6b15b058df4b53fd95109a92316a74e7e94a.tar.gz rust-26fd6b15b058df4b53fd95109a92316a74e7e94a.zip | |
Add note about writing native-static-libs to file
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_codegen_ssa/messages.ftl | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 7 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/errors.rs | 6 |
3 files changed, 14 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/messages.ftl b/compiler/rustc_codegen_ssa/messages.ftl index f73080182bf..b6c70c62249 100644 --- a/compiler/rustc_codegen_ssa/messages.ftl +++ b/compiler/rustc_codegen_ssa/messages.ftl @@ -197,6 +197,8 @@ codegen_ssa_specify_libraries_to_link = use the `-l` flag to specify native libr codegen_ssa_static_library_native_artifacts = Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms. +codegen_ssa_static_library_native_artifacts_to_file = Native artifacts to link against have been written to {$path}. The order and any duplication can be significant on some platforms. + codegen_ssa_stripping_debug_info_failed = stripping debug info with `{$util}` failed: {$status} .note = {$output} diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index ecd58541e99..eefa4ac34dd 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1467,7 +1467,12 @@ fn print_native_static_libs( } match out { - OutFileName::Real(_) => out.overwrite(&lib_args.join(" "), sess), + OutFileName::Real(path) => { + out.overwrite(&lib_args.join(" "), sess); + if !lib_args.is_empty() { + sess.emit_note(errors::StaticLibraryNativeArtifactsToFile { path }); + } + } OutFileName::Stdout => { if !lib_args.is_empty() { sess.emit_note(errors::StaticLibraryNativeArtifacts); diff --git a/compiler/rustc_codegen_ssa/src/errors.rs b/compiler/rustc_codegen_ssa/src/errors.rs index 056b4abd235..c72d37be748 100644 --- a/compiler/rustc_codegen_ssa/src/errors.rs +++ b/compiler/rustc_codegen_ssa/src/errors.rs @@ -456,6 +456,12 @@ pub struct LinkerFileStem; pub struct StaticLibraryNativeArtifacts; #[derive(Diagnostic)] +#[diag(codegen_ssa_static_library_native_artifacts_to_file)] +pub struct StaticLibraryNativeArtifactsToFile<'a> { + pub path: &'a Path, +} + +#[derive(Diagnostic)] #[diag(codegen_ssa_link_script_unavailable)] pub struct LinkScriptUnavailable; |
