From a53becc034fc9447843286d140780e25d29c07d4 Mon Sep 17 00:00:00 2001 From: Matt Knight Date: Sun, 7 Nov 2021 10:28:25 -0800 Subject: [PATCH] don't invoke linker when just building an object --- src/link.zig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/link.zig b/src/link.zig index 762c6f9212..66330ae9b0 100644 --- a/src/link.zig +++ b/src/link.zig @@ -474,6 +474,10 @@ pub const File = struct { try fs.cwd().copyFile(cached_pp_file_path, fs.cwd(), full_out_path, .{}); return; } + + if (base.options.output_mode == .Obj) + return; + const use_lld = build_options.have_llvm and base.options.use_lld; if (use_lld and base.options.output_mode == .Lib and base.options.link_mode == .Static) { return base.linkAsArchive(comp);