For remote execution, must cd to the executable directory since the exe expects to...
authorDavid Goodwin <david_goodwin@apple.com>
Mon, 20 Jul 2009 17:15:03 +0000 (17:15 +0000)
committerDavid Goodwin <david_goodwin@apple.com>
Mon, 20 Jul 2009 17:15:03 +0000 (17:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76432 91177308-0d34-0410-b5e6-96231b3b80d8

tools/bugpoint/ToolRunner.cpp

index e6db42a08bdc2072b636e47514d83e5689b7d482..ef07079af309f84ac5ce7df676681c30e06fb1cc 100644 (file)
@@ -688,7 +688,6 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
 
   std::vector<const char*> ProgramArgs;
 
-  std::string Exec;
   if (RemoteClientPath.isEmpty())
     ProgramArgs.push_back(OutputBinary.c_str());
   else {
@@ -704,10 +703,12 @@ int GCC::ExecuteProgram(const std::string &ProgramFile,
       ProgramArgs.push_back(RemoteExtra.c_str());
     }
 
-    // Full path to the binary
+    // Full path to the binary. We need to cd to the exec directory because
+    // there is a dylib there that the exec expects to find in the CWD
     char* env_pwd = getenv("PWD");
+    std::string Exec = "cd ";
     Exec += env_pwd;
-    Exec += "/";
+    Exec += "; ./";
     Exec += OutputBinary.c_str();
     ProgramArgs.push_back(Exec.c_str());
   }