@@ -1139,8 +1139,7 @@ static void add_uefi_link_args(LinkJob *lj) {
1139
1139
static void add_msvc_link_args (LinkJob *lj, bool is_library) {
1140
1140
CodeGen *g = lj->codegen ;
1141
1141
1142
- // TODO: https://github.com/ziglang/zig/issues/2064
1143
- bool is_dynamic = true ; // g->is_dynamic;
1142
+ bool is_dynamic = g->is_dynamic ;
1144
1143
const char *lib_str = is_dynamic ? " " : " lib" ;
1145
1144
const char *d_str = (g->build_mode == BuildModeDebug) ? " d" : " " ;
1146
1145
@@ -1360,9 +1359,15 @@ static void construct_linker_job_coff(LinkJob *lj) {
1360
1359
Buf *lib_name = buf_sprintf (" lib%s.a" , buf_ptr (link_lib->name ));
1361
1360
lj->args .append (buf_ptr (lib_name));
1362
1361
} else {
1363
- lj->args .append (buf_ptr (link_lib->name ));
1362
+ Buf* lib_name = buf_sprintf (" %s.lib" , buf_ptr (link_lib->name ));
1363
+ lj->args .append (buf_ptr (lib_name));
1364
1364
}
1365
1365
} else {
1366
+ // note(dimenus): If we're linking in the CRT we need to link in existing system librarys not generate def/libs
1367
+ if (lj->link_in_crt ) {
1368
+ continue ;
1369
+ }
1370
+
1366
1371
buf_resize (def_contents, 0 );
1367
1372
buf_appendf (def_contents, " LIBRARY %s\n EXPORTS\n " , buf_ptr (link_lib->name ));
1368
1373
for (size_t exp_i = 0 ; exp_i < link_lib->symbols .length ; exp_i += 1 ) {
@@ -1395,7 +1400,6 @@ static void construct_linker_job_coff(LinkJob *lj) {
1395
1400
lj->args .append (buf_ptr (generated_lib_path));
1396
1401
}
1397
1402
}
1398
-
1399
1403
}
1400
1404
1401
1405
0 commit comments