]> git.lizzy.rs Git - rust.git/commitdiff
debuginfo: Clamp the maximum dwarf version to 3
authorAlex Crichton <alex@alexcrichton.com>
Fri, 18 Apr 2014 23:54:38 +0000 (16:54 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 18 Apr 2014 23:54:38 +0000 (16:54 -0700)
This is a consequence of #13611 and our bots running a "fairly old" gdb which
doesn't understand the newer versions of dwarf.

src/librustc/middle/trans/debuginfo.rs

index fd6a465eabb22611180e6fb226a6920b458550d2..d6dd0213128a5bbdf9a1763605c77e3ed0aed81c 100644 (file)
@@ -279,6 +279,12 @@ pub fn finalize(cx: &CrateContext) {
         if cx.sess().targ_cfg.os == abi::OsMacos {
             "Dwarf Version".with_c_str(
                 |s| llvm::LLVMRustAddModuleFlag(cx.llmod, s, 2));
+        } else {
+            // FIXME(#13611) this is a kludge fix because the linux bots have
+            //               gdb 7.4 which doesn't understand dwarf4, we should
+            //               do something more graceful here.
+            "Dwarf Version".with_c_str(
+                |s| llvm::LLVMRustAddModuleFlag(cx.llmod, s, 3));
         }
 
         // Prevent bitcode readers from deleting the debug info.