authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-10-09 12:46:22-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-10-09 13:16:51-04:00
loge0a94db65e24c756e5e91ac1dfafa5c85035eaee
tree83593ccc3b7d3d02ab3772af0b760115f8ee97f6
parent84690ee05ecb1ee03a98c8bb62ae70e88daf23cd
signature Commit is signed but in an unrecognized format.

fix error limit linker arg on windows


1 files changed, 6 insertions(+), 1 deletions(-)

src/link.cpp+6-1
...@@ -192,6 +192,8 @@ static Buf *get_dynamic_linker_path(CodeGen *g) {...@@ -192,6 +192,8 @@ static Buf *get_dynamic_linker_path(CodeGen *g) {
192static void construct_linker_job_elf(LinkJob *lj) {192static void construct_linker_job_elf(LinkJob *lj) {
193 CodeGen *g = lj->codegen;193 CodeGen *g = lj->codegen;
194194
195 lj->args.append("-error-limit=0");
196
195 if (g->libc_link_lib != nullptr) {197 if (g->libc_link_lib != nullptr) {
196 find_libc_lib_path(g);198 find_libc_lib_path(g);
197 }199 }
...@@ -381,6 +383,7 @@ static void construct_linker_job_elf(LinkJob *lj) {...@@ -381,6 +383,7 @@ static void construct_linker_job_elf(LinkJob *lj) {
381static void construct_linker_job_wasm(LinkJob *lj) {383static void construct_linker_job_wasm(LinkJob *lj) {
382 CodeGen *g = lj->codegen;384 CodeGen *g = lj->codegen;
383385
386 lj->args.append("-error-limit=0");
384 lj->args.append("--no-entry"); // So lld doesn't look for _start.387 lj->args.append("--no-entry"); // So lld doesn't look for _start.
385 lj->args.append("-o");388 lj->args.append("-o");
386 lj->args.append(buf_ptr(&g->output_file_path));389 lj->args.append(buf_ptr(&g->output_file_path));
...@@ -419,6 +422,8 @@ static bool zig_lld_link(ZigLLVM_ObjectFormatType oformat, const char **args, si...@@ -419,6 +422,8 @@ static bool zig_lld_link(ZigLLVM_ObjectFormatType oformat, const char **args, si
419static void construct_linker_job_coff(LinkJob *lj) {422static void construct_linker_job_coff(LinkJob *lj) {
420 CodeGen *g = lj->codegen;423 CodeGen *g = lj->codegen;
421424
425 lj->args.append("/ERRORLIMIT:0");
426
422 if (g->libc_link_lib != nullptr) {427 if (g->libc_link_lib != nullptr) {
423 find_libc_lib_path(g);428 find_libc_lib_path(g);
424 }429 }
...@@ -755,6 +760,7 @@ static bool darwin_version_lt(DarwinPlatform *platform, int major, int minor) {...@@ -755,6 +760,7 @@ static bool darwin_version_lt(DarwinPlatform *platform, int major, int minor) {
755static void construct_linker_job_macho(LinkJob *lj) {760static void construct_linker_job_macho(LinkJob *lj) {
756 CodeGen *g = lj->codegen;761 CodeGen *g = lj->codegen;
757762
763 lj->args.append("-error-limit=0");
758 lj->args.append("-demangle");764 lj->args.append("-demangle");
759765
760 if (g->linker_rdynamic) {766 if (g->linker_rdynamic) {
...@@ -969,7 +975,6 @@ void codegen_link(CodeGen *g) {...@@ -969,7 +975,6 @@ void codegen_link(CodeGen *g) {
969975
970 lj.link_in_crt = (g->libc_link_lib != nullptr && g->out_type == OutTypeExe);976 lj.link_in_crt = (g->libc_link_lib != nullptr && g->out_type == OutTypeExe);
971977
972 lj.args.append("-error-limit=0");
973 construct_linker_job(&lj);978 construct_linker_job(&lj);
974979
975980