From 0379d7b4317e7e12d27b66f8a44a443d328ce539 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 13 Sep 2020 23:04:15 -0700 Subject: [PATCH] stage2: don't bother building glibc when only doing build-obj --- src-self-hosted/Compilation.zig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src-self-hosted/Compilation.zig b/src-self-hosted/Compilation.zig index a3a99aee6f..82d8b0d5a0 100644 --- a/src-self-hosted/Compilation.zig +++ b/src-self-hosted/Compilation.zig @@ -1548,7 +1548,12 @@ fn addBuildingGLibCWorkItems(comp: *Compilation) !void { } fn wantBuildGLibCFromSource(comp: *Compilation) bool { - return comp.bin_file.options.link_libc and + const is_exe_or_dyn_lib = switch (comp.bin_file.options.output_mode) { + .Obj => false, + .Lib => comp.bin_file.options.link_mode == .Dynamic, + .Exe => true, + }; + return comp.bin_file.options.link_libc and is_exe_or_dyn_lib and comp.bin_file.options.libc_installation == null and comp.bin_file.options.target.isGnuLibC(); }