diff options
| author | Jacob Young <15544577+jacobly0@users.noreply.github.com> | 2025-10-30 12:09:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-30 12:09:13 -0400 |
| commit | 5b060ef9d4acab0a92891e83d354f1c8e8e658e5 (patch) | |
| tree | 719022194a5bca2d7c2392ca1a3fb3de9ff926bb /src/Compilation.zig | |
| parent | 4174ab9c2c98d798452dd745d5d5dc657d601591 (diff) | |
| parent | 0834e696f75d8477e5bc7a2dc49e7d10800039bc (diff) | |
| download | zig-5b060ef9d4acab0a92891e83d354f1c8e8e658e5.tar.gz zig-5b060ef9d4acab0a92891e83d354f1c8e8e658e5.zip | |
Merge pull request #25558 from jacobly0/elfv2-load-obj
Elf2: start implementing input object loading
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index c72ef32fb5..9f0ab662a4 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -258,8 +258,6 @@ test_filters: []const []const u8, link_task_wait_group: WaitGroup = .{}, link_prog_node: std.Progress.Node = .none, -link_const_prog_node: std.Progress.Node = .none, -link_synth_prog_node: std.Progress.Node = .none, llvm_opt_bisect_limit: c_int, @@ -1991,7 +1989,6 @@ pub fn create(gpa: Allocator, arena: Allocator, io: Io, diag: *CreateDiagnostic, break :s if (is_exe_or_dyn_lib and build_options.have_llvm) .dyn_lib else .zcu; }, } - if (options.config.use_new_linker) break :s .zcu; } if (need_llvm and !build_options.have_llvm) break :s .none; // impossible to build without llvm if (is_exe_or_dyn_lib) break :s .lib; @@ -3066,35 +3063,13 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE // we also want it around during `flush`. if (comp.bin_file) |lf| { comp.link_prog_node = main_progress_node.start("Linking", 0); - if (lf.cast(.elf2)) |elf| { - comp.link_prog_node.increaseEstimatedTotalItems(3); - comp.link_const_prog_node = comp.link_prog_node.start("Constants", 0); - comp.link_synth_prog_node = comp.link_prog_node.start("Synthetics", 0); - elf.mf.update_prog_node = comp.link_prog_node.start("Relocations", elf.mf.updates.items.len); - } else if (lf.cast(.coff2)) |coff| { - comp.link_prog_node.increaseEstimatedTotalItems(3); - comp.link_const_prog_node = comp.link_prog_node.start("Constants", 0); - comp.link_synth_prog_node = comp.link_prog_node.start("Synthetics", 0); - coff.mf.update_prog_node = comp.link_prog_node.start("Relocations", coff.mf.updates.items.len); - } + lf.startProgress(comp.link_prog_node); } - defer { + defer if (comp.bin_file) |lf| { + lf.endProgress(); comp.link_prog_node.end(); comp.link_prog_node = .none; - comp.link_const_prog_node.end(); - comp.link_const_prog_node = .none; - comp.link_synth_prog_node.end(); - comp.link_synth_prog_node = .none; - if (comp.bin_file) |lf| { - if (lf.cast(.elf2)) |elf| { - elf.mf.update_prog_node.end(); - elf.mf.update_prog_node = .none; - } else if (lf.cast(.coff2)) |coff| { - coff.mf.update_prog_node.end(); - coff.mf.update_prog_node = .none; - } - } - } + }; try comp.performAllTheWork(main_progress_node); |
