diff options
author | Daniel Dunbar <daniel@zuster.org> | 2011-03-18 20:14:03 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2011-03-18 20:14:03 +0000 |
commit | 5ce872fdcdf868c60e91f4669b2c2925c5c2e6cc (patch) | |
tree | fb5db44e111cdd925c4d8c9991f26514ebeeede6 /lib/Driver/ToolChains.cpp | |
parent | ac0659ae4124156915eddf70e78065df224d34c8 (diff) |
Driver/Darwin: Transparently fallback when compiling i386 -fapple-kext code, we
don't support the ABI yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains.cpp')
-rw-r--r-- | lib/Driver/ToolChains.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp index 77fc0219a6..523ff14b0a 100644 --- a/lib/Driver/ToolChains.cpp +++ b/lib/Driver/ToolChains.cpp @@ -172,9 +172,18 @@ std::string Darwin::ComputeEffectiveClangTriple(const ArgList &Args) const { Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA, const ActionList &Inputs) const { Action::ActionClass Key; - if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) - Key = Action::AnalyzeJobClass; - else + + if (getDriver().ShouldUseClangCompiler(C, JA, getTriple())) { + // Fallback to llvm-gcc for i386 kext compiles, we don't support that ABI. + if (Inputs.size() == 1 && + types::isCXX(Inputs[0]->getType()) && + getTriple().getOS() == llvm::Triple::Darwin && + getTriple().getArch() == llvm::Triple::x86 && + C.getArgs().getLastArg(options::OPT_fapple_kext)) + Key = JA.getKind(); + else + Key = Action::AnalyzeJobClass; + } else Key = JA.getKind(); // FIXME: This doesn't belong here, but ideally we will support static soon |