[all-commits] [llvm/llvm-project] b1106a: [llvm-dwp] Join dwo paths correctly when DWOPath i...
Simonas Kazlauskas via All-commits
all-commits at lists.llvm.org
Fri Feb 19 19:42:25 PST 2021
Branch: refs/heads/release/12.x
Home: https://github.com/llvm/llvm-project
Commit: b1106a5b3bc94f6da11682007d101823f81bad30
https://github.com/llvm/llvm-project/commit/b1106a5b3bc94f6da11682007d101823f81bad30
Author: Simonas Kazlauskas <git at kazlauskas.me>
Date: 2021-02-19 (Fri, 19 Feb 2021)
Changed paths:
A llvm/test/tools/llvm-dwp/X86/absolute_paths.test
M llvm/tools/llvm-dwp/llvm-dwp.cpp
Log Message:
-----------
[llvm-dwp] Join dwo paths correctly when DWOPath is absolute
When the `DWOPath` is absolute, we want to use `DWOPath` as is, without prepending any other
components to the path. The `sys::path::append` does not join, but rather unconditionally appends
the paths, so something like `sys::path::append("/tmp", "/tmp/banana")` will result in
`/tmp/tmp/banana` rather than the desired `/tmp/banana`.
This then causes `llvm-dwp` to fail in a following situation:
```
$ clang -gsplit-dwarf /tmp/banana/test.c -c -o /tmp/outdir/foo.o
$ clang outdir/foo.o -o outdir/hm
$ llvm-dwarfdump outdir/hm | grep -C2 foo.dwo
DW_AT_comp_dir ("/tmp")
DW_AT_GNU_pubnames (true)
DW_AT_GNU_dwo_name ("/tmp/outdir/foo.dwo")
DW_AT_GNU_dwo_id (0xde4d396f3bf0e257)
DW_AT_low_pc (0x0000000000401100)
$ strace -o trace llvm-dwp -e outdir/hm -o outdir/hm.dwp
error: No such file or directory
$ cat trace | grep foo.dwo
openat(AT_FDCWD, "/tmp/tmp/outdir/foo.dwo", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
```
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D96678
(cherry picked from commit 6ffcb2937c96bd0d7a55b984b5eb8f381b68e322)
More information about the All-commits
mailing list