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 | 151a372113071a76bf269db67cadd2359e9b29fd (patch) | |
tree | c884ba70513bd9e1bcde7049087299a16996487c /clang/lib | |
parent | 1e1c3ca51ce9844cbc54e0458aef86f3c3f7631d (diff) | |
download | bcm5719-llvm-151a372113071a76bf269db67cadd2359e9b29fd.tar.gz bcm5719-llvm-151a372113071a76bf269db67cadd2359e9b29fd.zip |
Driver/Darwin: Transparently fallback when compiling i386 -fapple-kext code, we
don't support the ABI yet.
llvm-svn: 127903
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/ToolChains.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp index 77fc0219a64..523ff14b0a5 100644 --- a/clang/lib/Driver/ToolChains.cpp +++ b/clang/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 |