diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 7ca8748dbf8c3f4b11a60899e9a1afa4707fa644..c83f72328c77f82353b48f182dbdfbe8557bff8f 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -2192,7 +2192,8 @@ const TransitiveDeps = struct { if ((try td.seen_steps.fetchPut(&inner_other.step, {})) != null) continue; - if (!dyn) + const included_in_lib = (other.kind == .lib and inner_other.kind == .obj); + if (!dyn and !included_in_lib) try td.link_objects.append(other_link_object); try addInner(td, inner_other, dyn or inner_other.isDynamicLibrary());