about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-02-23 10:02:16 +0000
committerbors <bors@rust-lang.org>2021-02-23 10:02:16 +0000
commit446d4533e89db04f9568be4199e56b5fce0d176d (patch)
treed92d9b66adc9e9d7ac8a1cc022187799297cc4fd /src
parentcd64446196a02e593c5f50b8d863161306da43f7 (diff)
parent925ed4828d06f298ad0a6fa32550bbefeee72bd1 (diff)
downloadrust-446d4533e89db04f9568be4199e56b5fce0d176d.tar.gz
rust-446d4533e89db04f9568be4199e56b5fce0d176d.zip
Auto merge of #82102 - nagisa:nagisa/fix-dwo-name, r=davidtwco
Set path of the compile unit to the source directory

As part of the effort to implement split dwarf debug info, we ended up
setting the compile unit location to the output directory rather than
the source directory. Furthermore, it seems like we failed to remap the
prefixes for this as well!

The desired behaviour is to instead set the `DW_AT_GNU_dwo_name` to a
path relative to compiler's working directory. This still allows
debuggers to find the split dwarf files, while not changing the
behaviour of the code that is compiling with regular debug info, and not
changing the compiler's behaviour with regards to reproducibility.

Fixes #82074

cc `@alexcrichton` `@davidtwco`
Diffstat (limited to 'src')
m---------src/llvm-project0
-rw-r--r--src/test/codegen/debug-compile-unit-path.rs9
-rw-r--r--src/test/run-make-fulldeps/split-debuginfo/Makefile2
-rw-r--r--src/test/run-make-fulldeps/split-dwarf/Makefile1
4 files changed, 12 insertions, 0 deletions
diff --git a/src/llvm-project b/src/llvm-project
-Subproject 70d09f218d1c84fedabdb74881e214dacd5b0c3
+Subproject 2a054c1e4fb04756b7f0509eeae63289db0df88
diff --git a/src/test/codegen/debug-compile-unit-path.rs b/src/test/codegen/debug-compile-unit-path.rs
new file mode 100644
index 00000000000..fcb66e08576
--- /dev/null
+++ b/src/test/codegen/debug-compile-unit-path.rs
@@ -0,0 +1,9 @@
+// compile-flags: -g --remap-path-prefix={{cwd}}=/cwd/ --remap-path-prefix={{src-base}}=/base/
+// ignore-tidy-linelength
+//
+// Ensure that we remap the compile unit directory and that we set it to the compilers current
+// working directory and not something else.
+#![crate_type="rlib"]
+
+// CHECK-DAG: [[FILE:![0-9]*]] = !DIFile(filename: "/base/debug-compile-unit-path.rs{{.*}}", directory: "/cwd/")
+// CHECK-DAG: {{![0-9]*}} = distinct !DICompileUnit({{.*}}file: [[FILE]]
diff --git a/src/test/run-make-fulldeps/split-debuginfo/Makefile b/src/test/run-make-fulldeps/split-debuginfo/Makefile
index e8e62efe01c..c89f2ae8349 100644
--- a/src/test/run-make-fulldeps/split-debuginfo/Makefile
+++ b/src/test/run-make-fulldeps/split-debuginfo/Makefile
@@ -1,5 +1,7 @@
 -include ../tools.mk
 
+# min-llvm-version: 11.0
+
 all: off packed unpacked
 
 ifeq ($(UNAME),Darwin)
diff --git a/src/test/run-make-fulldeps/split-dwarf/Makefile b/src/test/run-make-fulldeps/split-dwarf/Makefile
index 93dfc8e76a9..e89cc1b2ede 100644
--- a/src/test/run-make-fulldeps/split-dwarf/Makefile
+++ b/src/test/run-make-fulldeps/split-dwarf/Makefile
@@ -1,6 +1,7 @@
 -include ../tools.mk
 
 # only-linux
+# min-llvm-version: 11.0
 
 all:
 	$(RUSTC) -Z unstable-options -C split-debuginfo=packed foo.rs -g