fix trying to link libc for static libs and objects

This commit is contained in:
Andrew Kelley 2020-09-23 09:41:55 -07:00
parent 800a4a6ceb
commit 15b2bae517

View File

@ -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))