aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2022-04-16 18:07:02 +0200
committerGitHub <noreply@github.com>2022-04-16 18:07:02 +0200
commit8f75823728d247bc11d916b7257d7eebc7be06de (patch)
treec75f34334db2fba833ae91f2ae7a52f9cbd546c8 /src/link.zig
parenta315d51c0a0c8eda2467c5571f9d7e2495274dbd (diff)
parent897df18573c951b49fb6421a9e1b711cabfeda67 (diff)
downloadzig-8f75823728d247bc11d916b7257d7eebc7be06de.tar.gz
zig-8f75823728d247bc11d916b7257d7eebc7be06de.zip
Merge pull request #11446 from ziglang/aarch64-macos-llvm
stage2: fix behavior test failures on aarch64-macos (LLVM+native), and other minor fixes
Diffstat (limited to 'src/link.zig')
-rw-r--r--src/link.zig11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/link.zig b/src/link.zig
index dbef400189..2d7e577b70 100644
--- a/src/link.zig
+++ b/src/link.zig
@@ -352,11 +352,6 @@ pub const File = struct {
}
switch (base.tag) {
.macho => if (base.file) |f| {
- if (base.intermediary_basename != null) {
- // The file we have open is not the final file that we want to
- // make executable, so we don't have to close it.
- return;
- }
if (comptime builtin.target.isDarwin() and builtin.target.cpu.arch == .aarch64) {
if (base.options.target.cpu.arch == .aarch64) {
// XNU starting with Big Sur running on arm64 is caching inodes of running binaries.
@@ -371,8 +366,10 @@ pub const File = struct {
try emit.directory.handle.copyFile(emit.sub_path, emit.directory.handle, emit.sub_path, .{});
}
}
- f.close();
- base.file = null;
+ if (base.intermediary_basename == null) {
+ f.close();
+ base.file = null;
+ }
},
.coff, .elf, .plan9 => if (base.file) |f| {
if (base.intermediary_basename != null) {