Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #104387

Merged
merged 21 commits into from
Nov 14, 2022
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
32a3130
Upgrade dist-x86_64-netbsd to NetBSD 9.0
cuviper Oct 19, 2022
8dbd817
Upgrade cc for working is_flag_supported on cross-compiles
palfrey Oct 29, 2022
a9d7cfc
Update cc in Cargo.lock
palfrey Oct 29, 2022
9bcc083
run-make-fulldeps: fix split debuginfo test
davidtwco Nov 7, 2022
29dc083
llvm: dwo only emitted when object code emitted
davidtwco Nov 7, 2022
758868c
Return .efi extension for EFI executable
Ayush1325 Nov 8, 2022
18129b6
Upgrade cc to 1.0.76
palfrey Nov 9, 2022
07aa592
Regression test for coercion of mut-ref to dyn-star
compiler-errors Nov 10, 2022
461d147
Document `Path::parent` behavior around relative paths
tbu- Nov 11, 2022
34c6b6c
Enable profiler in dist-s390x-linux
uweigand Nov 11, 2022
df86ad8
Add `delay_span_bug` to `AttrWrapper::take_for_recovery`
WaffleLapkin Nov 13, 2022
1bf8f87
Add a few known-bug tests
jackh726 Nov 9, 2022
1b91bdf
Rollup merge of #103709 - cuviper:netbsd-9, r=pietroalbini
Manishearth Nov 14, 2022
c9fc5cb
Rollup merge of #103744 - palfrey:unwind-upgrade-cc, r=Mark-Simulacrum
Manishearth Nov 14, 2022
e284780
Rollup merge of #104105 - davidtwco:split-dwarf-lto, r=michaelwoerister
Manishearth Nov 14, 2022
7c67cb2
Rollup merge of #104158 - Ayush1325:executable, r=Mark-Simulacrum
Manishearth Nov 14, 2022
d76058d
Rollup merge of #104181 - jackh726:known-bug-tests, r=Mark-Simulacrum
Manishearth Nov 14, 2022
cc96cdd
Rollup merge of #104266 - compiler-errors:issue-102430, r=Mark-Simula…
Manishearth Nov 14, 2022
c7004f9
Rollup merge of #104300 - tbu-:pr_path_parent_caveats, r=Mark-Simulacrum
Manishearth Nov 14, 2022
7678cfd
Rollup merge of #104304 - uweigand:s390x-profiler, r=Mark-Simulacrum
Manishearth Nov 14, 2022
4fdd944
Rollup merge of #104362 - WaffleLapkin:span_bug_won't_come_on_time_to…
Manishearth Nov 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
llvm: dwo only emitted when object code emitted
`CompiledModule` should not think a DWARF object was emitted when a
bitcode-only compilation has happened, this can confuse archive file
creation (which expects to create an archive containing non-existent dwo
files).

Signed-off-by: David Wood <david.wood@huawei.com>
  • Loading branch information
davidtwco committed Nov 8, 2022
commit 29dc08307dde3051ab6bf17c53f2db99e32681ee
16 changes: 13 additions & 3 deletions compiler/rustc_codegen_llvm/src/back/write.rs
Original file line number Diff line number Diff line change
@@ -765,11 +765,21 @@ pub(crate) unsafe fn codegen(
drop(handlers);
}

