diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-06-19 19:01:28 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-06-19 19:01:28 -0400 |
| commit | 04c25efe112e374facaf1bc8b58bbdb6999a39e3 (patch) | |
| tree | 66a70b185ad8e44a69c8be27dd7dbc23425b040c /src/libc_installation.cpp | |
| parent | 4ffab5b85f03f63a7e724698482f8497cacc7212 (diff) | |
| parent | 381c6a38b145665a22440f7aa816f0ddd9b70ee5 (diff) | |
| download | zig-04c25efe112e374facaf1bc8b58bbdb6999a39e3.tar.gz zig-04c25efe112e374facaf1bc8b58bbdb6999a39e3.zip | |
Merge remote-tracking branch 'origin/master' into copy-elision-3
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) { |
