Skip to content

Commit 1b442be

Browse files
authored
Rollup merge of #106904 - khuey:preserve_debuginfo_for_rlibs, r=davidtwco
Preserve split DWARF files when building archives. r? ```@davidtwco```
2 parents 40fda7b + 2b99b9f commit 1b442be

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1301,12 +1301,6 @@ fn preserve_objects_for_their_debuginfo(sess: &Session) -> (bool, bool) {
13011301
return (false, false);
13021302
}
13031303

1304-
// If we're only producing artifacts that are archives, no need to preserve
1305-
// the objects as they're losslessly contained inside the archives.
1306-
if sess.crate_types().iter().all(|&x| x.is_archive()) {
1307-
return (false, false);
1308-
}
1309-
13101304
match (sess.split_debuginfo(), sess.opts.unstable_opts.split_dwarf_kind) {
13111305
// If there is no split debuginfo then do not preserve objects.
13121306
(SplitDebuginfo::Off, _) => (false, false),

compiler/rustc_session/src/config.rs

-12
Original file line numberDiff line numberDiff line change
@@ -864,18 +864,6 @@ pub enum CrateType {
864864
ProcMacro,
865865
}
866866

867-
impl CrateType {
868-
/// When generated, is this crate type an archive?
869-
pub fn is_archive(&self) -> bool {
870-
match *self {
871-
CrateType::Rlib | CrateType::Staticlib => true,
872-
CrateType::Executable | CrateType::Dylib | CrateType::Cdylib | CrateType::ProcMacro => {
873-
false
874-
}
875-
}
876-
}
877-
}
878-
879867
#[derive(Clone, Hash, Debug, PartialEq, Eq)]
880868
pub enum Passes {
881869
Some(Vec<String>),

tests/run-make-fulldeps/split-debuginfo/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ unpacked-remapped-single:
254254
$(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=unpacked -C debuginfo=2 \
255255
-Z split-dwarf-kind=single --remap-path-prefix $(TMPDIR)=/a foo.rs -g
256256
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
257-
ls $(TMPDIR)/*.o
257+
rm $(TMPDIR)/*.o
258258
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
259259
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
260260
rm $(TMPDIR)/$(call BIN,foo)
261261

262-
unpacked-crosscrate: packed-crosscrate-split packed-crosscrate-single
262+
unpacked-crosscrate: unpacked-crosscrate-split unpacked-crosscrate-single
263263

264264
# - Debuginfo in `.dwo` files
265265
# - (bar) `.rlib` file created, contains `.dwo`

0 commit comments

Comments
 (0)