// `.dwo` files are only emitted if:
//
// - Object files are being emitted (i.e. bitcode only or metadata only compilations will not
// produce dwarf objects, even if otherwise enabled)
// - Target supports Split DWARF
// - Split debuginfo is enabled
// - Split DWARF kind is `split` (i.e. debuginfo is split into `.dwo` files, not different
// sections in the `.o` files).
let dwarf_object_emitted = matches!(config.emit_obj, EmitObj::ObjectCode(_))
&& cgcx.target_can_use_split_dwarf
&& cgcx.split_debuginfo != SplitDebuginfo::Off
&& cgcx.split_dwarf_kind == SplitDwarfKind::Split;
Ok(module.into_compiled_module(
config.emit_obj != EmitObj::None,
cgcx.target_can_use_split_dwarf
&& cgcx.split_debuginfo != SplitDebuginfo::Off
&& cgcx.split_dwarf_kind == SplitDwarfKind::Split,
dwarf_object_emitted,
config.emit_bc,
&cgcx.output_filenames,
))
56 changes: 54 additions & 2 deletions src/test/run-make-fulldeps/split-debuginfo/Makefile
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ off:
[ ! -f $(TMPDIR)/*.dwp ]
[ ! -f $(TMPDIR)/*.dwo ]

packed: packed-split packed-single packed-remapped packed-crosscrate
packed: packed-split packed-single packed-lto packed-remapped packed-crosscrate

# - Debuginfo in `.dwo` files
# - `.o` deleted
@@ -77,6 +77,32 @@ packed-single:
rm $(TMPDIR)/foo.dwp
rm $(TMPDIR)/$(call BIN,foo)

packed-lto: packed-lto-split packed-lto-single

# - rmeta file added to rlib, no object files are generated and thus no debuginfo is generated
# - `.o` never created
# - `.dwo` never created
# - `.dwp` never created
packed-lto-split:
$(RUSTC) baz.rs -g $(UNSTABLEOPTS) -Csplit-debuginfo=packed -Zsplit-dwarf-kind=split \
--crate-type=rlib -Clinker-plugin-lto
ls $(TMPDIR)/*.o && exit 1 || exit 0
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
rm $(TMPDIR)/libbaz.rlib

# - rmeta file added to rlib, no object files are generated and thus no debuginfo is generated
# - `.o` never created
# - `.dwo` never created
# - `.dwp` never created
packed-lto-single:
$(RUSTC) baz.rs -g $(UNSTABLEOPTS) -Csplit-debuginfo=packed -Zsplit-dwarf-kind=single \
--crate-type=rlib -Clinker-plugin-lto
ls $(TMPDIR)/*.o && exit 1 || exit 0
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
rm $(TMPDIR)/libbaz.rlib

packed-remapped: packed-remapped-split packed-remapped-single

# - Debuginfo in `.dwo` files
@@ -153,7 +179,7 @@ packed-crosscrate-single:
rm $(TMPDIR)/main.dwp
rm $(TMPDIR)/$(call BIN,main)

unpacked: unpacked-split unpacked-single unpacked-remapped unpacked-crosscrate
unpacked: unpacked-split unpacked-single unpacked-lto unpacked-remapped unpacked-crosscrate

# - Debuginfo in `.dwo` files
# - `.o` deleted
@@ -177,6 +203,32 @@ unpacked-single:
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
rm $(TMPDIR)/$(call BIN,foo)

unpacked-lto: packed-lto-split packed-lto-single

# - rmeta file added to rlib, no object files are generated and thus no debuginfo is generated
# - `.o` never created
# - `.dwo` never created
# - `.dwp` never created
unpacked-lto-split:
$(RUSTC) baz.rs -g $(UNSTABLEOPTS) -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=split \
--crate-type=rlib -Clinker-plugin-lto
ls $(TMPDIR)/*.o && exit 1 || exit 0
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
rm $(TMPDIR)/libbaz.rlib

# - rmeta file added to rlib, no object files are generated and thus no debuginfo is generated
# - `.o` never created
# - `.dwo` never created
# - `.dwp` never created
unpacked-lto-single:
$(RUSTC) baz.rs -g $(UNSTABLEOPTS) -Csplit-debuginfo=unpacked -Zsplit-dwarf-kind=single \
--crate-type=rlib -Clinker-plugin-lto
ls $(TMPDIR)/*.o && exit 1 || exit 0
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
rm $(TMPDIR)/libbaz.rlib

unpacked-remapped: unpacked-remapped-split unpacked-remapped-single

# - Debuginfo in `.dwo` files
1 change: 1 addition & 0 deletions src/test/run-make-fulldeps/split-debuginfo/baz.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// empty