From 1dc7764f2ddc2f3bd78f96017fd2dd2227280055 Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Mon, 24 May 2021 02:29:22 -0400 Subject: [PATCH] clang driver: fix lost argv[0] --- src/zig_clang_driver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/zig_clang_driver.cpp b/src/zig_clang_driver.cpp index ac892f95e8..468c437a7d 100644 --- a/src/zig_clang_driver.cpp +++ b/src/zig_clang_driver.cpp @@ -448,7 +448,9 @@ int ZigClang_main(int argc_, const char **argv_) { ApplyQAOverride(argv, OverrideStr, SavedStrings); } - std::string Path = GetExecutablePath(argv[0], CanonicalPrefixes); + // Pass local param `argv_[0]` as fallback. + // See https://github.com/ziglang/zig/pull/3292 . + std::string Path = GetExecutablePath(argv_[0], CanonicalPrefixes); // Whether the cc1 tool should be called inside the current process, or if we // should spawn a new clang subprocess (old behavior).