| author | |
| committer | |
| log | 46ddeb0bafd68cf88867e4268253a41ac0050215 |
| tree | 41f05646aa4707ee86df9d33b7c3c2ab3d5cf3ca |
| parent | 10ad3253de4dad4675fbd84da874f2cd73cd2deb |
only prints the link line3 files changed, 11 insertions(+), 4 deletions(-)
src/all_types.hpp+1| ... | ... | @@ -1508,6 +1508,7 @@ struct CodeGen { |
| 1508 | 1508 | size_t version_minor; |
| 1509 | 1509 | size_t version_patch; |
| 1510 | 1510 | bool verbose; |
| 1511 | bool verbose_link; | |
| 1511 | 1512 | ErrColor err_color; |
| 1512 | 1513 | ImportTableEntry *root_import; |
| 1513 | 1514 | ImportTableEntry *bootstrap_import; |
src/link.cpp+5-4| ... | ... | @@ -37,6 +37,7 @@ static Buf *build_o_raw(CodeGen *parent_gen, const char *oname, Buf *full_path) |
| 37 | 37 | |
| 38 | 38 | codegen_set_omit_zigrt(child_gen, true); |
| 39 | 39 | child_gen->want_h_file = false; |
| 40 | child_gen->verbose_link = parent_gen->verbose_link; | |
| 40 | 41 | |
| 41 | 42 | codegen_set_cache_dir(child_gen, parent_gen->cache_dir); |
| 42 | 43 | |
| ... | ... | @@ -816,7 +817,7 @@ void codegen_link(CodeGen *g, const char *out_file) { |
| 816 | 817 | fprintf(stderr, "---------------\n"); |
| 817 | 818 | LLVMDumpModule(g->module); |
| 818 | 819 | } |
| 819 | if (g->verbose) { | |
| 820 | if (g->verbose || g->verbose_link) { | |
| 820 | 821 | fprintf(stderr, "\nLink:\n"); |
| 821 | 822 | fprintf(stderr, "-------\n"); |
| 822 | 823 | } |
| ... | ... | @@ -840,7 +841,7 @@ void codegen_link(CodeGen *g, const char *out_file) { |
| 840 | 841 | zig_panic("unable to rename object file into final output: %s", err_str(err)); |
| 841 | 842 | } |
| 842 | 843 | } |
| 843 | if (g->verbose) { | |
| 844 | if (g->verbose || g->verbose_link) { | |
| 844 | 845 | fprintf(stderr, "OK\n"); |
| 845 | 846 | } |
| 846 | 847 | return; |
| ... | ... | @@ -860,7 +861,7 @@ void codegen_link(CodeGen *g, const char *out_file) { |
| 860 | 861 | construct_linker_job(&lj); |
| 861 | 862 | |
| 862 | 863 | |
| 863 | if (g->verbose) { | |
| 864 | if (g->verbose || g->verbose_link) { | |
| 864 | 865 | for (size_t i = 0; i < lj.args.length; i += 1) { |
| 865 | 866 | const char *space = (i != 0) ? " " : ""; |
| 866 | 867 | fprintf(stderr, "%s%s", space, lj.args.at(i)); |
| ... | ... | @@ -878,7 +879,7 @@ void codegen_link(CodeGen *g, const char *out_file) { |
| 878 | 879 | |
| 879 | 880 | codegen_add_time_event(g, "Done"); |
| 880 | 881 | |
| 881 | if (g->verbose) { | |
| 882 | if (g->verbose || g->verbose_link) { | |
| 882 | 883 | fprintf(stderr, "OK\n"); |
| 883 | 884 | } |
| 884 | 885 | } |
src/main.cpp+5| ... | ... | @@ -47,6 +47,7 @@ static int usage(const char *arg0) { |
| 47 | 47 | " --target-environ [name] specify target environment\n" |
| 48 | 48 | " --target-os [name] specify target operating system\n" |
| 49 | 49 | " --verbose turn on compiler debug output\n" |
| 50 | " --verbose-link turn on compiler debug output for linking only\n" | |
| 50 | 51 | " --zig-std-dir [path] directory where zig standard library resides\n" |
| 51 | 52 | " -dirafter [dir] same as -isystem but do it last\n" |
| 52 | 53 | " -isystem [dir] add additional search path for other .h files\n" |
| ... | ... | @@ -184,6 +185,7 @@ int main(int argc, char **argv) { |
| 184 | 185 | OutType out_type = OutTypeUnknown; |
| 185 | 186 | const char *out_name = nullptr; |
| 186 | 187 | bool verbose = false; |
| 188 | bool verbose_link = false; | |
| 187 | 189 | ErrColor color = ErrColorAuto; |
| 188 | 190 | const char *libc_lib_dir = nullptr; |
| 189 | 191 | const char *libc_static_lib_dir = nullptr; |
| ... | ... | @@ -348,6 +350,8 @@ int main(int argc, char **argv) { |
| 348 | 350 | is_static = true; |
| 349 | 351 | } else if (strcmp(arg, "--verbose") == 0) { |
| 350 | 352 | verbose = true; |
| 353 | } else if (strcmp(arg, "--verbose-link") == 0) { | |
| 354 | verbose_link = true; | |
| 351 | 355 | } else if (strcmp(arg, "-mwindows") == 0) { |
| 352 | 356 | mwindows = true; |
| 353 | 357 | } else if (strcmp(arg, "-mconsole") == 0) { |
| ... | ... | @@ -625,6 +629,7 @@ int main(int argc, char **argv) { |
| 625 | 629 | if (dynamic_linker) |
| 626 | 630 | codegen_set_dynamic_linker(g, buf_create_from_str(dynamic_linker)); |
| 627 | 631 | codegen_set_verbose(g, verbose); |
| 632 | g->verbose_link = verbose_link; | |
| 628 | 633 | codegen_set_errmsg_color(g, color); |
| 629 | 634 | |
| 630 | 635 | for (size_t i = 0; i < lib_dirs.length; i += 1) { |