diff options
Diffstat (limited to 'src/link')
| -rw-r--r-- | src/link/Coff/lld.zig | 7 | ||||
| -rw-r--r-- | src/link/Elf.zig | 7 | ||||
| -rw-r--r-- | src/link/Wasm.zig | 7 |
3 files changed, 9 insertions, 12 deletions
diff --git a/src/link/Coff/lld.zig b/src/link/Coff/lld.zig index 00e6c4d8d1..ebc2208606 100644 --- a/src/link/Coff/lld.zig +++ b/src/link/Coff/lld.zig @@ -175,7 +175,8 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod // We will invoke ourselves as a child process to gain access to LLD. // This is necessary because LLD does not behave properly as a library - // it calls exit() and does not reset all global data between invocations. - try argv.appendSlice(&[_][]const u8{ comp.self_exe_path.?, "lld-link" }); + const linker_command = "lld-link"; + try argv.appendSlice(&[_][]const u8{ comp.self_exe_path.?, linker_command }); try argv.append("-ERRORLIMIT:0"); try argv.append("-NOLOGO"); @@ -556,9 +557,7 @@ pub fn linkWithLLD(self: *Coff, comp: *Compilation, prog_node: *std.Progress.Nod switch (term) { .Exited => |code| { if (code != 0) { - // TODO parse this output and surface with the Compilation API rather than - // directly outputting to stderr here. - std.debug.print("{s}", .{stderr}); + comp.lockAndParseLldStderr(linker_command, stderr); return error.LLDReportedFailure; } }, diff --git a/src/link/Elf.zig b/src/link/Elf.zig index b6391b31c6..59f620f638 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -1422,7 +1422,8 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v // We will invoke ourselves as a child process to gain access to LLD. // This is necessary because LLD does not behave properly as a library - // it calls exit() and does not reset all global data between invocations. - try argv.appendSlice(&[_][]const u8{ comp.self_exe_path.?, "ld.lld" }); + const linker_command = "ld.lld"; + try argv.appendSlice(&[_][]const u8{ comp.self_exe_path.?, linker_command }); if (is_obj) { try argv.append("-r"); } @@ -1841,9 +1842,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v switch (term) { .Exited => |code| { if (code != 0) { - // TODO parse this output and surface with the Compilation API rather than - // directly outputting to stderr here. - std.debug.print("{s}", .{stderr}); + comp.lockAndParseLldStderr(linker_command, stderr); return error.LLDReportedFailure; } }, diff --git a/src/link/Wasm.zig b/src/link/Wasm.zig index b9f2d74bd8..39f8a6bbe6 100644 --- a/src/link/Wasm.zig +++ b/src/link/Wasm.zig @@ -3125,7 +3125,8 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) ! // We will invoke ourselves as a child process to gain access to LLD. // This is necessary because LLD does not behave properly as a library - // it calls exit() and does not reset all global data between invocations. - try argv.appendSlice(&[_][]const u8{ comp.self_exe_path.?, "wasm-ld" }); + const linker_command = "wasm-ld"; + try argv.appendSlice(&[_][]const u8{ comp.self_exe_path.?, linker_command }); try argv.append("--error-limit=0"); if (wasm.base.options.lto) { @@ -3357,9 +3358,7 @@ fn linkWithLLD(wasm: *Wasm, comp: *Compilation, prog_node: *std.Progress.Node) ! switch (term) { .Exited => |code| { if (code != 0) { - // TODO parse this output and surface with the Compilation API rather than - // directly outputting to stderr here. - std.debug.print("{s}", .{stderr}); + comp.lockAndParseLldStderr(linker_command, stderr); return error.LLDReportedFailure; } }, |
