diff options
-rw-r--r-- | contrib/llvm/tools/clang/lib/Driver/Tools.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp index b37b31c..e5d6ec2 100644 --- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp +++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp @@ -2628,8 +2628,10 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-gdwarf-4"); else if (!A->getOption().matches(options::OPT_g0) && !A->getOption().matches(options::OPT_ggdb0)) { - // Default is dwarf-2 for darwin. - if (getToolChain().getTriple().isOSDarwin()) + // Default is dwarf-2 for darwin and FreeBSD <= 10. + const llvm::Triple &Triple = getToolChain().getTriple(); + if (Triple.isOSDarwin() || (Triple.getOS() == llvm::Triple::FreeBSD && + Triple.getOSMajorVersion() <= 10)) CmdArgs.push_back("-gdwarf-2"); else CmdArgs.push_back("-g"); |