| ... | ... | @@ -893,7 +893,11 @@ fn linkWithLLD(self: *Coff, comp: *Compilation) !void { |
| 893 | 893 | // regarding eliding redundant object -> object transformations. |
| 894 | 894 | return error.NoObjectsToLink; |
| 895 | 895 | }; |
| 896 | | try fs.cwd().copyFile(the_object_path, fs.cwd(), full_out_path, .{}); |
| 896 | // This can happen when using --enable-cache and using the stage1 backend. In this case |
| 897 | // we can skip the file copy. |
| 898 | if (!mem.eql(u8, the_object_path, full_out_path)) { |
| 899 | try fs.cwd().copyFile(the_object_path, fs.cwd(), full_out_path, .{}); |
| 900 | } |
| 897 | 901 | } else { |
| 898 | 902 | // Create an LLD command line and invoke it. |
| 899 | 903 | var argv = std.ArrayList([]const u8).init(self.base.allocator); |