Skip to content

Commit

Permalink
Generate an older version of dwarf on OSX
Browse files Browse the repository at this point in the history
OSX apparently doesn't have tooling which understands higher versions of dwarf
by default right now.

Closes rust-lang#11352
  • Loading branch information
alexcrichton committed Jan 27, 2014
1 parent b0280ac commit 64e5527
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/librustc/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,14 @@ pub mod write {
if sess.time_llvm_passes() { add("-time-passes"); }
if sess.print_llvm_passes() { add("-debug-pass=Structure"); }

// Debuginfo generation in LLVM by default uses a higher version of
// dwarf than osx currently understands. We can instruct LLVM to emit an
// older version of dwarf, however, for OSX to understand. For more info
// see #11352
if sess.targ_cfg.os == abi::OsMacos && sess.opts.debuginfo {
add("-dwarf-version,2");
}

for arg in sess.opts.llvm_args.iter() {
add(*arg);
}
Expand Down

1 comment on commit 64e5527

@pcwalton
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.