| author | |
| committer | |
| log | e9807418e7e58f3cb85d5d3a6d114d5084e305bd |
| tree | 81e328a6dc92b35d12d4ab012e99a0ef1f8e4a31 |
| parent | e9b137f23a9b38c6b808452ef216e4e18d3070ed |
MachO linker no longer collects unused dwarf debug information4 files changed, 6 insertions(+), 31 deletions(-)
lib/std/target.zig+1| ... | ... | @@ -468,6 +468,7 @@ pub const Target = struct { |
| 468 | 468 | /// TODO Get rid of this one. |
| 469 | 469 | unknown, |
| 470 | 470 | coff, |
| 471 | pe, | |
| 471 | 472 | elf, |
| 472 | 473 | macho, |
| 473 | 474 | wasm, |
src-self-hosted/link.zig+1-1| ... | ... | @@ -68,7 +68,7 @@ pub const File = struct { |
| 68 | 68 | pub fn openPath(allocator: *Allocator, dir: fs.Dir, sub_path: []const u8, options: Options) !*File { |
| 69 | 69 | switch (options.object_format) { |
| 70 | 70 | .unknown => unreachable, |
| 71 | .coff => return Coff.openPath(allocator, dir, sub_path, options), | |
| 71 | .coff, .pe => return Coff.openPath(allocator, dir, sub_path, options), | |
| 72 | 72 | .elf => return Elf.openPath(allocator, dir, sub_path, options), |
| 73 | 73 | .macho => return MachO.openPath(allocator, dir, sub_path, options), |
| 74 | 74 | .wasm => return Wasm.openPath(allocator, dir, sub_path, options), |
src-self-hosted/link/MachO.zig+1-24| ... | ... | @@ -316,31 +316,8 @@ pub fn updateDecl(self: *MachO, module: *Module, decl: *Module.Decl) !void { |
| 316 | 316 | var code_buffer = std.ArrayList(u8).init(self.base.allocator); |
| 317 | 317 | defer code_buffer.deinit(); |
| 318 | 318 | |
| 319 | var dbg_line_buffer = std.ArrayList(u8).init(self.base.allocator); | |
| 320 | defer dbg_line_buffer.deinit(); | |
| 321 | ||
| 322 | var dbg_info_buffer = std.ArrayList(u8).init(self.base.allocator); | |
| 323 | defer dbg_info_buffer.deinit(); | |
| 324 | ||
| 325 | var dbg_info_type_relocs: File.DbgInfoTypeRelocsTable = .{}; | |
| 326 | defer { | |
| 327 | var it = dbg_info_type_relocs.iterator(); | |
| 328 | while (it.next()) |entry| { | |
| 329 | entry.value.relocs.deinit(self.base.allocator); | |
| 330 | } | |
| 331 | dbg_info_type_relocs.deinit(self.base.allocator); | |
| 332 | } | |
| 333 | ||
| 334 | 319 | const typed_value = decl.typed_value.most_recent.typed_value; |
| 335 | const res = try codegen.generateSymbol( | |
| 336 | &self.base, | |
| 337 | decl.src(), | |
| 338 | typed_value, | |
| 339 | &code_buffer, | |
| 340 | &dbg_line_buffer, | |
| 341 | &dbg_info_buffer, | |
| 342 | &dbg_info_type_relocs, | |
| 343 | ); | |
| 320 | const res = try codegen.generateSymbol(&self.base, decl.src(), typed_value, &code_buffer, .none); | |
| 344 | 321 | |
| 345 | 322 | const code = switch (res) { |
| 346 | 323 | .externally_managed => |x| x, |
src-self-hosted/main.zig+3-6| ... | ... | @@ -153,8 +153,8 @@ const usage_build_generic = |
| 153 | 153 | \\ elf Executable and Linking Format |
| 154 | 154 | \\ c Compile to C source code |
| 155 | 155 | \\ wasm WebAssembly |
| 156 | \\ pe Portable Executable (Windows) | |
| 156 | 157 | \\ coff (planned) Common Object File Format (Windows) |
| 157 | \\ pe (planned) Portable Executable (Windows) | |
| 158 | 158 | \\ macho (planned) macOS relocatables |
| 159 | 159 | \\ hex (planned) Intel IHEX |
| 160 | 160 | \\ raw (planned) Dump machine code directly |
| ... | ... | @@ -451,7 +451,7 @@ fn buildOutputType( |
| 451 | 451 | } else if (mem.eql(u8, ofmt, "coff")) { |
| 452 | 452 | break :blk .coff; |
| 453 | 453 | } else if (mem.eql(u8, ofmt, "pe")) { |
| 454 | break :blk .coff; | |
| 454 | break :blk .pe; | |
| 455 | 455 | } else if (mem.eql(u8, ofmt, "macho")) { |
| 456 | 456 | break :blk .macho; |
| 457 | 457 | } else if (mem.eql(u8, ofmt, "wasm")) { |
| ... | ... | @@ -524,10 +524,7 @@ fn buildOutputType( |
| 524 | 524 | try stderr.print("\nUnable to parse command: {}\n", .{@errorName(err)}); |
| 525 | 525 | continue; |
| 526 | 526 | }) |line| { |
| 527 | const actual_line = if (line[line.len - 1] == '\r') | |
| 528 | line[0 .. line.len - 1] | |
| 529 | else | |
| 530 | line; | |
| 527 | const actual_line = mem.trimRight(u8, line, "\r\n "); | |
| 531 | 528 | |
| 532 | 529 | if (mem.eql(u8, actual_line, "update")) { |
| 533 | 530 | if (output_mode == .Exe) { |