aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig
index 3eeaa9ca2a..13ee04765c 100644
--- a/src/Compilation.zig
+++ b/src/Compilation.zig
@@ -3174,6 +3174,11 @@ pub fn build_crt_file(
}
pub fn stage1AddLinkLib(comp: *Compilation, lib_name: []const u8) !void {
+ // Avoid deadlocking on building import libs such as kernel32.lib
+ // This can happen when the user uses `build-exe foo.obj -lkernel32` and then
+ // when we create a sub-Compilation for zig libc, it also tries to build kernel32.lib.
+ if (comp.bin_file.options.is_compiler_rt_or_libc) return;
+
// This happens when an `extern "foo"` function is referenced by the stage1 backend.
// If we haven't seen this library yet and we're targeting Windows, we need to queue up
// a work item to produce the DLL import library for this.