diff options
| author | hryx <codroid@gmail.com> | 2019-06-23 12:31:22 -0700 |
|---|---|---|
| committer | hryx <codroid@gmail.com> | 2019-06-23 12:31:22 -0700 |
| commit | c423697c78462f4e817869a3b25e72af33ce09ed (patch) | |
| tree | 9fa567896dbf4c4b34ac5afc3fa2c899e8275b66 /src/libc_installation.cpp | |
| parent | 1c86a191da400bd47a5044a5b84cf9a05b15066b (diff) | |
| parent | 9153b17c922e3166a824d300781ca4e6da015787 (diff) | |
| download | zig-c423697c78462f4e817869a3b25e72af33ce09ed.tar.gz zig-c423697c78462f4e817869a3b25e72af33ce09ed.zip | |
Merge branch 'master' into translate-c-userland
Diffstat (limited to 'src/libc_installation.cpp')
| -rw-r--r-- | src/libc_installation.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libc_installation.cpp b/src/libc_installation.cpp index d1773b89e7..135941dc40 100644 --- a/src/libc_installation.cpp +++ b/src/libc_installation.cpp @@ -153,6 +153,7 @@ static Error zig_libc_find_native_include_dir_posix(ZigLibCInstallation *self, b const char *cc_exe = getenv("CC"); cc_exe = (cc_exe == nullptr) ? CC_EXE : cc_exe; ZigList<const char *> args = {}; + args.append(cc_exe); args.append("-E"); args.append("-Wp,-v"); args.append("-xc"); @@ -166,7 +167,7 @@ static Error zig_libc_find_native_include_dir_posix(ZigLibCInstallation *self, b Buf *out_stderr = buf_alloc(); Buf *out_stdout = buf_alloc(); Error err; - if ((err = os_exec_process(cc_exe, args, &term, out_stderr, out_stdout))) { + if ((err = os_exec_process(args, &term, out_stderr, out_stdout))) { if (verbose) { fprintf(stderr, "unable to determine libc include path: executing '%s': %s\n", cc_exe, err_str(err)); } @@ -277,12 +278,13 @@ Error zig_libc_cc_print_file_name(const char *o_file, Buf *out, bool want_dirnam const char *cc_exe = getenv("CC"); cc_exe = (cc_exe == nullptr) ? CC_EXE : cc_exe; ZigList<const char *> args = {}; + args.append(cc_exe); args.append(buf_ptr(buf_sprintf("-print-file-name=%s", o_file))); Termination term; Buf *out_stderr = buf_alloc(); Buf *out_stdout = buf_alloc(); Error err; - if ((err = os_exec_process(cc_exe, args, &term, out_stderr, out_stdout))) { + if ((err = os_exec_process(args, &term, out_stderr, out_stdout))) { if (err == ErrorFileNotFound) return ErrorNoCCompilerInstalled; if (verbose) { |
