Add the llvm/clang patch for r263891.
This commit is contained in:
parent
e46fd9f9bc
commit
29084b6a92
22
contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff
Normal file
22
contrib/llvm/patches/patch-r263891-dwarf2-freebsd10.diff
Normal file
@ -0,0 +1,22 @@
|
||||
This patch makes clang default to DWARF2 debug info format for FreeBSD
|
||||
10.x and earlier.
|
||||
|
||||
Introduced here: http://svnweb.freebsd.org/changeset/base/263891
|
||||
|
||||
Index: tools/clang/lib/Driver/Tools.cpp
|
||||
===================================================================
|
||||
--- tools/clang/lib/Driver/Tools.cpp
|
||||
+++ tools/clang/lib/Driver/Tools.cpp
|
||||
@@ -2628,8 +2628,10 @@ 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 <= 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");
|
Loading…
x
Reference in New Issue
Block a user