authorgravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-12-02 00:03:07+01:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2020-12-02 00:03:07+01:00
log3e2d1ccaad03e7e1a9efe905863d3af793e61500
tree283d56eb20b8473c197f99e11e19b63af10ac0e7
parentb58a2a4de6f9ce82d969d076dea798daf22d4b69

lld+macho: rename final artefact in main.zig


2 files changed, 11 insertions(+), 5 deletions(-)

src/link/MachO.zig-3
......@@ -762,9 +762,6 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
762762 try self.writeHeader();
763763 // Generate adhoc code signature
764764 try self.writeCodeSignature();
765 // Move file in-place to please the kernel
766 const emit = self.base.options.emit.?;
767 try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, emit.sub_path, .{});
768765 }
769766 }
770767 }
src/main.zig+11-2
......@@ -1773,8 +1773,16 @@ fn buildOutputType(
17731773 error.SemanticAnalyzeFail => process.exit(1),
17741774 else => |e| return e,
17751775 };
1776 if (output_mode == .Exe) {
1777 try comp.makeBinFileExecutable();
1776 switch (output_mode) {
1777 .Exe => try comp.makeBinFileExecutable(),
1778 .Lib => {
1779 if (link_mode) |lm| {
1780 if (lm == .Dynamic) {
1781 try comp.makeBinFileExecutable();
1782 }
1783 }
1784 },
1785 else => {},
17781786 }
17791787
17801788 if (build_options.is_stage1 and comp.stage1_lock != null and watch) {
......@@ -2413,6 +2421,7 @@ pub fn cmdBuild(gpa: *Allocator, arena: *Allocator, args: []const []const u8) !v
24132421 defer comp.destroy();
24142422
24152423 try updateModule(gpa, comp, null, .none);
2424 try comp.makeBinFileExecutable();
24162425
24172426 child_argv.items[argv_index_exe] = try comp.bin_file.options.emit.?.directory.join(
24182427 arena,