@@ -160,6 +160,7 @@ int os::prog_exec(std::string exe, std::vector<std::string> &args)
160160{
161161 std::vector<const char *> pargs;
162162#ifdef _WIN32
163+ auto exe_path = os::compiler_path (exe + " .exe" );
163164 // Escape any string with spaces in it:
164165 std::vector<std::string> esc_args;
165166 for (const auto &s : args)
@@ -175,8 +176,9 @@ int os::prog_exec(std::string exe, std::vector<std::string> &args)
175176 pargs.push_back (nullptr );
176177 // win32 has the "spawn" function that calls the program and waits
177178 // for termination:
178- return _spawnv (_P_WAIT, exe .c_str (), (char **)pargs.data ());
179+ return _spawnv (_P_WAIT, exe_path .c_str (), (char **)pargs.data ());
179180#else
181+ auto exe_path = os::compiler_path (exe);
180182 // Create a vector with C pointers
181183 for (const auto &s : args)
182184 pargs.push_back (s.c_str ());
@@ -205,7 +207,7 @@ int os::prog_exec(std::string exe, std::vector<std::string> &args)
205207 sigaction (SIGQUIT, &sa, nullptr );
206208 sigprocmask (SIG_SETMASK, &oldmask, nullptr );
207209 // Exec process
208- execv (exe .c_str (), (char **)pargs.data ());
210+ execv (exe_path .c_str (), (char **)pargs.data ());
209211 // If we got here, it is an error
210212 _exit (127 );
211213 }
0 commit comments