diff options
author | David Chisnall <csdavec@swan.ac.uk> | 2011-09-27 22:03:18 +0000 |
---|---|---|
committer | David Chisnall <csdavec@swan.ac.uk> | 2011-09-27 22:03:18 +0000 |
commit | 5adcec16cb8d9e7bebf310b6c07249dfd852346b (patch) | |
tree | e15e56e05353afea624f7f1b6be1b7306afb49bb /lib/Driver/Tools.cpp | |
parent | c1c0dfb376b829b94d4c61e9f358ce23e6aa3169 (diff) |
Check for GCC paths that have the target triple in them. This is required for a lot of cross-compile toolchains. Also add some slightly better support for -B.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 8fafbee30d..e9c6df10ef 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -47,18 +47,6 @@ using namespace clang::driver; using namespace clang::driver::tools; using namespace clang; -/// FindTargetProgramPath - Return path of the target specific version of -/// ProgName. If it doesn't exist, return path of ProgName itself. -static std::string FindTargetProgramPath(const ToolChain &TheToolChain, - const std::string TripleString, - const char *ProgName) { - std::string Executable(TripleString + "-" + ProgName); - std::string Path(TheToolChain.GetProgramPath(Executable.c_str())); - if (Path != Executable) - return Path; - return TheToolChain.GetProgramPath(ProgName); -} - /// CheckPreprocessingOptions - Perform some validation of preprocessing /// arguments that is shared with gcc. static void CheckPreprocessingOptions(const Driver &D, const ArgList &Args) { @@ -4090,9 +4078,7 @@ void netbsd::Assemble::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(II.getFilename()); } - const char *Exec = Args.MakeArgString(FindTargetProgramPath(getToolChain(), - ToolTriple.getTriple(), - "as")); + const char *Exec = Args.MakeArgString((getToolChain().GetProgramPath("as"))); C.addCommand(new Command(JA, *this, Exec, CmdArgs)); } @@ -4208,9 +4194,7 @@ void netbsd::Link::ConstructJob(Compilation &C, const JobAction &JA, addProfileRT(getToolChain(), Args, CmdArgs, getToolChain().getTriple()); - const char *Exec = Args.MakeArgString(FindTargetProgramPath(getToolChain(), - ToolTriple.getTriple(), - "ld")); + const char *Exec = Args.MakeArgString(getToolChain().GetProgramPath("ld")); C.addCommand(new Command(JA, *this, Exec, CmdArgs)); } |