From 15b2bae517c54db22604eb303645d2f0023768e0 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 23 Sep 2020 09:41:55 -0700 Subject: fix trying to link libc for static libs and objects --- src/Compilation.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index f7ffc762aa..be26a400c2 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -417,7 +417,8 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation { return error.MachineCodeModelNotSupported; } - const link_libc = options.link_libc or target_util.osRequiresLibC(options.target); + const link_libc = options.link_libc or + (is_exe_or_dyn_lib and target_util.osRequiresLibC(options.target)); const must_dynamic_link = dl: { if (target_util.cannotDynamicLink(options.target)) -- cgit v1.2.3