lld+macho: rename final artefact in main.zig

This commit is contained in:
Jakub Konka 2020-12-02 00:03:07 +01:00
parent b58a2a4de6
commit 3e2d1ccaad
2 changed files with 11 additions and 5 deletions

View File

@ -762,9 +762,6 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
try self.writeHeader();
// Generate adhoc code signature
try self.writeCodeSignature();
// Move file in-place to please the kernel
const emit = self.base.options.emit.?;
try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, emit.sub_path, .{});
}
}
}

View File

@ -1773,8 +1773,16 @@ fn buildOutputType(
error.SemanticAnalyzeFail => process.exit(1),
else => |e| return e,
};
if (output_mode == .Exe) {
try comp.makeBinFileExecutable();
switch (output_mode) {
.Exe => try comp.makeBinFileExecutable(),
.Lib => {
if (link_mode) |lm| {
if (lm == .Dynamic) {
try comp.makeBinFileExecutable();
}
}
},
else => {},
}
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
defer comp.destroy();
try updateModule(gpa, comp, null, .none);
try comp.makeBinFileExecutable();
child_argv.items[argv_index_exe] = try comp.bin_file.options.emit.?.directory.join(
arena,