diff options
| author | Jakub Konka <kubkon@jakubkonka.com> | 2020-12-04 16:23:21 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2020-12-04 11:37:55 -0800 |
| commit | c4853ba7ea007f46f8680749c028767287d39f68 (patch) | |
| tree | 69485827953cc62d05ed50ff11f4078d8a58d00d /src/Compilation.zig | |
| parent | b6b7a6401c064582b610b8ca6935a388c3bb3c03 (diff) | |
| download | zig-c4853ba7ea007f46f8680749c028767287d39f68.tar.gz zig-c4853ba7ea007f46f8680749c028767287d39f68.zip | |
Version-gate appending -syslibroot flag to lld
This commit version-gates appending `-syslibroot` flag to lld. This
is predicated upon the fact that for versions of macOS lower than
11, lld would fail to find and link against frameworks with this
flag specified.
Co-authored-by: Andrew Kelley <andrew@ziglang.org>
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 63858a1bcb..2188d7b87a 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -534,7 +534,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { const darwin_options: DarwinOptions = if (build_options.have_llvm and comptime std.Target.current.isDarwin()) outer: { const opts: DarwinOptions = if (use_lld and options.is_native_os and options.target.isDarwin()) inner: { - const syslibroot = try std.zig.system.getSDKPath(arena); + // TODO Revisit this targeting versions lower than macOS 11 when LLVM 12 is out. + // See https://github.com/ziglang/zig/issues/6996 + const at_least_big_sur = options.target.os.getVersionRange().semver.min.major >= 11; + const syslibroot = if (at_least_big_sur) try std.zig.system.getSDKPath(arena) else null; const system_linker_hack = std.os.getenv("ZIG_SYSTEM_LINKER_HACK") != null; break :inner .{ .syslibroot = syslibroot, |
