aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-09-23 09:41:55 -0700
committerAndrew Kelley <andrew@ziglang.org>2020-09-23 09:41:55 -0700
commit15b2bae517c54db22604eb303645d2f0023768e0 (patch)
treeabf748223f710441c0baa15269511ce13736e662 /src
parent800a4a6cebf363c8ba3d1fcfff55db8bfb71f731 (diff)
downloadzig-15b2bae517c54db22604eb303645d2f0023768e0.tar.gz
zig-15b2bae517c54db22604eb303645d2f0023768e0.zip
fix trying to link libc for static libs and objects
Diffstat (limited to 'src')
-rw-r--r--src/Compilation.zig3
1 files changed, 2 insertions, 1 deletions
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))