From 7b8ba871a9d14a26972caabc37aee1fb1f15006e Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 12 Jul 2019 14:44:34 -0400 Subject: mingw libc: solve the segfault having to do with destructors * fixed --verbose-cc printing an extra "zig" before the rest of the command line * windows-gnu targets use libfoo.a, foo.o extensions to match mingw conventions. --- src/codegen.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index 891e8ace92..94e2a98b2f 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -8741,10 +8741,10 @@ static void gen_root_source(CodeGen *g) { } -static void print_zig_cc_cmd(const char *zig_exe, ZigList *args) { - fprintf(stderr, "%s", zig_exe); +static void print_zig_cc_cmd(ZigList *args) { for (size_t arg_i = 0; arg_i < args->length; arg_i += 1) { - fprintf(stderr, " %s", args->at(arg_i)); + const char *space_str = (arg_i == 0) ? "" : " "; + fprintf(stderr, "%s%s", space_str, args->at(arg_i)); } fprintf(stderr, "\n"); } @@ -8882,12 +8882,12 @@ static void gen_c_object(CodeGen *g, Buf *self_exe_path, CFile *c_file) { } if (g->verbose_cc) { - print_zig_cc_cmd("zig", &args); + print_zig_cc_cmd(&args); } os_spawn_process(args, &term); if (term.how != TerminationIdClean || term.code != 0) { fprintf(stderr, "\nThe following command failed:\n"); - print_zig_cc_cmd(buf_ptr(self_exe_path), &args); + print_zig_cc_cmd(&args); exit(1); } -- cgit v1.2.3