about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/back/link.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 80758aac134..fae59a3b9dc 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -1040,6 +1040,11 @@ fn link_natively(
                 sess.dcx().abort_if_errors();
             }
 
+            let stderr = escape_string(&prog.stderr);
+            let stdout = escape_string(&prog.stdout);
+            info!("linker stderr:\n{}", &stderr);
+            info!("linker stdout:\n{}", &stdout);
+
             let (level, src) = codegen_results.crate_info.lint_levels.linker_messages;
             let lint = |msg| {
                 lint_level(sess, LINKER_MESSAGES, level, src, None, |diag| {
@@ -1049,16 +1054,14 @@ fn link_natively(
 
             if !prog.stderr.is_empty() {
                 // We already print `warning:` at the start of the diagnostic. Remove it from the linker output if present.
-                let stderr = escape_string(&prog.stderr);
-                debug!("original stderr: {stderr}");
                 let stderr = stderr
                     .strip_prefix("warning: ")
                     .unwrap_or(&stderr)
                     .replace(": warning: ", ": ");
                 lint(format!("linker stderr: {stderr}"));
             }
-            if !prog.stdout.is_empty() && sess.opts.verbose {
-                lint(format!("linker stdout: {}", escape_string(&prog.stdout)))
+            if !prog.stdout.is_empty() {
+                lint(format!("linker stdout: {}", stdout))
             }
         }
         Err(e) => {