authorgravatar for ryan.saunderson88@gmail.comdimenus <ryan.saunderson88@gmail.com> 2019-07-10 11:40:20-05:00
committergravatar for ryan.saunderson88@gmail.comdimenus <ryan.saunderson88@gmail.com> 2019-07-10 11:40:20-05:00
loge9331dc5cf90fe0fff5258debc424ad0514507a2
tree78a63063d24450b2f5616cf7109162d801366328
parentae2345b742053a84e1f64f92b76202702ac872d9

resolved #2064 & fixed hello_world libc build


1 files changed, 8 insertions(+), 4 deletions(-)

src/link.cpp+8-4
......@@ -1139,8 +1139,7 @@ static void add_uefi_link_args(LinkJob *lj) {
11391139static void add_msvc_link_args(LinkJob *lj, bool is_library) {
11401140 CodeGen *g = lj->codegen;
11411141
1142 // TODO: https://github.com/ziglang/zig/issues/2064
1143 bool is_dynamic = true; // g->is_dynamic;
1142 bool is_dynamic = g->is_dynamic;
11441143 const char *lib_str = is_dynamic ? "" : "lib";
11451144 const char *d_str = (g->build_mode == BuildModeDebug) ? "d" : "";
11461145
......@@ -1360,9 +1359,15 @@ static void construct_linker_job_coff(LinkJob *lj) {
13601359 Buf *lib_name = buf_sprintf("lib%s.a", buf_ptr(link_lib->name));
13611360 lj->args.append(buf_ptr(lib_name));
13621361 } 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));
13641364 }
13651365 } 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
13661371 buf_resize(def_contents, 0);
13671372 buf_appendf(def_contents, "LIBRARY %s\nEXPORTS\n", buf_ptr(link_lib->name));
13681373 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) {
13951400 lj->args.append(buf_ptr(generated_lib_path));
13961401 }
13971402 }
1398
13991403}
14001404
14011405