From f87424ab6393c3208d96a4f078c71f745a37c84b Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Wed, 14 Jul 2021 13:14:41 +0200 Subject: [PATCH] zld: invoke traditional linker if has LLVM as a temp measure --- src/Compilation.zig | 7 ++++--- src/link/MachO.zig | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index 6256e2551f..ce6ab0fa76 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -907,9 +907,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { break :blk false; }; - const darwin_can_use_system_sdk = comptime std.Target.current.isDarwin() and - std.builtin.os.tag == .macos and - options.target.isDarwin(); + const darwin_can_use_system_sdk = blk: { + if (comptime !std.Target.current.isDarwin()) break :blk false; + break :blk std.builtin.os.tag == .macos and options.target.isDarwin(); + }; const sysroot = blk: { if (options.sysroot) |sysroot| { diff --git a/src/link/MachO.zig b/src/link/MachO.zig index 91c457d4fe..c00aee6997 100644 --- a/src/link/MachO.zig +++ b/src/link/MachO.zig @@ -434,7 +434,7 @@ pub fn flush(self: *MachO, comp: *Compilation) !void { } } - if (build_options.have_llvm and self.base.options.use_lld) { + if (build_options.have_llvm) { return self.linkWithZld(comp); } else { switch (self.base.options.effectiveOutputMode()) {