21 lines
924 B
Diff
21 lines
924 B
Diff
This patch makes clang default to DWARF2 debug info format for FreeBSD.
|
|
|
|
Introduced here: http://svnweb.freebsd.org/changeset/base/264345
|
|
|
|
Index: tools/clang/lib/Driver/Tools.cpp
|
|
===================================================================
|
|
--- tools/clang/lib/Driver/Tools.cpp
|
|
+++ tools/clang/lib/Driver/Tools.cpp
|
|
@@ -2627,8 +2635,9 @@ void Clang::ConstructJob(Compilation &C, const Job
|
|
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.
|
|
+ const llvm::Triple &Triple = getToolChain().getTriple();
|
|
+ if (Triple.isOSDarwin() || Triple.getOS() == llvm::Triple::FreeBSD)
|
|
CmdArgs.push_back("-gdwarf-2");
|
|
else
|
|
CmdArgs.push_back("-g");
|