diff options
author | dim <dim@FreeBSD.org> | 2014-03-29 00:25:27 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2014-03-29 00:25:27 +0000 |
commit | 3dd17d8d4af870f56d7d367ed54eb8a75325681b (patch) | |
tree | 9594be400c38740f8561f4bd4bff397458e6860b /contrib/llvm | |
parent | 0fd944851410c6e50b18f92b1f1712d60288a0db (diff) | |
download | FreeBSD-src-3dd17d8d4af870f56d7d367ed54eb8a75325681b.zip FreeBSD-src-3dd17d8d4af870f56d7d367ed54eb8a75325681b.tar.gz |
Make clang default to DWARF2 debug info format for FreeBSD 10.x and
earlier. For head, this commit does not change anything, but it is
purely meant to be MFC'd.
MFC after: 3 days
Diffstat (limited to 'contrib/llvm')
-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 423c245..35f2df1 100644 --- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp +++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp @@ -2635,8 +2635,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"); |