| ... | @@ -435,10 +435,13 @@ static void construct_linker_job_coff(LinkJob *lj) { | ... | @@ -435,10 +435,13 @@ static void construct_linker_job_coff(LinkJob *lj) { |
| 435 | lj->args.append((const char *)buf_ptr(g->link_objects.at(i))); | 435 | lj->args.append((const char *)buf_ptr(g->link_objects.at(i))); |
| 436 | } | 436 | } |
| 437 | | 437 | |
| 438 | if (g->libc_link_lib == nullptr && (g->out_type == OutTypeExe || g->out_type == OutTypeLib)) { | 438 | if (g->out_type == OutTypeExe || g->out_type == OutTypeLib) { |
| 439 | Buf *builtin_o_path = build_o(g, "builtin"); | 439 | if (g->libc_link_lib == nullptr) { |
| 440 | lj->args.append(buf_ptr(builtin_o_path)); | 440 | Buf *builtin_o_path = build_o(g, "builtin"); |
| | 441 | lj->args.append(buf_ptr(builtin_o_path)); |
| | 442 | } |
| 441 | | 443 | |
| | 444 | // msvc compiler_rt is missing some stuff, so we still build it and rely on LinkOnce |
| 442 | Buf *compiler_rt_o_path = build_compiler_rt(g); | 445 | Buf *compiler_rt_o_path = build_compiler_rt(g); |
| 443 | lj->args.append(buf_ptr(compiler_rt_o_path)); | 446 | lj->args.append(buf_ptr(compiler_rt_o_path)); |
| 444 | } | 447 | } |