Commit ab69b89d52

Jakub Konka <kubkon@jakubkonka.com>
2020-11-06 11:57:53
Address review comments
1 parent b7c3ebc
Changed files (2)
src/link/MachO.zig
@@ -726,7 +726,7 @@ fn linkWithLLD(self: *MachO, comp: *Compilation) !void {
             if (result.stderr.len != 0) {
                 std.log.warn("unexpected LD stderr: {}", .{result.stderr});
             }
-            if (result.term.Exited != 0) {
+            if (result.term != .Exited or result.term.Exited != 0) {
                 // TODO parse this output and surface with the Compilation API rather than
                 // directly outputting to stderr here.
                 std.debug.print("{}", .{result.stderr});
src/Compilation.zig
@@ -480,7 +480,7 @@ 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);
-                const system_linker_hack = if (std.os.getenv("ZIG_SYSTEM_LINKER_HACK")) |_| true else false;
+                const system_linker_hack = std.os.getenv("ZIG_SYSTEM_LINKER_HACK") != null;
                 break :inner .{
                     .syslibroot = syslibroot,
                     .system_linker_hack = system_linker_hack,