Skip to content

Usage of LLVM_DWP_EXECUTABLE doesn't play nicely with --out-dir #85471

New issue

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

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

Already on GitHub? # to your account

Closed
infinity0 opened this issue May 19, 2021 · 6 comments
Closed

Usage of LLVM_DWP_EXECUTABLE doesn't play nicely with --out-dir #85471

infinity0 opened this issue May 19, 2021 · 6 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@infinity0
Copy link
Contributor

$ rustc --version
rustc 1.52.1
$ rm -f hello hello.dwp; RUSTC_BOOTSTRAP=1 rustc hello.rs -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 
$ ls -gG hello hello.dwp 
-rwxr-xr-x 1 10792848 May 19 15:31 hello*
-rw-r--r-- 1    33864 May 19 15:31 hello.dwp

Ok, that worked. But adding --out-dir $PWD makes it fail:

$ rust-llvm-dwp --version
LLVM (http://llvm.org/):
  LLVM version 11.0.1
  
  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: skylake
$ rm -f hello hello.dwp; RUSTC_BOOTSTRAP=1 rustc hello.rs -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 --out-dir $PWD
error: linking dwarf objects with `rust-llvm-dwp` failed: exit code: 1
  |
  = note: "rust-llvm-dwp" "-e" "/home/infinity0/var/lib/rust/hello" "-o" "/home/infinity0/var/lib/rust/hello.dwp"
  = note: 
  = note: error: No such file or directory
          

error: aborting due to previous error

$ echo $?
0
# furthermore, the exit code from rustc is 0
$ ls -gG hello hello.dwp 
ls: cannot access 'hello.dwp': No such file or directory
-rwxr-xr-x 1 10793312 May 19 15:31 hello*
exit code 2
@infinity0 infinity0 added the C-bug Category: This is a bug. label May 19, 2021
@jonas-schievink jonas-schievink added A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-linkage Area: linking into static, shared libraries and binaries T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 19, 2021
@infinity0
Copy link
Contributor Author

ping @davidtwco who wrote the original code in e3fdae9

@infinity0
Copy link
Contributor Author

I'm using Debian's LLVM 11.0.1. This issue makes both run-make-fulldeps/split-dwarf and run-make-fulldeps/split-debuginfo fail - does rust exclude these from CI or something?

@infinity0
Copy link
Contributor Author

Looks like this is an issue with LLVM 11's llvm-dwp; LLVM 12 works for me. I suggest the LLVM_DWP_EXECUTABLE functionality be gated on LLVM 12.

@nagisa
Copy link
Member

nagisa commented May 20, 2021

Yeah, I believe this was fixed by https://reviews.llvm.org/rG6ffcb2937c96bd0d7a55b984b5eb8f381b68e322. I'm not sure there's any way to gracefully fallback on some other behaviour/implementation, sadly.

@cuviper
Copy link
Member

cuviper commented Oct 19, 2021

I just ran into this in #90062, and I added gates to the run-make-fulldeps tests. I guess you could patch your system llvm-dwp to let it work in general, but I'm going to mark it closed with that PR.

@cuviper cuviper linked a pull request Oct 19, 2021 that will close this issue
@cuviper
Copy link
Member

cuviper commented Oct 26, 2021

We decided to go ahead and make the minimum LLVM 12 in #90175.

@cuviper cuviper closed this as completed Oct 26, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-linkage Area: linking into static, shared libraries and binaries C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants