| author | |
| committer | |
| log | 88d87d65061e7ac171cc23623a25e05b0278a872 |
| tree | 1a5634cbfd88f74bee18082e36619ed15e004a37 |
| parent | 4c83b11f71564e0de80f496f471ca6dfb83a95e3 |
This way we avoid the infamous SIGKILL on arm64 macos.2 files changed, 7 insertions(+), 9 deletions(-)
src/link.zig+4-7| ... | ... | @@ -352,11 +352,6 @@ pub const File = struct { |
| 352 | 352 | } |
| 353 | 353 | switch (base.tag) { |
| 354 | 354 | .macho => if (base.file) |f| { |
| 355 | if (base.intermediary_basename != null) { | |
| 356 | // The file we have open is not the final file that we want to | |
| 357 | // make executable, so we don't have to close it. | |
| 358 | return; | |
| 359 | } | |
| 360 | 355 | if (comptime builtin.target.isDarwin() and builtin.target.cpu.arch == .aarch64) { |
| 361 | 356 | if (base.options.target.cpu.arch == .aarch64) { |
| 362 | 357 | // XNU starting with Big Sur running on arm64 is caching inodes of running binaries. |
| ... | ... | @@ -371,8 +366,10 @@ pub const File = struct { |
| 371 | 366 | try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, emit.sub_path, .{}); |
| 372 | 367 | } |
| 373 | 368 | } |
| 374 | f.close(); | |
| 375 | base.file = null; | |
| 369 | if (base.intermediary_basename == null) { | |
| 370 | f.close(); | |
| 371 | base.file = null; | |
| 372 | } | |
| 376 | 373 | }, |
| 377 | 374 | .coff, .elf, .plan9 => if (base.file) |f| { |
| 378 | 375 | if (base.intermediary_basename != null) { |
src/link/MachO.zig+3-2| ... | ... | @@ -423,7 +423,7 @@ pub fn flush(self: *MachO, comp: *Compilation) !void { |
| 423 | 423 | if (self.base.options.emit == null) { |
| 424 | 424 | if (build_options.have_llvm) { |
| 425 | 425 | if (self.llvm_object) |llvm_object| { |
| 426 | return try llvm_object.flushModule(comp); | |
| 426 | try llvm_object.flushModule(comp); | |
| 427 | 427 | } |
| 428 | 428 | } |
| 429 | 429 | return; |
| ... | ... | @@ -1116,7 +1116,8 @@ pub fn flushObject(self: *MachO, comp: *Compilation) !void { |
| 1116 | 1116 | defer tracy.end(); |
| 1117 | 1117 | |
| 1118 | 1118 | if (build_options.have_llvm) |
| 1119 | if (self.llvm_object) |llvm_object| return llvm_object.flushModule(comp); | |
| 1119 | if (self.llvm_object) |llvm_object| | |
| 1120 | return llvm_object.flushModule(comp); | |
| 1120 | 1121 | |
| 1121 | 1122 | return error.TODOImplementWritingObjFiles; |
| 1122 | 1123 | } |