Preserve split DWARF files when building archives.
The optimization that removes artifacts when building libraries is correct from the compiler's perspective but not from a debugger's perspective. Unpacked split debuginfo is referred to by filename and debuggers need the artifact that contains debuginfo to continue to exist at that path. Ironically the test expects the correct behavior but it was not running.
This commit is contained in:
@@ -1300,12 +1300,6 @@ fn preserve_objects_for_their_debuginfo(sess: &Session) -> (bool, bool) {
|
||||
return (false, false);
|
||||
}
|
||||
|
||||
// If we're only producing artifacts that are archives, no need to preserve
|
||||
// the objects as they're losslessly contained inside the archives.
|
||||
if sess.crate_types().iter().all(|&x| x.is_archive()) {
|
||||
return (false, false);
|
||||
}
|
||||
|
||||
match (sess.split_debuginfo(), sess.opts.unstable_opts.split_dwarf_kind) {
|
||||
// If there is no split debuginfo then do not preserve objects.
|
||||
(SplitDebuginfo::Off, _) => (false, false),
|
||||
|
||||
Reference in New Issue
Block a user