2020-11-30 08:39:08 -08:00
|
|
|
-include ../tools.mk
|
|
|
|
|
|
|
|
all: off packed unpacked
|
|
|
|
|
|
|
|
ifeq ($(UNAME),Darwin)
|
|
|
|
# If disabled, don't run dsymutil
|
|
|
|
off:
|
|
|
|
rm -rf $(TMPDIR)/*.dSYM
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=off
|
|
|
|
[ ! -d $(TMPDIR)/foo.dSYM ]
|
|
|
|
|
|
|
|
# Packed by default, but only if debuginfo is requested
|
|
|
|
packed:
|
|
|
|
rm -rf $(TMPDIR)/*.dSYM
|
|
|
|
$(RUSTC) foo.rs
|
|
|
|
[ ! -d $(TMPDIR)/foo.dSYM ]
|
|
|
|
rm -rf $(TMPDIR)/*.dSYM
|
|
|
|
$(RUSTC) foo.rs -g
|
|
|
|
[ -d $(TMPDIR)/foo.dSYM ]
|
|
|
|
rm -rf $(TMPDIR)/*.dSYM
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=packed
|
|
|
|
[ -d $(TMPDIR)/foo.dSYM ]
|
|
|
|
rm -rf $(TMPDIR)/*.dSYM
|
|
|
|
|
|
|
|
# Object files are preserved with unpacked and `dsymutil` isn't run
|
|
|
|
unpacked:
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=unpacked
|
|
|
|
ls $(TMPDIR)/*.o
|
|
|
|
[ ! -d $(TMPDIR)/foo.dSYM ]
|
|
|
|
else
|
|
|
|
ifdef IS_WINDOWS
|
|
|
|
# Windows only supports =off
|
|
|
|
off:
|
|
|
|
packed:
|
|
|
|
unpacked:
|
|
|
|
else
|
|
|
|
# If disabled, don't run dsymutil
|
|
|
|
off:
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=off -Z unstable-options
|
|
|
|
[ ! -f $(TMPDIR)/*.dwp ]
|
|
|
|
[ ! -f $(TMPDIR)/*.dwo ]
|
|
|
|
|
|
|
|
$(RUSTC) foo.rs -g
|
|
|
|
[ ! -f $(TMPDIR)/*.dwp ]
|
|
|
|
[ ! -f $(TMPDIR)/*.dwo ]
|
|
|
|
|
sess/cg: re-introduce split dwarf kind
In #79570, `-Z split-dwarf-kind={none,single,split}` was replaced by `-C
split-debuginfo={off,packed,unpacked}`. `-C split-debuginfo`'s packed
and unpacked aren't exact parallels to single and split, respectively.
On Unix, `-C split-debuginfo=packed` will put debuginfo into object
files and package debuginfo into a DWARF package file (`.dwp`) and
`-C split-debuginfo=unpacked` will put debuginfo into dwarf object files
and won't package it.
In the initial implementation of Split DWARF, split mode wrote sections
which did not require relocation into a DWARF object (`.dwo`) file which
was ignored by the linker and then packaged those DWARF objects into
DWARF packages (`.dwp`). In single mode, sections which did not require
relocation were written into object files but ignored by the linker and
were not packaged. However, both split and single modes could be
packaged or not, the primary difference in behaviour was where the
debuginfo sections that did not require link-time relocation were
written (in a DWARF object or the object file).
This commit re-introduces a `-Z split-dwarf-kind` flag, which can be
used to pick between split and single modes when `-C split-debuginfo` is
used to enable Split DWARF (either packed or unpacked).
Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-08 16:10:17 +00:00
|
|
|
packed: packed-split packed-single
|
|
|
|
|
|
|
|
packed-split:
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=packed -Z unstable-options -Zsplit-dwarf-kind=split
|
|
|
|
ls $(TMPDIR)/*.dwp
|
|
|
|
rm -rf $(TMPDIR)/*.dwp $(TMPDIR)/*.dwo
|
|
|
|
|
|
|
|
packed-single:
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=packed -Z unstable-options -Zsplit-dwarf-kind=single
|
2020-11-30 08:39:08 -08:00
|
|
|
ls $(TMPDIR)/*.dwp
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
rm -rf $(TMPDIR)/*.dwp
|
|
|
|
|
2021-12-03 14:24:05 +00:00
|
|
|
packed-remapped: packed-remapped-split packed-remapped-single
|
|
|
|
|
|
|
|
packed-remapped-split:
|
|
|
|
$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 \
|
|
|
|
-Z split-dwarf-kind=split --remap-path-prefix $(TMPDIR)=/a foo.rs -g
|
|
|
|
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
|
|
|
|
|
|
|
|
packed-remapped-single:
|
|
|
|
$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 \
|
|
|
|
-Z split-dwarf-kind=single --remap-path-prefix $(TMPDIR)=/a foo.rs -g
|
|
|
|
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
|
|
|
|
|
|
|
|
packed-crosscrate: packed-crosscrate-split packed-crosscrate-single
|
|
|
|
|
|
|
|
packed-crosscrate-split:
|
|
|
|
$(RUSTC) --crate-type lib -Z unstable-options -C split-debuginfo=packed \
|
|
|
|
-Zsplit-dwarf-kind=split -C debuginfo=2 -g bar.rs
|
|
|
|
ls $(TMPDIR)/*.rlib
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options -C split-debuginfo=packed \
|
|
|
|
-Zsplit-dwarf-kind=split -C debuginfo=2 -g main.rs
|
|
|
|
rm $(TMPDIR)/*.dwo
|
|
|
|
rm $(TMPDIR)/main.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,main)
|
|
|
|
|
|
|
|
packed-crosscrate-single:
|
|
|
|
$(RUSTC) --crate-type lib -Z unstable-options -C split-debuginfo=packed \
|
|
|
|
-Zsplit-dwarf-kind=single -C debuginfo=2 -g bar.rs
|
|
|
|
ls $(TMPDIR)/*.rlib
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib -Z unstable-options -C split-debuginfo=packed \
|
|
|
|
-Zsplit-dwarf-kind=single -C debuginfo=2 -g main.rs
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/main.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,main)
|
|
|
|
|
|
|
|
unpacked: unpacked-split unpacked-single unpacked-remapped-split unpacked-remapped-single
|
sess/cg: re-introduce split dwarf kind
In #79570, `-Z split-dwarf-kind={none,single,split}` was replaced by `-C
split-debuginfo={off,packed,unpacked}`. `-C split-debuginfo`'s packed
and unpacked aren't exact parallels to single and split, respectively.
On Unix, `-C split-debuginfo=packed` will put debuginfo into object
files and package debuginfo into a DWARF package file (`.dwp`) and
`-C split-debuginfo=unpacked` will put debuginfo into dwarf object files
and won't package it.
In the initial implementation of Split DWARF, split mode wrote sections
which did not require relocation into a DWARF object (`.dwo`) file which
was ignored by the linker and then packaged those DWARF objects into
DWARF packages (`.dwp`). In single mode, sections which did not require
relocation were written into object files but ignored by the linker and
were not packaged. However, both split and single modes could be
packaged or not, the primary difference in behaviour was where the
debuginfo sections that did not require link-time relocation were
written (in a DWARF object or the object file).
This commit re-introduces a `-Z split-dwarf-kind` flag, which can be
used to pick between split and single modes when `-C split-debuginfo` is
used to enable Split DWARF (either packed or unpacked).
Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-08 16:10:17 +00:00
|
|
|
|
|
|
|
unpacked-split:
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=unpacked -Z unstable-options -Zsplit-dwarf-kind=split
|
2020-11-30 08:39:08 -08:00
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwo
|
sess/cg: re-introduce split dwarf kind
In #79570, `-Z split-dwarf-kind={none,single,split}` was replaced by `-C
split-debuginfo={off,packed,unpacked}`. `-C split-debuginfo`'s packed
and unpacked aren't exact parallels to single and split, respectively.
On Unix, `-C split-debuginfo=packed` will put debuginfo into object
files and package debuginfo into a DWARF package file (`.dwp`) and
`-C split-debuginfo=unpacked` will put debuginfo into dwarf object files
and won't package it.
In the initial implementation of Split DWARF, split mode wrote sections
which did not require relocation into a DWARF object (`.dwo`) file which
was ignored by the linker and then packaged those DWARF objects into
DWARF packages (`.dwp`). In single mode, sections which did not require
relocation were written into object files but ignored by the linker and
were not packaged. However, both split and single modes could be
packaged or not, the primary difference in behaviour was where the
debuginfo sections that did not require link-time relocation were
written (in a DWARF object or the object file).
This commit re-introduces a `-Z split-dwarf-kind` flag, which can be
used to pick between split and single modes when `-C split-debuginfo` is
used to enable Split DWARF (either packed or unpacked).
Signed-off-by: David Wood <david.wood@huawei.com>
2021-10-08 16:10:17 +00:00
|
|
|
rm -rf $(TMPDIR)/*.dwp $(TMPDIR)/*.dwo
|
|
|
|
|
|
|
|
unpacked-single:
|
|
|
|
$(RUSTC) foo.rs -g -C split-debuginfo=unpacked -Z unstable-options -Zsplit-dwarf-kind=single
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
2021-12-03 14:24:05 +00:00
|
|
|
|
|
|
|
unpacked-remapped-split:
|
|
|
|
$(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 \
|
|
|
|
-Z split-dwarf-kind=split --remap-path-prefix $(TMPDIR)=/a foo.rs -g
|
|
|
|
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
|
|
|
|
|
|
|
|
unpacked-remapped-single:
|
|
|
|
$(RUSTC) -Z unstable-options -C split-debuginfo=unpacked -C debuginfo=2 \
|
|
|
|
-Z split-dwarf-kind=single --remap-path-prefix $(TMPDIR)=/a foo.rs -g
|
|
|
|
objdump -Wi $(TMPDIR)/foo | grep DW_AT_GNU_dwo_name | (! grep $(TMPDIR)) || exit 1
|
2020-11-30 08:39:08 -08:00
|
|
|
endif
|
|
|
|
endif
|