| author | |
| committer | |
| log | bcaf025a6241b80826dfc13aca7ea4a56c467f55 |
| tree | 97be604ca1e33fdf277fb7012e7cf3f2b0173fa6 |
| parent | bb80906868d26b9eec6ecd2ed2d7593ccbe88ae5 |
| signature |
5 files changed, 18 insertions(+), 9 deletions(-)
src/Compilation.zig+11-5| ... | @@ -2912,12 +2912,18 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE | ... | @@ -2912,12 +2912,18 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE |
| 2912 | // we also want it around during `flush`. | 2912 | // we also want it around during `flush`. |
| 2913 | if (comp.bin_file) |lf| { | 2913 | if (comp.bin_file) |lf| { |
| 2914 | // mirrors logic in `Compilation.flush`: | 2914 | // mirrors logic in `Compilation.flush`: |
| 2915 | // Always: linker flush | ||
| 2916 | var initial_estimated_total: usize = 1; | ||
| 2917 | const llvm = if (comp.zcu) |zcu| zcu.llvm_object != null else false; | ||
| 2915 | // For llvm: "LLVM Emit Object" and "Parse Object" with the zcu object | 2918 | // For llvm: "LLVM Emit Object" and "Parse Object" with the zcu object |
| 2916 | // Always: flush of the linker | 2919 | if (llvm) { |
| 2917 | const initial_estimated_total: usize = if (comp.zcu) |zcu| | 2920 | initial_estimated_total += 2; |
| 2918 | if (zcu.llvm_object) |_| 3 else 1 | 2921 | } |
| 2919 | else | 2922 | // Prelink |
| 2920 | 1; | 2923 | if (!lf.post_prelink or llvm) { |
| 2924 | initial_estimated_total += 1; | ||
| 2925 | } | ||
| 2926 | |||
| 2921 | comp.link_prog_node = main_progress_node.start("Linking", initial_estimated_total); | 2927 | comp.link_prog_node = main_progress_node.start("Linking", initial_estimated_total); |
| 2922 | lf.startProgress(comp.link_prog_node); | 2928 | lf.startProgress(comp.link_prog_node); |
| 2923 | } | 2929 | } |
src/link.zig+1-1| ... | @@ -1243,7 +1243,7 @@ pub const File = struct { | ... | @@ -1243,7 +1243,7 @@ pub const File = struct { |
| 1243 | dev.check(tag.devFeature()); | 1243 | dev.check(tag.devFeature()); |
| 1244 | try @as(*tag.Type(), @fieldParentPtr("base", base)).prelink(base.comp.link_prog_node); | 1244 | try @as(*tag.Type(), @fieldParentPtr("base", base)).prelink(base.comp.link_prog_node); |
| 1245 | }, | 1245 | }, |
| 1246 | else => {}, | 1246 | else => base.comp.link_prog_node.completeOne(), |
| 1247 | } | 1247 | } |
| 1248 | 1248 | ||
| 1249 | base.post_prelink = true; | 1249 | base.post_prelink = true; |
src/link/Coff.zig+3-1| ... | @@ -5370,7 +5370,9 @@ fn loadDll(coff: *Coff, path: std.Build.Cache.Path, fr: *Io.File.Reader) LoadInp | ... | @@ -5370,7 +5370,9 @@ fn loadDll(coff: *Coff, path: std.Build.Cache.Path, fr: *Io.File.Reader) LoadInp |
| 5370 | } | 5370 | } |
| 5371 | 5371 | ||
| 5372 | pub fn prelink(coff: *Coff, prog_node: std.Progress.Node) link.Error!void { | 5372 | pub fn prelink(coff: *Coff, prog_node: std.Progress.Node) link.Error!void { |
| 5373 | _ = prog_node; | 5373 | const sub_prog_node = prog_node.start("COFF Prelink", 0); |
| 5374 | defer sub_prog_node.end(); | ||
| 5375 | |||
| 5374 | const base = coff.base; | 5376 | const base = coff.base; |
| 5375 | const comp = base.comp; | 5377 | const comp = base.comp; |
| 5376 | 5378 |
src/link/Elf2.zig+3-1| ... | @@ -5749,7 +5749,9 @@ fn updateInitFiniArraySectionSize( | ... | @@ -5749,7 +5749,9 @@ fn updateInitFiniArraySectionSize( |
| 5749 | } | 5749 | } |
| 5750 | 5750 | ||
| 5751 | pub fn prelink(elf: *Elf, prog_node: std.Progress.Node) link.Error!void { | 5751 | pub fn prelink(elf: *Elf, prog_node: std.Progress.Node) link.Error!void { |
| 5752 | _ = prog_node; | 5752 | const sub_prog_node = prog_node.start("ELF Prelink", 0); |
| 5753 | defer sub_prog_node.end(); | ||
| 5754 | |||
| 5753 | const diags = &elf.base.comp.link_diags; | 5755 | const diags = &elf.base.comp.link_diags; |
| 5754 | elf.prelinkInner() catch |err| switch (err) { | 5756 | elf.prelinkInner() catch |err| switch (err) { |
| 5755 | error.MappedFileIo => return diags.fail("failed to write output file: {t}", .{elf.mf.io_err.?}), | 5757 | error.MappedFileIo => return diags.fail("failed to write output file: {t}", .{elf.mf.io_err.?}), |
src/link/Wasm.zig-1| ... | @@ -3398,7 +3398,6 @@ pub fn prelink(wasm: *Wasm, prog_node: std.Progress.Node) link.Error!void { | ... | @@ -3398,7 +3398,6 @@ pub fn prelink(wasm: *Wasm, prog_node: std.Progress.Node) link.Error!void { |
| 3398 | const tracy = trace(@src()); | 3398 | const tracy = trace(@src()); |
| 3399 | defer tracy.end(); | 3399 | defer tracy.end(); |
| 3400 | 3400 | ||
| 3401 | prog_node.increaseEstimatedTotalItems(1); | ||
| 3402 | const sub_prog_node = prog_node.start("Wasm Prelink", 0); | 3401 | const sub_prog_node = prog_node.start("Wasm Prelink", 0); |
| 3403 | defer sub_prog_node.end(); | 3402 | defer sub_prog_node.end(); |
| 3404 | 3403 |