macho: fix zig cc and c++ using stage2 llvm

This commit is contained in:
Jakub Konka 2022-07-21 22:21:34 +02:00
parent ca74656685
commit 0901e4805c

View File

@ -432,7 +432,7 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*MachO {
CodeSignature.init(page_size)
else
null,
.mode = if (use_stage1 or use_llvm or options.cache_mode == .whole)
.mode = if (use_stage1 or use_llvm or options.module == null or options.cache_mode == .whole)
.one_shot
else
.incremental,
@ -442,6 +442,8 @@ pub fn createEmpty(gpa: Allocator, options: link.Options) !*MachO {
self.llvm_object = try LlvmObject.create(gpa, options);
}
log.debug("selected linker mode '{s}'", .{@tagName(self.mode)});
return self;
}