diff options
| author | David Chisnall <csdavec@swan.ac.uk> | 2012-02-15 13:39:01 +0000 |
|---|---|---|
| committer | David Chisnall <csdavec@swan.ac.uk> | 2012-02-15 13:39:01 +0000 |
| commit | f571cde869642f45a050b497c80d9d08de7eec5e (patch) | |
| tree | 6fdad8c6693039f7bdadbd2b7f6be8e90a600421 /clang/lib/Driver/ToolChains.cpp | |
| parent | 7bde8587058e7b2d812f719b20d9c79d0f8161b6 (diff) | |
| download | bcm5719-llvm-f571cde869642f45a050b497c80d9d08de7eec5e.tar.gz bcm5719-llvm-f571cde869642f45a050b497c80d9d08de7eec5e.zip | |
First pass at Solaris toolchain support. This version compiles and links hello
world on Solaris 11 for both x86 and x86-64 using the built-in assembler and
Solaris (not GNU) ld, however it currently relies on a hard-coded GCC location
to find crtbegin.o and crtend.o, as well as libgcc and libgcc_eh.
llvm-svn: 150580
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
| -rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 703c7aa3d52..2a5bdbc553d 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/lib/Driver/ToolChains.cpp @@ -1755,6 +1755,41 @@ Tool &AuroraUX::SelectTool(const Compilation &C, const JobAction &JA, return *T; } +/// Solaris - Solaris tool chain which can call as(1) and ld(1) directly. + +Solaris::Solaris(const Driver &D, const llvm::Triple& Triple) + : Generic_GCC(D, Triple) { + + getProgramPaths().push_back(getDriver().getInstalledDir()); + if (getDriver().getInstalledDir() != getDriver().Dir) + getProgramPaths().push_back(getDriver().Dir); + + getFilePaths().push_back(getDriver().Dir + "/../lib"); + getFilePaths().push_back("/usr/lib"); +} + +Tool &Solaris::SelectTool(const Compilation &C, const JobAction &JA, + const ActionList &Inputs) const { + Action::ActionClass Key; + if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) + Key = Action::AnalyzeJobClass; + else + Key = JA.getKind(); + + Tool *&T = Tools[Key]; + if (!T) { + switch (Key) { + case Action::AssembleJobClass: + T = new tools::solaris::Assemble(*this); break; + case Action::LinkJobClass: + T = new tools::solaris::Link(*this); break; + default: + T = &Generic_GCC::SelectTool(C, JA, Inputs); + } + } + + return *T; +} /// Linux toolchain (very bare-bones at the moment). |

