add --verbose-link option
only prints the link line
This commit is contained in:
parent
10ad3253de
commit
46ddeb0baf
|
@ -1508,6 +1508,7 @@ struct CodeGen {
|
|||
size_t version_minor;
|
||||
size_t version_patch;
|
||||
bool verbose;
|
||||
bool verbose_link;
|
||||
ErrColor err_color;
|
||||
ImportTableEntry *root_import;
|
||||
ImportTableEntry *bootstrap_import;
|
||||
|
|
|
@ -37,6 +37,7 @@ static Buf *build_o_raw(CodeGen *parent_gen, const char *oname, Buf *full_path)
|
|||
|
||||
codegen_set_omit_zigrt(child_gen, true);
|
||||
child_gen->want_h_file = false;
|
||||
child_gen->verbose_link = parent_gen->verbose_link;
|
||||
|
||||
codegen_set_cache_dir(child_gen, parent_gen->cache_dir);
|
||||
|
||||
|
@ -816,7 +817,7 @@ void codegen_link(CodeGen *g, const char *out_file) {
|
|||
fprintf(stderr, "---------------\n");
|
||||
LLVMDumpModule(g->module);
|
||||
}
|
||||
if (g->verbose) {
|
||||
if (g->verbose || g->verbose_link) {
|
||||
fprintf(stderr, "\nLink:\n");
|
||||
fprintf(stderr, "-------\n");
|
||||
}
|
||||
|
@ -840,7 +841,7 @@ void codegen_link(CodeGen *g, const char *out_file) {
|
|||
zig_panic("unable to rename object file into final output: %s", err_str(err));
|
||||
}
|
||||
}
|
||||
if (g->verbose) {
|
||||
if (g->verbose || g->verbose_link) {
|
||||
fprintf(stderr, "OK\n");
|
||||
}
|
||||
return;
|
||||
|
@ -860,7 +861,7 @@ void codegen_link(CodeGen *g, const char *out_file) {
|
|||
construct_linker_job(&lj);
|
||||
|
||||
|
||||
if (g->verbose) {
|
||||
if (g->verbose || g->verbose_link) {
|
||||
for (size_t i = 0; i < lj.args.length; i += 1) {
|
||||
const char *space = (i != 0) ? " " : "";
|
||||
fprintf(stderr, "%s%s", space, lj.args.at(i));
|
||||
|
@ -878,7 +879,7 @@ void codegen_link(CodeGen *g, const char *out_file) {
|
|||
|
||||
codegen_add_time_event(g, "Done");
|
||||
|
||||
if (g->verbose) {
|
||||
if (g->verbose || g->verbose_link) {
|
||||
fprintf(stderr, "OK\n");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,7 @@ static int usage(const char *arg0) {
|
|||
" --target-environ [name] specify target environment\n"
|
||||
" --target-os [name] specify target operating system\n"
|
||||
" --verbose turn on compiler debug output\n"
|
||||
" --verbose-link turn on compiler debug output for linking only\n"
|
||||
" --zig-std-dir [path] directory where zig standard library resides\n"
|
||||
" -dirafter [dir] same as -isystem but do it last\n"
|
||||
" -isystem [dir] add additional search path for other .h files\n"
|
||||
|
@ -184,6 +185,7 @@ int main(int argc, char **argv) {
|
|||
OutType out_type = OutTypeUnknown;
|
||||
const char *out_name = nullptr;
|
||||
bool verbose = false;
|
||||
bool verbose_link = false;
|
||||
ErrColor color = ErrColorAuto;
|
||||
const char *libc_lib_dir = nullptr;
|
||||
const char *libc_static_lib_dir = nullptr;
|
||||
|
@ -348,6 +350,8 @@ int main(int argc, char **argv) {
|
|||
is_static = true;
|
||||
} else if (strcmp(arg, "--verbose") == 0) {
|
||||
verbose = true;
|
||||
} else if (strcmp(arg, "--verbose-link") == 0) {
|
||||
verbose_link = true;
|
||||
} else if (strcmp(arg, "-mwindows") == 0) {
|
||||
mwindows = true;
|
||||
} else if (strcmp(arg, "-mconsole") == 0) {
|
||||
|
@ -625,6 +629,7 @@ int main(int argc, char **argv) {
|
|||
if (dynamic_linker)
|
||||
codegen_set_dynamic_linker(g, buf_create_from_str(dynamic_linker));
|
||||
codegen_set_verbose(g, verbose);
|
||||
g->verbose_link = verbose_link;
|
||||
codegen_set_errmsg_color(g, color);
|
||||
|
||||
for (size_t i = 0; i < lib_dirs.length; i += 1) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user