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.)
Reviewed by: dim
Differential Revision: https://reviews.llvm.org/D66760
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370779
91177308-0d34-0410-b5e6-
96231b3b80d8
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 {
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; }
// RUN: -check-prefix=G_DWARF4 %s
// FreeBSD.
-// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd10.0 2>&1 \
-// RUN: | FileCheck -check-prefix=G_GDB %s
+// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd11.0 2>&1 \
+// RUN: | FileCheck -check-prefix=G_GDB \
+// RUN: -check-prefix=G_DWARF2 %s
+// RUN: %clang -### -c -g %s -target x86_64-pc-freebsd12.0 2>&1 \
+// RUN: | FileCheck -check-prefix=G_GDB \
+// RUN: -check-prefix=G_DWARF4 %s
// Windows.
// RUN: %clang -### -c -g %s -target x86_64-w64-windows-gnu 2>&1 \