2023-03-30 08:46:31 -05:00
|
|
|
# ignore-cross-compile
|
2022-08-22 19:00:00 -05:00
|
|
|
include ../tools.mk
|
2020-11-30 10:39:08 -06:00
|
|
|
|
|
|
|
all: off packed unpacked
|
|
|
|
|
|
|
|
ifeq ($(UNAME),Darwin)
|
2022-11-07 08:43:28 -06:00
|
|
|
# If disabled, don't run `dsymutil`.
|
2020-11-30 10:39:08 -06:00
|
|
|
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
|
2022-11-07 08:43:28 -06:00
|
|
|
# Windows only supports packed debuginfo - nothing to test.
|
2020-11-30 10:39:08 -06:00
|
|
|
off:
|
|
|
|
packed:
|
|
|
|
unpacked:
|
|
|
|
else
|
2022-11-07 08:43:28 -06:00
|
|
|
# Some non-Windows, non-Darwin platforms are not stable, and some are.
|
2022-06-13 05:40:28 -05:00
|
|
|
ifeq ($(UNAME),Linux)
|
|
|
|
UNSTABLEOPTS :=
|
|
|
|
else
|
|
|
|
UNSTABLEOPTS := -Zunstable-options
|
|
|
|
endif
|
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.o` files
|
|
|
|
# - `.o` deleted
|
|
|
|
# - `.dwo` never created
|
|
|
|
# - `.dwp` never created
|
2020-11-30 10:39:08 -06:00
|
|
|
off:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) foo.rs -g -C $(UNSTABLEOPTS) split-debuginfo=off
|
2020-11-30 10:39:08 -06:00
|
|
|
[ ! -f $(TMPDIR)/*.dwp ]
|
|
|
|
[ ! -f $(TMPDIR)/*.dwo ]
|
|
|
|
$(RUSTC) foo.rs -g
|
|
|
|
[ ! -f $(TMPDIR)/*.dwp ]
|
|
|
|
[ ! -f $(TMPDIR)/*.dwo ]
|
|
|
|
|
2022-11-07 09:15:24 -06:00
|
|
|
packed: packed-split packed-single packed-lto packed-remapped packed-crosscrate
|
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 11:10:17 -05:00
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.dwo` files
|
|
|
|
# - `.o` deleted
|
|
|
|
# - `.dwo` deleted
|
|
|
|
# - `.dwp` present
|
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 11:10:17 -05:00
|
|
|
packed-split:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=packed -Zsplit-dwarf-kind=split
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/foo.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
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 11:10:17 -05:00
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.o` files
|
|
|
|
# - `.o` deleted
|
|
|
|
# - `.dwo` never created
|
|
|
|
# - `.dwp` present
|
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 11:10:17 -05:00
|
|
|
packed-single:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=packed -Zsplit-dwarf-kind=single
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
2020-11-30 10:39:08 -06:00
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
2022-11-07 08:43:28 -06:00
|
|
|
rm $(TMPDIR)/foo.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
2020-11-30 10:39:08 -06:00
|
|
|
|
2022-11-07 09:15:24 -06:00
|
|
|
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
|
|
|
|
|
2021-12-03 08:24:05 -06:00
|
|
|
packed-remapped: packed-remapped-split packed-remapped-single
|
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.dwo` files
|
|
|
|
# - `.o` and binary refer to remapped `.dwo` paths which do not exist
|
|
|
|
# - `.o` deleted
|
|
|
|
# - `.dwo` deleted
|
|
|
|
# - `.dwp` present
|
2021-12-03 08:24:05 -06:00
|
|
|
packed-remapped-split:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=packed -C debuginfo=2 \
|
2021-12-03 08:24:05 -06:00
|
|
|
-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
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/foo.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
2021-12-03 08:24:05 -06:00
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.o` files
|
|
|
|
# - `.o` and binary refer to remapped `.o` paths which do not exist
|
|
|
|
# - `.o` deleted
|
|
|
|
# - `.dwo` never created
|
|
|
|
# - `.dwp` present
|
2021-12-03 08:24:05 -06:00
|
|
|
packed-remapped-single:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=packed -C debuginfo=2 \
|
2021-12-03 08:24:05 -06:00
|
|
|
-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
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/foo.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
2021-12-03 08:24:05 -06:00
|
|
|
|
|
|
|
packed-crosscrate: packed-crosscrate-split packed-crosscrate-single
|
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.dwo` files
|
|
|
|
# - (bar) `.rlib` file created, contains `.dwo`
|
|
|
|
# - (bar) `.o` deleted
|
|
|
|
# - (bar) `.dwo` deleted
|
|
|
|
# - (bar) `.dwp` never created
|
|
|
|
# - (main) `.o` deleted
|
|
|
|
# - (main) `.dwo` deleted
|
|
|
|
# - (main) `.dwp` present
|
2021-12-03 08:24:05 -06:00
|
|
|
packed-crosscrate-split:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) --crate-type lib $(UNSTABLEOPTS) -C split-debuginfo=packed \
|
2021-12-03 08:24:05 -06:00
|
|
|
-Zsplit-dwarf-kind=split -C debuginfo=2 -g bar.rs
|
|
|
|
ls $(TMPDIR)/*.rlib
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
2021-12-03 08:24:05 -06:00
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
2022-11-07 08:43:28 -06:00
|
|
|
$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib $(UNSTABLEOPTS) \
|
2022-06-13 05:40:28 -05:00
|
|
|
-C split-debuginfo=packed -Zsplit-dwarf-kind=split -C debuginfo=2 -g main.rs
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
2021-12-03 08:24:05 -06:00
|
|
|
rm $(TMPDIR)/main.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,main)
|
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.o` files
|
|
|
|
# - (bar) `.rlib` file created, contains `.o`
|
|
|
|
# - (bar) `.o` deleted
|
|
|
|
# - (bar) `.dwo` never created
|
|
|
|
# - (bar) `.dwp` never created
|
|
|
|
# - (main) `.o` deleted
|
|
|
|
# - (main) `.dwo` never created
|
|
|
|
# - (main) `.dwp` present
|
2021-12-03 08:24:05 -06:00
|
|
|
packed-crosscrate-single:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) --crate-type lib $(UNSTABLEOPTS) -C split-debuginfo=packed \
|
2021-12-03 08:24:05 -06:00
|
|
|
-Zsplit-dwarf-kind=single -C debuginfo=2 -g bar.rs
|
|
|
|
ls $(TMPDIR)/*.rlib
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
2021-12-03 08:24:05 -06:00
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
2022-11-07 08:43:28 -06:00
|
|
|
$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib $(UNSTABLEOPTS) \
|
2022-06-13 05:40:28 -05:00
|
|
|
-C split-debuginfo=packed -Zsplit-dwarf-kind=single -C debuginfo=2 -g main.rs
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
2021-12-03 08:24:05 -06:00
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/main.dwp
|
|
|
|
rm $(TMPDIR)/$(call BIN,main)
|
|
|
|
|
2022-11-07 09:15:24 -06:00
|
|
|
unpacked: unpacked-split unpacked-single unpacked-lto unpacked-remapped unpacked-crosscrate
|
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 11:10:17 -05:00
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.dwo` files
|
|
|
|
# - `.o` deleted
|
|
|
|
# - `.dwo` present
|
|
|
|
# - `.dwp` never created
|
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 11:10:17 -05:00
|
|
|
unpacked-split:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=unpacked -Zsplit-dwarf-kind=split
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/*.dwo
|
2020-11-30 10:39:08 -06:00
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
2022-11-07 08:43:28 -06:00
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
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 11:10:17 -05:00
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.o` files
|
|
|
|
# - `.o` present
|
|
|
|
# - `.dwo` never created
|
|
|
|
# - `.dwp` never created
|
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 11:10:17 -05:00
|
|
|
unpacked-single:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) foo.rs -g $(UNSTABLEOPTS) -C split-debuginfo=unpacked -Zsplit-dwarf-kind=single
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o
|
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 11:10:17 -05:00
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
|
|
|
|
2022-11-07 09:15:24 -06:00
|
|
|
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
|
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
unpacked-remapped: unpacked-remapped-split unpacked-remapped-single
|
2021-12-03 08:24:05 -06:00
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.dwo` files
|
|
|
|
# - `.o` and binary refer to remapped `.dwo` paths which do not exist
|
|
|
|
# - `.o` deleted
|
|
|
|
# - `.dwo` present
|
|
|
|
# - `.dwp` never created
|
2021-12-03 08:24:05 -06:00
|
|
|
unpacked-remapped-split:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=unpacked -C debuginfo=2 \
|
2021-12-03 08:24:05 -06:00
|
|
|
-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
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/*.dwo
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
2021-12-03 08:24:05 -06:00
|
|
|
|
2022-11-07 08:43:28 -06:00
|
|
|
# - Debuginfo in `.o` files
|
|
|
|
# - `.o` and binary refer to remapped `.o` paths which do not exist
|
|
|
|
# - `.o` present
|
|
|
|
# - `.dwo` never created
|
|
|
|
# - `.dwp` never created
|
2021-12-03 08:24:05 -06:00
|
|
|
unpacked-remapped-single:
|
2022-06-13 05:40:28 -05:00
|
|
|
$(RUSTC) $(UNSTABLEOPTS) -C split-debuginfo=unpacked -C debuginfo=2 \
|
2021-12-03 08:24:05 -06:00
|
|
|
-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
|
2023-01-15 11:40:46 -06:00
|
|
|
rm $(TMPDIR)/*.o
|
2022-11-07 08:43:28 -06:00
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/$(call BIN,foo)
|
|
|
|
|
2023-01-15 11:40:46 -06:00
|
|
|
unpacked-crosscrate: unpacked-crosscrate-split unpacked-crosscrate-single
|
2022-11-07 08:43:28 -06:00
|
|
|
|
|
|
|
# - Debuginfo in `.dwo` files
|
|
|
|
# - (bar) `.rlib` file created, contains `.dwo`
|
|
|
|
# - (bar) `.o` deleted
|
|
|
|
# - (bar) `.dwo` present
|
|
|
|
# - (bar) `.dwp` never created
|
|
|
|
# - (main) `.o` deleted
|
|
|
|
# - (main) `.dwo` present
|
|
|
|
# - (main) `.dwp` never created
|
|
|
|
unpacked-crosscrate-split:
|
|
|
|
$(RUSTC) --crate-type lib $(UNSTABLEOPTS) -C split-debuginfo=unpacked \
|
|
|
|
-Zsplit-dwarf-kind=split -C debuginfo=2 -g bar.rs
|
|
|
|
ls $(TMPDIR)/*.rlib
|
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwo
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib $(UNSTABLEOPTS) \
|
|
|
|
-C split-debuginfo=unpacked -Zsplit-dwarf-kind=split -C debuginfo=2 -g main.rs
|
|
|
|
ls $(TMPDIR)/*.o && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/*.dwo
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/$(call BIN,main)
|
|
|
|
|
|
|
|
# - Debuginfo in `.o` files
|
|
|
|
# - (bar) `.rlib` file created, contains `.o`
|
|
|
|
# - (bar) `.o` present
|
|
|
|
# - (bar) `.dwo` never created
|
|
|
|
# - (bar) `.dwp` never created
|
|
|
|
# - (main) `.o` present
|
|
|
|
# - (main) `.dwo` never created
|
|
|
|
# - (main) `.dwp` never created
|
|
|
|
unpacked-crosscrate-single:
|
|
|
|
$(RUSTC) --crate-type lib $(UNSTABLEOPTS) -C split-debuginfo=unpacked \
|
|
|
|
-Zsplit-dwarf-kind=single -C debuginfo=2 -g bar.rs
|
|
|
|
ls $(TMPDIR)/*.rlib
|
|
|
|
ls $(TMPDIR)/*.o
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
$(RUSTC) --extern bar=$(TMPDIR)/libbar.rlib $(UNSTABLEOPTS) \
|
|
|
|
-C split-debuginfo=unpacked -Zsplit-dwarf-kind=single -C debuginfo=2 -g main.rs
|
|
|
|
ls $(TMPDIR)/*.o
|
|
|
|
ls $(TMPDIR)/*.dwo && exit 1 || exit 0
|
|
|
|
ls $(TMPDIR)/*.dwp && exit 1 || exit 0
|
|
|
|
rm $(TMPDIR)/$(call BIN,main)
|
2020-11-30 10:39:08 -06:00
|
|
|
endif
|
|
|
|
endif
|