[PATCH] D66760: clang: default to DWARF 4 for FreeBSD 12.0 and later
Ed Maste via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 26 11:03:01 PDT 2019
emaste created this revision.
emaste added reviewers: dim, bsdjhb.
Herald added subscribers: krytarowski, aprantl.
Older FreeBSD versions included GDB 6.1 and had other tools that were unable to handle debug information newer than DWARF 2. Those tools have since been updated. (An old version of GDB is still kept for kernel crash handling, but the kernel is compiled with an explicit -gdwarf2.)
https://reviews.llvm.org/D66760
Files:
clang/lib/Driver/ToolChains/FreeBSD.cpp
clang/lib/Driver/ToolChains/FreeBSD.h
Index: clang/lib/Driver/ToolChains/FreeBSD.h
===================================================================
--- clang/lib/Driver/ToolChains/FreeBSD.h
+++ clang/lib/Driver/ToolChains/FreeBSD.h
@@ -69,7 +69,7 @@
const llvm::opt::ArgList &Args) const override;
bool isPIEDefault() const override;
SanitizerMask getSupportedSanitizers() const override;
- unsigned GetDefaultDwarfVersion() const override { return 2; }
+ unsigned GetDefaultDwarfVersion() const override;
// Until dtrace (via CTF) and LLDB can deal with distributed debug info,
// FreeBSD defaults to standalone/full debug info.
bool GetDefaultStandaloneDebug() const override { return true; }
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===================================================================
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -364,6 +364,12 @@
return ToolChain::CST_Libstdcxx;
}
+unsigned FreeBSD::GetDefaultDwarfVersion() const {
+ if (getTriple().getOSMAjorVersion() < 12)
+ return 2;
+ return 4;
+}
+
void FreeBSD::addLibStdCxxIncludePaths(
const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66760.217201.patch
Type: text/x-patch
Size: 1211 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190826/8802b3b3/attachment.bin>
More information about the llvm-commits
mailing list