diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index eac72ee65a74..d4e8e93e2aa6 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -74,6 +74,10 @@ Darwin_X86::Darwin_X86(const HostInfo &Host, const char *Arch, Path += getToolChainDir(); getProgramPaths().push_back(Path); + Path = getHost().getDriver().Dir; + Path += "/../libexec"; + getProgramPaths().push_back(Path); + getProgramPaths().push_back(getHost().getDriver().Dir); } @@ -151,6 +155,10 @@ Generic_GCC::Generic_GCC(const HostInfo &Host, const char *Arch, const char *Platform, const char *OS) : ToolChain(Host, Arch, Platform, OS) { + std::string Path(getHost().getDriver().Dir); + Path += "/../libexec"; + getProgramPaths().push_back(Path); + getProgramPaths().push_back(getHost().getDriver().Dir); } diff --git a/clang/tools/ccc/ccclib/ToolChain.py b/clang/tools/ccc/ccclib/ToolChain.py index 5e6f2e05c098..be949e70343a 100644 --- a/clang/tools/ccc/ccclib/ToolChain.py +++ b/clang/tools/ccc/ccclib/ToolChain.py @@ -139,6 +139,8 @@ class Darwin_X86_ToolChain(ToolChain): self.getToolChainDir())) self.programPathPrefixes.append(os.path.join('/usr/libexec/gcc', self.getToolChainDir())) + self.programPathPrefixes.append(os.path.join(self.driver.driverDir, + '../libexec')) self.programPathPrefixes.append(self.driver.driverDir) def getToolChainDir(self): @@ -262,6 +264,8 @@ class Generic_GCC_ToolChain(ToolChain): Phases.AssemblePhase : Tools.GCC_AssembleTool(self), Phases.LinkPhase : Tools.GCC_LinkTool(self), } + self.programPathPrefixes.append(os.path.join(self.driver.driverDir, + '../libexec')) self.programPathPrefixes.append(self.driver.driverDir) def selectTool(self, action): diff --git a/clang/tools/clang-cc/Makefile b/clang/tools/clang-cc/Makefile index 4539665d2e86..d86ce7efbd65 100644 --- a/clang/tools/clang-cc/Makefile +++ b/clang/tools/clang-cc/Makefile @@ -25,4 +25,8 @@ USEDLIBS = clangCodeGen.a clangAnalysis.a clangRewrite.a clangSema.a \ clangFrontend.a clangAST.a clangParse.a clangLex.a \ clangBasic.a +# clang-cc lives in a special location; we can get away with this +# because nothing else gets installed from here. +PROJ_bindir := $(DESTDIR)$(PROJ_prefix)/libexec + include $(LLVM_SRC_ROOT)/Makefile.rules